:root {
  --primary-color: #003087;
  --primary-dark: #002a6a; /* Changed to a lighter dark blue */
  --secondary-color: #64748b;
  --success-color: #059669;
  --info-color: #0284c7;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --light-color: #ffffff;
  --dark-color: #1e293b;
  --white: #ffffff;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --text-primary: #1a202c;
  --text-secondary: #718096;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --sidebar-width: 280px;
  --topbar-height: 80px;
  --sidebar-width-mobile: 280px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden; /* Prevent body from scrolling */
}
/* Modern Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--white);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.brand-logo {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.brand-text h4 {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.brand-text small {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.sidebar-nav {
  padding: 1rem 0;
}

.nav-section {
  margin-bottom: 2rem;
}

.nav-section-title {
  padding: 0 1.5rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
}

.nav-item {
  margin: 0.25rem 1rem;
}
.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.2s ease;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-left-color: var(--white);
  transform: translateX(4px);
}

.nav-link i {
  width: 20px;
  margin-right: 12px;
  font-size: 1.1rem;
}

/* Modern Topbar */
.topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: fixed;
  top: 0;
  left: var(--sidebar-width); /* Aligns with main content area */
  width: calc(100% - var(--sidebar-width)); /* Spans remaining width */
  z-index: 999;
  box-shadow: var(--shadow-sm);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Added transition for responsiveness */
}

/* Modern Main Content */
.main-content {
  position: absolute; /* Position absolutely to fill remaining space */
  top: var(--topbar-height); /* Starts below the topbar */
  left: var(--sidebar-width); /* Starts next to the sidebar */
  width: calc(100% - var(--sidebar-width)); /* Fills remaining width */
  height: calc(100vh - var(--topbar-height)); /* Fills remaining height */
  overflow-y: auto; /* Enable vertical scrolling for content */
  overflow-x: hidden; /* Prevent horizontal scrolling */
  background: var(--bg-primary); /* Ensure it has a background */
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Added transition for responsiveness */
}

.topbar-left {
  display: flex;
  align-items: center;
}
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-right: 1rem;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.sidebar-toggle:hover {
  background: var(--bg-primary);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 12px;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.user-profile:hover {
  background: var(--bg-primary);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}
.user-info h6 {
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.user-info small {
  color: var(--text-secondary);
}

/* Modern Dashboard Content */
.dashboard-content {
  padding: 0 2rem 2rem; /* Removed top padding, kept right/left/bottom */
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-radius: 24px;
  padding: 3rem; /* Reset to original padding */
  margin-bottom: 2rem;
  color: white;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}
.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}
.student-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}
.meta-item i {
  opacity: 0.8;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-hero {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.btn-hero:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateY(-2px);
}
/* Modern Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.stat-card.success::before {
  background: linear-gradient(90deg, var(--success-color), #10b981);
}

.stat-card.warning::before {
  background: linear-gradient(90deg, var(--warning-color), #f59e0b);
}

.stat-card.info::before {
  background: linear-gradient(90deg, var(--info-color), #06b6d4);
}
.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.stat-card.success .stat-icon {
  background: linear-gradient(135deg, var(--success-color), #10b981);
}

.stat-card.warning .stat-icon {
  background: linear-gradient(135deg, var(--warning-color), #f59e0b);
}

.stat-card.info .stat-icon {
  background: linear-gradient(135deg, var(--info-color), #06b6d4);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.stat-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
/* Modern Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.content-card {
  background: var(--white);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}
.card-title {
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title i {
  color: var(--text-secondary);
}

.card-body {
  padding: 2rem;
}
/* Subject Cards */
.subject-grid {
  display: grid;
  gap: 1rem;
}

.subject-item {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.subject-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.subject-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.subject-code {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.9rem;
}

.subject-name {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.subject-teacher {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-completed {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.status-pending {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning-color);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.btn-evaluate {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  margin-top: 1rem;
}
.btn-evaluate:hover {
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--success-color), #10b981);
  color: white;
}
.activity-content h6 {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.activity-content p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}
.activity-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
}
.rating-stars {
  color: #fbbf24;
}

.activity-date {
  color: var(--text-secondary);
}
/* Empty States */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}
.empty-state h6 {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width-mobile); /* Ensure consistent width */
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    /* Default for mobile when sidebar is closed */
    left: 0 !important;
    width: 100% !important;
    /* Add transition for smooth movement */
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .topbar {
    /* Default for mobile when sidebar is closed */
    left: 0 !important;
    width: 100% !important;
    /* Add transition for smooth movement */
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* When sidebar is open on mobile - MOVED INSIDE MEDIA QUERY */
  body.sidebar-open .main-content {
    left: var(--sidebar-width-mobile) !important;
    width: calc(100% - var(--sidebar-width-mobile)) !important;
  }

  body.sidebar-open .topbar {
    left: var(--sidebar-width-mobile) !important;
    width: calc(100% - var(--sidebar-width-mobile)) !important;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0) !important; /* Ensure sidebar is visible */
  }

  .sidebar-toggle {
    display: block !important;
  }

  .topbar {
    padding: 0 1rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .dashboard-content {
    padding: 0 1rem 1rem; /* Adjusted padding for mobile, removed top padding */
  }

  .hero-section {
    padding: 2rem 1.5rem; /* Simplified padding for mobile */
    text-align: center;
  }

  .hero-title {
    font-size: 2rem;
  }
  .student-meta {
    justify-content: center;
    gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-card {
    padding: 1.5rem;
  }

  .content-card .card-body {
    padding: 1rem;
  }
  .user-info {
    display: none;
  }
}

@media (max-width: 576px) {
  .hero-section {
    padding: 1.5rem 1rem; /* Further simplified padding for smaller mobile */
  }

  .hero-title {
    font-size: 1.75rem;
  }
  .student-meta {
    flex-direction: column;
    gap: 0.75rem;
  }
  .hero-actions {
    justify-content: center;
  }

  .stat-value {
    font-size: 2rem;
  }

  .topbar {
    padding: 0 0.75rem;
  }

  .dashboard-content {
    padding: 0 0.75rem 0.75rem;
  }
}
/* Login Page Specific Styles (Adapted to new theme) */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--primary-dark); /* Now uses the lighter dark blue */
  padding: 20px;
  box-sizing: border-box;
}

.login-card {
  background-color: var(--white);
  border-radius: 20px; /* More rounded corners */
  box-shadow: var(--shadow-lg); /* Prominent shadow */
  width: 480px;
  max-width: 95%;
  text-align: center;
  overflow: hidden;
  padding: 30px; /* Direct padding */
  border: 1px solid var(--border-color);
}
.login-card-header {
  background: none; /* No distinct header background */
  color: var(--text-primary);
  padding: 0;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
}

.login-card-header .school-logo {
  width: 120px; /* Keep width/height for the image to fit */
  height: 120px;
  margin: 0 auto 1rem; /* Center the logo horizontally and add some space below */
}

/* New style for the image inside school-logo */
.school-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensure the image fits within the container */
}

