/* --- HEADING STYLES (Explicit Definition) --- */
/* Fixes Lighthouse warning: H1UserAgentFontSizeInSection */
/* Remove reliance on browser default heading styles */

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: clamp(1.2, 6vw, 1.3);
  margin: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(1rem, 2vw, 1.5rem) 0;
  font-weight: 700;
  color: var(--text-primary, #414a37);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.25;
  margin: clamp(1.25rem, 3vw, 2rem) 0 clamp(0.75rem, 1.5vw, 1.25rem) 0;
  font-weight: 700;
  color: var(--text-primary, #414a37);
}

h3 {
  font-size: clamp(1.375rem, 3vw, 2rem);
  line-height: 1.35;
  margin: clamp(1rem, 2vw, 1.5rem) 0 clamp(0.5rem, 1vw, 1rem) 0;
  font-weight: 700;
  color: var(--text-primary, #414a37);
}

/* Ensure headings in semantic containers don't rely on user-agent defaults */
section h1,
section h2,
section h3,
article h1,
article h2,
article h3,
main h1,
main h2,
main h3 {
  font-size: inherit;
  line-height: inherit;
  margin: inherit;
  font-weight: 700;
  color: var(--text-primary, #414a37);
}

/* --- ROLE-BASED VISIBILITY & LOGIN STYLES --- */

#credentials-container {
  color: black;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
}

#credentials-container.show {
  color: black;
  max-height: 300px;
  /* Adjust as needed */
  transition: max-height 0.5s ease-in;
}

/* Default visibility: hide role-specific elements */
.admin-only,
.viewer-only,
.teacher-only,
.teacher-hod-only,
.student-only {
  /* ADDED teacher-only */
  display: none !important;
}

.viewer-view-header {
  display: none;
}

.admin-view-header {
  display: block;
}

/* TRUE ADMIN ONLY VISIBILITY */
/* By default, hide elements meant only for the true admin */
.true-admin-only {
  display: none !important;
}

/* For an admin, display the navigation TAB for the admin-only section */
body[data-role="admin"] .nav-tab.true-admin-only {
  display: inline-block !important;
}

/* For an admin, only display the CONTENT of the admin-only section when it's the ACTIVE tab.
   This overrides the default 'display: none !important' and works with the tab switching JS. */
body[data-role="admin"] .tab-content.true-admin-only.active {
  display: block !important;
}

/* HIDE FOR ADMIN ONLY VISIBILITY */
.admin-hidden {
  display: inline-block !important;
  /* Default display state for tab */
}

body[data-role="admin"] .admin-hidden {
  display: none !important;
}

/* FULL ACCESS VIEW (Admin, Principal, HOD) */
body[data-access="full"] .viewer-only {
  display: none !important;
}

body[data-access="full"] .admin-view-header {
  display: block;
}

body[data-access="full"] .viewer-view-header {
  display: none;
}

body[data-access="full"] .tab-content.admin-only.active {
  display: block !important;
}

body[data-access="full"] .nav-tab.admin-only {
  display: inline-block !important;
  /* This now correctly targets ONLY the nav tabs */
}

body[data-access="full"] .nav-tab.admin-only {
  display: inline-block !important;
  /* For flex items */
}

body[data-access="full"] .floating-action.admin-only {
  display: flex !important;
  /* For flex items */
  justify-content: center;
  align-items: center;
}

/* NEW: Show admin-only elements that are INSIDE an active tab for full-access users */
body[data-access="full"] .tab-content.active .admin-only {
  display: inline-block !important;
  /* Or 'block', 'flex', etc., as needed by the element */
}

/* Make class slots clickable for admins */
body[data-access="full"] .class-slot {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body[data-access="full"] .class-slot:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* VIEW-ONLY ACCESS (Teacher, Student) */
body[data-access="view-only"] .viewer-only {
  display: block !important;
}

body[data-access="view-only"] .admin-only {
  display: none !important;
}

body[data-access="view-only"] .viewer-view-header {
  display: block;
}

body[data-access="view-only"] .admin-view-header {
  display: none;
}

/* NEW: Show teacher-specific tabs only for teachers */
body[data-access="view-only"].teacher-role .teacher-only {
  display: inline-block !important;
}

/* NEW: Show only the navigation TAB for student role (keep student-only content hidden unless active) */
body[data-access="view-only"].student-role .nav-tab.student-only,
body[data-role="student"] .nav-tab.student-only {
  display: inline-block !important;
}

/* Ensure the tab CONTENT for student-only tabs is shown when the tab is active. */
body[data-access="view-only"].student-role .tab-content.student-only.active {
  display: block !important;
}

body[data-role="student"] .tab-content.student-only.active {
  display: block !important;
}

/* NEW: Show only the navigation TABs for teacher/HOD (keep other teacher-only elements hidden) */
body[data-access="view-only"].teacher-role .nav-tab.teacher-hod-only,
body[data-role="hod"] .nav-tab.teacher-hod-only {
  display: inline-block !important;
}

/* NEW: Ensure modals for teachers are also displayed correctly */
body[data-access="view-only"].teacher-role .modal.teacher-only {
  display: none;
  /* Keep it hidden by default */
}

/* Ensure the tab CONTENT for teacher/HOD-only tabs is shown when the tab is active. */
body[data-access="view-only"].teacher-role .tab-content.teacher-hod-only.active {
  display: block !important;
}

body[data-role="hod"] .tab-content.teacher-hod-only.active {
  display: block !important;
}

.publish-container {
  text-align: center;
  justify-content: center;
  margin: 0% 30% !important;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  border-top: 2px solid var(--glass-border);
}

@media (max-width: 768px) {
  .publish-container {
    justify-content: flex-start;
    align-items: flex-start;
    margin-left: 0;
  }
}

.publish-container p {
  margin-top: 10px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.header-role-badge {
  position: absolute;
  top: 40px;
  right: 30px;
  display: inline-block;
  background: var(--warning-gradient);
  font-size: 1rem;
  color: black !important;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .header-role-badge {
    position: static;
    display: block;
    width: fit-content;
    margin: 15px auto 0;
  }
}

#login-container {
  display: flex;
  justify-content: center;
  padding: 5% 2% !important;
  align-items: center;
  height: 100vh;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}

#loginBox {
  width: 400px;
  max-width: 400px;
  min-width: 400px;
  padding: 40px;
  color: black;
  text-align: center;
  box-sizing: border-box;
}

#mainContainer {
  /* Hide main app by default */
  display: none;
  flex-direction: column;
  align-items: center;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success-gradient: linear-gradient(135deg, #4625c9 0%, #4625c9 100%);
  --warning-gradient: linear-gradient(135deg, #fbfbfb 0%, #ffffff 100%);
  --danger-gradient: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
  --dark-gradient: linear-gradient(135deg, #0d788d 0%, #0d788d 100%);
  --table-gradient: linear-gradient(135deg, #247dd5 0%, #5c91c5 100%);
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #6d58cb;
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
  color: white;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.5) rgba(0, 0, 0, 0.2);
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.glass {
  overflow: hidden;
  padding: 0% 2%;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px;
  position: relative;
}

.header h1 {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(45deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
}

.header .tagline {
  font-size: 1.3rem;
  opacity: 0.9;
  font-weight: 300;
}

.ai-badge {
  display: inline-block;
  background: var(--success-gradient);
  padding: 8px 20px;
  justify-content: center;
  width: fit-content;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 15px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.nav-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-tab {
  padding: 12px 30px;
  background: #5944c3;
  border: 1px solid var(--glass-border);
  border-radius: 25px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  backdrop-filter: blur(10px);
  position: relative;
  /* For badge positioning */
}

.nav-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.nav-tab.active {
  background: #ffffff;
  color: black;
  font-weight: 700;
  transform: translateY(-10%);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.metric-card {
  padding: 25px 2px;
  margin: 0px !important;

  color: black;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent);
  transition: left 0.5s;
}

.metric-card:hover::before {
  left: 100%;
}

.input-section .glass {
  max-height: 70vh;
  overflow-y: auto;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 800;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.metric-label {
  font-size: 1rem;
  opacity: 0.8;
}

.input-section {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.input-group {
  position: relative;
}

.input-field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 15px;
  border: none;
  border-radius: 10px;
  background: var(--glass-bg);
  color: white;
  font-size: 1rem;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.input-field:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.input-field::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

select.input-field {
  background: var(--glass-bg);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' viewBox='0 0 12 8'%3e%3cpath stroke='%23FFFFFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 1 5 6 5-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.75em auto;
  padding-right: 2.5rem;
}

select.input-field option {
  background: #2c2163;
  color: white;
}

.password-container {
  position: relative;
}

.password-toggle-icon {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  cursor: pointer;
  color: #ddd;
  z-index: 2;
}

.btn {
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: var(--success-gradient);
  color: white;
}

.btn-success {
  background: var(--success-gradient);
  color: white;
}

.btn-warning {
  background: var(--success-gradient);
  color: white;
}

.btn-danger {
  background: var(--danger-gradient);
  color: white;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(-1px);
}

.ai-suggestions {
  padding: 20px;
  margin-top: 20px;
  border-left: 4px solid #04401b;
}

.suggestion-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(56, 239, 125, 0.1);
}

.suggestion-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  fill: #022d13;
}

.timetable-grid {
  overflow-x: auto;
  margin-top: 20px;
}

.timetable-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 2%;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0);
}

.timetable-table th,
.timetable-table td {
  padding: 3% 0.5%;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.timetable-table th {
  background: var(--dark-gradient);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timetable-table td {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  position: relative;
  height: 120px;
  width: 120px;
  min-width: 110px;
  max-width: 200px;
  vertical-align: middle;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.class-slot {
  background: var(--primary-gradient);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.9rem;
  line-height: 1.2;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  /* Ensures all text inside is centered */
}

.class-slot-merged {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.class-duration-badge {
  position: absolute;
  top: -35%;
  right: 1%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid var(--glass-border);
}

.class-duration-badge {
  top: -1.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
}

.class-subject {
  font-weight: 600;
  margin-bottom: 3px;
}

.class-details {
  font-size: 0.8rem;
  opacity: 0.9;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.ai-analysis {
  padding: 25px;
  margin-top: 20px;
  border-radius: 15px;
  background: linear-gradient(135deg,
      rgba(17, 153, 142, 0.2),
      rgba(56, 239, 125, 0.2));
  border: 1px solid rgba(56, 239, 125, 0.3);
}

.analysis-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.analysis-metric {
  text-align: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.optimization-controls {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  justify-content: center;
}

.floating-action {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--success-gradient);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  z-index: 100;
}

.floating-action:hover {
  transform: scale(1.1) rotate(15deg);
}

.item-list {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 15px;
  flex-shrink: 0;
}

.item-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.delete-btn {
  background: var(--warning-gradient);
  border: none;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  width: 2.2rem;
  height: 2.2rem;
}

.smart-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.feature-card {
  padding: 25px;
  text-align: center;
  border-radius: 15px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.progress-bar {
  width: 100%;
  height: 16px;
  /* Made the bar thicker */
  background: rgba(0, 0, 0, 0.25);
  /* Darker for better contrast */
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  transition: width 0.5s ease;
  /* NEW: Animated striped background */
  background-color: #4625c9;
  background-image: repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0.25) 25%,
      transparent 25%,
      transparent 50%,
      rgba(255, 255, 255, 0.25) 50%,
      rgba(255, 255, 255, 0.25) 75%,
      transparent 75%,
      transparent);
  background-size: 40px 40px;
  animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 40px 0;
  }
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 2.5rem;
  }

  .nav-tabs {
    flex-direction: column;
    align-items: center;
  }

  .dashboard-grid,
  .input-grid {
    grid-template-columns: 1fr;
  }

  .optimization-controls {
    justify-content: stretch;
  }
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background: var(--success-gradient);
}

.notification.warning {
  background: var(--success-gradient);
}

/* --- MODAL STYLES --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  margin: 15vh auto;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  animation: fadeInModal 0.5s ease;
}

.modal-content label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  text-align: left;
}

@keyframes fadeInModal {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-btn {
  color: #aaa;
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
  color: white;
  text-decoration: none;
}

.faculty-load-info {
  display: flex;
  justify-content: space-around;
  padding: 10px;
  margin: -5px 0 15px 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 0.9rem;
}

.load-metric {
  text-align: center;
}

.load-metric.healthy {
  color: #a7ffa7;
}

.load-metric.overtime {
  color: #ff9d9d;
}

.conflict-message {
  padding: 15px;
  margin-bottom: 15px;
  background: rgba(255, 107, 107, 0.2);
  border: 1px solid rgba(255, 107, 107, 0.5);
  border-left: 5px solid #ff6b6b;
  color: #ffd1d1;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --- NEW: Attendance Modal & Admin View Styles --- */
.attendance-student-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 10px 15px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.attendance-status-group {
  display: flex;
  gap: 10px;
}

.attendance-status-group label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 5px;
  transition: background-color 0.2s ease;
}

.attendance-status-group input[type="radio"] {
  display: none;
}

.attendance-status-group input[type="radio"]:checked+span {
  font-weight: bold;
}

.attendance-status-group label:has(input[value="Present"]:checked) {
  background-color: rgba(46, 204, 113, 0.3);
}

.attendance-status-group label:has(input[value="Absent"]:checked) {
  background-color: rgba(231, 76, 60, 0.3);
}

.attendance-status-group label:has(input[value="Late"]:checked) {
  background-color: rgba(241, 196, 15, 0.3);
}

.attendance-admin-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- NEW: Attendance Report Table & Chart Styles --- */
.attendance-report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.attendance-report-table th,
.attendance-report-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.attendance-report-table th {
  background-color: rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.attendance-report-table td {
  vertical-align: middle;
}

.attendance-bar-container {
  width: 100%;
  height: 20px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  overflow: hidden;
}

.attendance-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease-in-out;
  text-align: right;
  color: white;
  font-size: 0.8rem;
  line-height: 20px;
  padding-right: 5px;
}

.attendance-bar.good {
  background-color: #2ecc71;
  /* Green */
}

.attendance-bar.warning {
  background-color: #f1c40f;
  /* Yellow */
}

.attendance-bar.danger {
  background-color: #e74c3c;
  /* Red */
}

/* --- NEW: Student Attendance Summary Styles --- */
.attendance-summary-container {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 30px;
  align-items: center;
  background: rgba(0, 0, 0, 0.1);
  padding: 20px;
  border-radius: 15px;
}

.attendance-progress-ring {
  width: 150px;
  height: 150px;
  position: relative;
  margin: 0 auto;
}

.attendance-progress-ring circle {
  transition: stroke-dashoffset 0.5s ease;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.progress-ring-percentage {
  font-size: 2rem;
  font-weight: 700;
}

.progress-ring-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

.attendance-alert {
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 15px;
  background-color: rgba(231, 76, 60, 0.2);
  border-left: 5px solid #e74c3c;
}

.attendance-alert i {
  font-size: 1.5rem;
  color: #e74c3c;
}

@media (max-width: 768px) {
  .attendance-summary-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* --- CONTACT US STYLES --- */
.contact-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  align-items: flex-start;
}

/* NEW: Styles for contact form labels and spacing */
.contact-grid label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  text-align: left;
}

.contact-grid .input-group {
  margin-bottom: 15px;
}

.contact-grid .input-grid .input-group:last-child {
  margin-bottom: 0;
}

.contact-info-container h3 {
  margin-bottom: 15px;
  border-left: 4px solid var(--glass-border);
  padding-left: 10px;
}

.contact-info-list {
  list-style: none;
  padding: 0;
}

.contact-info-list li {
  margin-bottom: 15px;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 8px;
}

.contact-info-list a {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.contact-info-list a:hover {
  opacity: 0.8;
}

textarea.input-field {
  resize: vertical;
  min-height: 120px;
}

@media (max-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* --- DROPDOWN STYLES --- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: var(--dark-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: rgba(44, 33, 99, 0.7);
  min-width: 250px;
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.4);
  z-index: 100;
  border-radius: 10px;
  padding: 10px 0;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(15px);
  overflow: hidden;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-item,
.dropdown-item-header {
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  font-size: 0.95rem;
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.dropdown-item-header {
  font-weight: bold;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 5px;
  cursor: default;
}

.dropdown-item i {
  margin-right: 10px;
}

/* --- CUSTOM SCROLLBAR STYLES --- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* --- NEW: Substitution Request Styles --- */
.notification-badge {
  background-color: #ff4d4d;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.7rem;
  position: absolute;
  top: 5px;
  right: 5px;
  font-weight: bold;
}

.request-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  margin-bottom: 15px;
  border-left: 5px solid var(--dark-gradient);
}

.request-info p {
  margin: 0 0 5px;
  line-height: 1.4;
}

.request-actions {
  display: flex;
  gap: 10px;
}

.request-actions .btn {
  padding: 10px 20px;
  font-size: 0.9rem;
}

/* --- NEW: Reset Container in Activity Tab --- */
.reset-container {
  text-align: center;
  margin: 40px auto 20px auto;
  padding: 25px;
  background: rgba(229, 57, 53, 0.15);
  /* Reddish tint */
  border-radius: 15px;
  border-top: 2px solid rgba(229, 57, 53, 0.4);
  max-width: 600px;
}

.reset-container p {
  margin-top: 15px;
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.5;
}

/* Hide the slot actions container if it's empty */
.slot-actions:empty {
  display: none;
}

/* --- NEW: Attendance Report Container --- */
.attendance-report-container {
  text-align: center;
  margin: 40px auto 20px auto;
  padding: 25px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  border-top: 2px solid var(--glass-border);
  max-width: 600px;
}

/* Student attendence */
.studAttendence {}

/* --- NEW: Semester Selector Styles --- */
.semester-selector-container {
  max-width: 600px;
  margin: 0 auto 25px auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 4px solid var(--glass-border);
  border-right: 4px solid var(--glass-border);
}

.radio-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.radio-group label {
  font-size: 1.1rem;
  cursor: pointer;
  color: #000000;
}

.radio-group input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #000000;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease-in-out;
}

.radio-group input[type="radio"]:checked {
  background-color: #4625c9;
  border-color: #4625c9;
}

.radio-group input[type="radio"]:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background-color: white;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* --- NEW: Semester Selector Styles --- */
.semester-selector-container {
  max-width: 600px;
  margin: 0 auto 25px auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 4px solid var(--glass-border);
  border-right: 4px solid var(--glass-border);
}

.radio-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.radio-group label {
  font-size: 1.1rem;
  cursor: pointer;
  color: #000000;
}

.radio-group input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #000000;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease-in-out;
}

.radio-group input[type="radio"]:checked {
  background-color: #4625c9;
  border-color: #4625c9;
}

.radio-group input[type="radio"]:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background-color: white;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Add specific styles for time and date input fields to ensure visibility */
input[type="time"].input-field,
input[type="date"].input-field {
  color-scheme: dark;
  color: white;
}

.data-io-container {
  text-align: center;
  margin: 40px auto;
  padding: 25px;
  background: rgba(57, 150, 229, 0.4);
  border-radius: 15px;
  border-top: 2px solid rgba(57, 150, 229, 0.4);
  max-width: 600px;
}

.data-io-container p {
  margin-top: 10px;
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.5;
}

/* --- NEW: Overtime Report Styles --- */
.overtime-entry {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  align-items: center;
  gap: 15px;
}

.overtime-hours {
  font-weight: bold;
  color: #ff9d9d;
  /* A light red to indicate overtime */
  font-size: 1.1rem;
  text-align: center;
}