/* Modern Color Palette */
:root {
  --primary: #1a73e8;
  --primary-dark: #0d47a1;
  --secondary: #4db6ac;
  --accent: #ff7043;
  --light: #f8f9fa;
  --dark: #2d3748;
  --gray: #6c757d;
  --light-gray: #e9ecef;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --sidebar-width: 280px;
  --sidebar-collapsed: 70px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
  background: inherit;
  font-family: inherit;
  font-size: inherit;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f0f7ff 0%, #f8fdff 100%);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

h4 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

h5 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--gray);
  line-height: 1.7;
}

/* Layout */
#wrapper {
  min-height: 100vh;
}

/* Sidebar */
#sidebar-wrapper {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  transition: var(--transition);
  position: fixed;
  height: 100%;
  overflow-y: auto;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

#sidebar-wrapper.collapsed {
  width: var(--sidebar-collapsed);
}

#sidebarToggler {
  position: fixed;
  left: var(--sidebar-width);
  top: 20px;
  background: white;
  border: none;
  padding: 10px;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: var(--transition);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

#sidebarToggler i {
  font-size: 1.2rem;
  color: var(--primary);
}

#sidebar-wrapper.collapsed+#content #sidebarToggler {
  left: var(--sidebar-collapsed);
}

#content {
  margin-left: var(--sidebar-width);
  padding: 2rem;
  width: calc(100% - var(--sidebar-width));
  transition: var(--transition);
  animation: fadeIn 0.5s ease;
}

#sidebar-wrapper.collapsed+#content {
  margin-left: var(--sidebar-collapsed);
  width: calc(100% - var(--sidebar-collapsed));
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

/* Sidebar Content */
.sidebar-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h4 {
  color: white;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.profile-details {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.25rem;
  color: white;
  flex-shrink: 0;
}

.profile-text {
  flex-grow: 1;
  transition: var(--transition);
  overflow: hidden;
}

.profile-text p {
  color: white;
  margin-bottom: 0.25rem;
  font-weight: 500;
  white-space: nowrap;
}

.profile-text small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

#sidebar-wrapper.collapsed .profile-text {
  opacity: 0;
  width: 0;
}

/* Sidebar Menu */
#sidebarMenu {
  padding: 1rem 0;
  flex-grow: 1;
}

#sidebarMenu .nav-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.9rem 1.5rem;
  transition: var(--transition);
  border-left: 4px solid transparent;
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 0.25rem 0.5rem;
  border-radius: 0 8px 8px 0;
}

#sidebarMenu .nav-link i {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

#sidebarMenu .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: translateX(5px);
}

#sidebarMenu .nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: var(--accent);
  color: white;
}

#sidebar-wrapper.collapsed .nav-link span {
  opacity: 0;
  width: 0;
  display: none;
}

/* Login Page */
#login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #e6f0fa 0%, #f5f7fa 100%);
  animation: fadeIn 0.5s ease;
  padding: 1rem;
}

.login-container {
  max-width: 450px;
  width: 100%;
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: var(--transition);
}

.login-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2.5rem 2rem;
  text-align: center;
}

.login-header h1 {
  color: white;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0;
}

.login-body {
  padding: 2rem;
}

.form-label {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.form-control {
  border-radius: 10px;
  border: 1px solid var(--light-gray);
  padding: 0.85rem 1rem;
  transition: var(--transition);
  font-size: 1rem;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
  outline: none;
}

.login-footer {
  padding: 1.5rem 2rem;
  background-color: var(--light);
  text-align: center;
  border-top: 1px solid var(--light-gray);
}

/* Buttons */
.btn {
  border-radius: 10px;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(26, 115, 232, 0.25);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(26, 115, 232, 0.35);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 1px solid var(--light-gray);
}

.btn-secondary:hover {
  background: var(--light);
  transform: translateY(-3px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #b02a37 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.25);
}

.btn-danger:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.35);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Cards */
.card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  background: white;
  transition: var(--transition);
  overflow: hidden;
  animation: slideIn 0.3s ease;
  margin-bottom: 1.5rem;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
  background: white;
  border-bottom: 1px solid var(--light-gray);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background: white;
  border-top: 1px solid var(--light-gray);
  padding: 1.25rem 1.5rem;
}

/* Stats Cards */
.stats-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  animation: slideIn 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stats-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stats-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.75rem;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.stats-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0.5rem 0;
}

.stats-label {
  font-size: 1.1rem;
  color: var(--gray);
}

/* Patient Cards */
.patient-card {
  transition: var(--transition);
  height: 100%;
}

.patient-card:hover {
  transform: translateY(-5px);
}

.patient-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary) 0%, #00897b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.5rem;
  margin-right: 1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

/* Image Preview */
.image-preview-container {
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  max-width: 400px;
  margin: 1rem 0;
  border: 1px solid var(--light-gray);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.image-preview-container img {
  width: 100%;
  display: block;
}

/* Progress Indicator */
.progress-container {
  border-radius: 12px;
  background: linear-gradient(135deg, #e6f7ff 0%, #f0faff 100%);
  padding: 1.5rem;
  text-align: center;
  animation: pulse 2s infinite;
  border: 1px solid rgba(26, 115, 232, 0.1);
  margin: 1.5rem 0;
}

/* Utility Classes */
.d-none {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.mb-1 {
  margin-bottom: 0.25rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.p-3 {
  padding: 1rem !important;
}

.text-muted {
  color: var(--gray) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.text-success {
  color: var(--success) !important;
}

.bg-light {
  background-color: var(--light) !important;
}

.rounded {
  border-radius: 10px !important;
}

.d-flex {
  display: flex;
}

.align-items-center {
  align-items: center;
}

.justify-content-between {
  justify-content: space-between;
}

.flex-column {
  flex-direction: column;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.75rem;
}

.col {
  flex: 1;
  padding: 0.75rem;
}

.col-md-4 {
  flex: 0 0 33.333%;
  max-width: 33.333%;
}

.col-md-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.w-100 {
  width: 100%;
}

.alert {
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.2);
  color: var(--danger);
}

/* Responsive Design */
@media (max-width: 992px) {
  .col-md-4 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 768px) {
  #sidebar-wrapper {
    width: var(--sidebar-collapsed);
  }

  #sidebar-wrapper.collapsed {
    width: 0;
  }

  #content {
    margin-left: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
    padding: 1.5rem;
  }

  #sidebar-wrapper.collapsed+#content {
    margin-left: 0;
    width: 100%;
  }

  .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 576px) {
  #content {
    padding: 1rem;
  }

  .login-body {
    padding: 1.5rem;
  }

  .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}