.login-card-header h2 {
  margin: 0;
  color: var(--primary-color); /* Primary color for title */
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0;
  border-bottom: none;
  padding-bottom: 0;
}
.login-card-body {
  padding: 0; /* No extra padding, handled by .login-card */
}

.login-instructions-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 25px;
  line-height: 1.5;
}

/* Input Group Styles (Adapted to new theme) */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}
.input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 12px; /* More rounded */
  overflow: hidden;
  background-color: var(--bg-primary); /* Light background for inputs */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.1); /* Subtle primary color shadow */
}

.input-group-icon {
  padding: 12px 15px;
  background-color: var(--bg-primary); /* Match input background */
  border-right: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
}
.input-group input[type="text"],
.input-group input[type="password"] {
  flex-grow: 1;
  padding: 12px 15px;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-primary);
  background-color: transparent;
}

.input-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.form-group .help-block {
  color: var(--danger-color);
  font-size: 0.85rem;
  margin-top: 5px;
  display: block;
}

/* Button Styles (Adapted to new theme) */
.btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 14px 30px;
  border: none;
  border-radius: 12px; /* More rounded */
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-block;
  width: 100%;
  margin-top: 10px;
  box-shadow: var(--shadow-md);
}

.btn:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Alert Messages (Adapted to new theme) */
.alert {
  padding: 15px;
  background-color: #ffe0e0; /* Light red */
  color: var(--danger-color);
  margin-bottom: 20px;
  border-radius: 12px;
  font-weight: 500;
  text-align: center;
  border: 1px solid #ffb3b3;
  font-size: 0.95rem;
}
.alert.alert-success {
  background-color: #d4edda; /* Light green */
  color: #155724; /* Dark green */
  border-color: #c3e6cb;
}

.contact-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 30px;
}

/* New styles for Quick Links */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.quick-link-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: center;
}

.quick-link-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  background-color: var(--primary-color);
  color: var(--white);
}

.quick-link-item i {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
  transition: color 0.2s ease;
}

.quick-link-item:hover i {
  color: var(--white);
}

.quick-link-item span {
  font-size: 0.9rem;
}

/* Responsive adjustments for login page */
@media (max-width: 576px) {
  .login-card {
    padding: 20px;
  }
  .login-card-header h2 {
    font-size: 1.8rem;
  }
  .login-instructions-text {
    font-size: 0.9rem;
  }
  .input-group input {
    font-size: 0.9rem;
    padding: 10px 12px;
  }
  .input-group-icon {
    padding: 10px 12px;
    font-size: 1rem;
  }
  .btn {
    font-size: 1rem;
    padding: 12px 25px;
  }
  .contact-info {
    font-size: 0.8rem;
  }

  .quick-links-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}
