/* Base Styles & Variables */
:root {
  /* Light Mode */
  --primary-color: #0056b3; /* Darker Blue */
  --secondary-color: #007bff; /* Main Blue */
  --text-color: #333;
  --heading-color: #222;
  --background-color: #f8f9fa; /* Light Grey */
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
  --hero-overlay: rgba(0, 0, 0, 0.6);
  --footer-bg: #2c3e50; /* Dark Blue-Grey */
  --footer-text: #ecf0f1;
  --link-hover-color: #004085;
  --error-color: #dc3545;
  --success-color: #28a745;
}

body.dark-mode {
  /* Dark Mode */
  --primary-color: #6c5ce7; /* Purple */
  --secondary-color: #a29bfe; /* Lighter Purple */
  --text-color: #e0e0e0;
  --heading-color: #f8f9fa;
  --background-color: #1a202c; /* Dark Grey */
  --card-bg: #2d3748;
  --border-color: #4a5568;
  --hero-overlay: rgba(0, 0, 0, 0.75);
  --footer-bg: #1a202c;
  --footer-text: #b0b0b0;
  --link-hover-color: #8c7ae6;
}

/* Global Reset & Box Sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--link-hover-color);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  padding: 12px 25px;
  border-radius: 5px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}

.btn:hover {
  background: var(--link-hover-color);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--secondary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
}

.btn-small {
  padding: 8px 15px;
  font-size: 0.9rem;
}

/* Header */
header {
  background-color: var(--card-bg);
  color: var(--text-color);
  padding: 15px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  height: 50px;
  width: auto;
  border-radius: 50%;
  object-fit: cover;
}

.logo h1 {
  font-size: 1.8rem;
  color: var(--heading-color);
  margin: 0;
}

.main-nav .nav-links {
  display: flex;
  gap: 25px;
}

.main-nav .nav-links a {
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s ease;
  padding: 5px 0;
  position: relative;
}

.main-nav .nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary-color);
  transition: width 0.3s ease;
}

.main-nav .nav-links a:hover::after,
.main-nav .nav-links a.active-link::after {
  width: 100%;
}

.hamburger {
  display: none; /* Hidden on desktop */
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-color);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
  transition: color 0.3s ease, transform 0.2s ease;
  margin-left: 15px; /* Spacing from nav */
}

.theme-toggle:hover {
  color: var(--secondary-color);
  transform: rotate(15deg);
}

/* Hero Section */
.hero-section {
  background: url('../images/hero-bg.jpg') no-repeat center center/cover;
  color: #fff;
  text-align: center;
  padding: 100px 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--hero-overlay);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  animation: fadeIn 1.5s ease-out;
}

.hero-content h2 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  animation: slideInLeft 1s ease-out;
}

.hero-content p {
  font-size: 1.5rem;
  margin-bottom: 40px;
  opacity: 0.9;
  animation: slideInRight 1s ease-out 0.3s;
}

.hero-content .btn {
  animation: fadeIn 1s ease-out 0.6s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* General Section Styling */
.section-padding {
  padding: 60px 0;
}

.section-full-height {
  min-height: calc(100vh - 80px); /* Adjust based on header height */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.light-bg {
  background-color: var(--background-color);
}

.section-title {
  font-size: 2.5rem;
  color: var(--heading-color);
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 10px;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* About Section on Homepage */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}
.about-content p {
  margin-bottom: 20px;
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Features Section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  text-align: center;
}

.feature-item {
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.feature-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature-item .icon-large {
  font-size: 3.5rem;
  color: var(--secondary-color);
  margin-bottom: 20px;
}

.feature-item h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.8rem;
}

.feature-item p {
  font-size: 1rem;
  margin-bottom: 20px;
  flex-grow: 1; /* Make paragraphs take up available space */
}

/* Dynamic Content Placeholder */
#dynamic-content-placeholder {
  display: none; /* Hidden by default, shown by JS */
}

#dynamic-section-body {
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* Forms */
.form-container {
  max-width: 500px;
  margin: 0 auto;
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--heading-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background-color: var(--background-color);
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--secondary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.form-group button[type="submit"] {
  width: 100%;
}

.error-message {
  color: var(--error-color);
  font-size: 0.9rem;
  margin-top: 5px;
  display: block;
}

.success-message {
  color: var(--success-color);
  font-size: 0.9rem;
  margin-top: 5px;
  display: block;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.data-table th {
  background-color: var(--primary-color);
  color: #fff;
  font-weight: 600;
}

.data-table tbody tr:nth-child(even) {
  background-color: var(--background-color);
}

.data-table tbody tr:hover {
  background-color: var(--border-color);
}

/* Dashboard Styles */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.dashboard-card {
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.dashboard-card i {
  font-size: 3rem;
  color: var(--secondary-color);
  margin-bottom: 15px;
}

.dashboard-card h3 {
  font-size: 1.5rem;
  color: var(--heading-color);
  margin-bottom: 10px;
}

.dashboard-card p {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--primary-color);
}

/* Student Profile */
.profile-info {
  text-align: center;
  margin-bottom: 30px;
}

.profile-info h3 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.profile-info p {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

/* Result Checking Specifics */
.result-select-form {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.result-select-form select {
  flex-grow: 1;
  max-width: 200px;
}

.result-summary-card {
  background-color: var(--primary-color);
  color: #fff;
  padding: 25px;
  border-radius: 10px;
  text-align: center;
  margin-top: 30px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.result-summary-card h4 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.result-summary-card p {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

/* Footer */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 40px 0 20px;
  font-size: 0.95rem;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h3 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  color: var(--footer-text);
  transition: color 0.3s ease;
}

.footer-col ul li a:hover {
  color: var(--secondary-color);
}

.footer-col.contact-footer p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.footer-col.contact-footer p i {
  color: var(--secondary-color);
}

.footer-bottom {
  text-align: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 10px;
}

.social-media-footer {
  display: flex;
  gap: 15px;
}

.social-media-footer a {
  color: var(--footer-text);
  font-size: 1.3rem;
  transition: color 0.3s ease, transform 0.2s ease;
}

.social-media-footer a:hover {
  color: var(--secondary-color);
  transform: translateY(-3px);
}

/* Admin Specifics */
.admin-sidebar {
  width: 250px;
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  margin-right: 30px;
  flex-shrink: 0;
}

.admin-sidebar ul li a {
  display: block;
  padding: 10px 15px;
  margin-bottom: 5px;
  border-radius: 5px;
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.admin-sidebar ul li a:hover,
.admin-sidebar ul li a.active-admin-link {
  background-color: var(--secondary-color);
  color: #fff;
}

.admin-content-area {
  flex-grow: 1;
}

.admin-panel-layout {
  display: flex;
  align-items: flex-start;
  padding: 30px 0;
}

/* Responsive Design */
@media (max-width: 992px) {
  .main-nav .nav-links {
      gap: 15px;
  }
  .hero-content h2 {
      font-size: 2.8rem;
  }
  .hero-content p {
      font-size: 1.2rem;
  }
  .section-title {
      font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  header .container {
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 10px;
  }
  .logo {
      flex-grow: 1; /* Allow logo to take more space */
      justify-content: flex-start;
  }
  .main-nav {
      order: 3; /* Move nav below logo and toggle */
      width: 100%;
      margin-top: 15px;
  }
  .main-nav .nav-links {
      flex-direction: column;
      align-items: center;
      width: 100%;
      display: none; /* Hidden by default for mobile */
      background-color: var(--card-bg);
      padding: 20px 0;
      box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
      border-top: 1px solid var(--border-color);
      position: absolute;
      left: 0;
      top: 80px; /* Below header */
  }
  .main-nav .nav-links.active {
      display: flex; /* Show when active */
  }
  .main-nav .nav-links li {
      margin: 10px 0;
  }
  .hamburger {
      display: block; /* Show hamburger */
      order: 2;
  }
  .theme-toggle {
      order: 1;
      margin-right: 0;
      margin-left: auto; /* Push to right of logo */
  }

  .hero-section {
      padding: 80px 15px;
      min-height: 50vh;
  }
  .hero-content h2 {
      font-size: 2.2rem;
  }
  .hero-content p {
      font-size: 1rem;
  }

  .section-padding {
      padding: 40px 0;
  }
  .section-title {
      font-size: 1.8rem;
      margin-bottom: 30px;
  }

  .features-grid {
      grid-template-columns: 1fr;
  }

  .footer-columns {
      grid-template-columns: 1fr;
  }
  .footer-bottom {
      flex-direction: column;
      gap: 15px;
  }
  .social-media-footer {
      margin-top: 10px;
  }

  .admin-panel-layout {
      flex-direction: column;
  }
  .admin-sidebar {
      width: 100%;
      margin-right: 0;
      margin-bottom: 30px;
  }
}

@media (max-width: 480px) {
  .logo h1 {
      font-size: 1.5rem;
  }
  .hero-content h2 {
      font-size: 1.8rem;
  }
  .hero-content p {
      font-size: 0.9rem;
  }
  .btn {
      padding: 8px 15px;
      font-size: 0.9rem;
  }
  .section-title {
      font-size: 1.5rem;
  }
  .dashboard-card h3 {
      font-size: 1.3rem;
  }
  .dashboard-card p {
      font-size: 1rem;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}