@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

/* Default Theme (Dark) */
:root, body.theme-dark {
  --primary: #007f66; /* Viridian Green */
  --primary-hover: #005f4c;
  --primary-glow: rgba(0, 127, 102, 0.15);
  --secondary: #6b8e23; /* Olive Green / Pharmacy */
  --secondary-glow: rgba(107, 142, 35, 0.15);
  --accent: #d97706; /* Amber / Warning */
  --accent-purple: #8b5cf6; /* Exam Purple */
  --accent-blue: #0ea5e9; /* Make-up blue */
  --danger: #ef4444; /* Overdue / Delete */
  --success: #22c55e; /* Completed */
  
  --bg-dark: #070a13;
  --bg-sidebar: #0b1120;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.75);
  --bg-input: rgba(15, 23, 42, 0.8);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(0, 127, 102, 0.3);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-sans: 'Outfit', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 12px;

  /* Theme-specific day colors & subtle item variables */
  --day-mon: #facc15;
  --day-tue: #f472b6;
  --day-wed: #34d399;
  --day-thu: #fb923c;
  --day-fri: #60a5fa;
  --bg-item-subtle: rgba(255, 255, 255, 0.03);
  --bg-item-subtle-hover: rgba(255, 255, 255, 0.06);
  --bg-item-success: rgba(34, 197, 94, 0.05);
  --bg-todo-col: rgba(11, 17, 32, 0.5);
  --blue-glow: rgba(14, 165, 233, 0.15);
  --amber-glow: rgba(217, 119, 6, 0.15);
  --purple-glow: rgba(139, 92, 246, 0.15);
}

/* Light Theme */
body.theme-light {
  --primary: #007f66;
  --primary-hover: #005f4c;
  --primary-glow: rgba(0, 127, 102, 0.1);
  --secondary: #6b8e23;
  --secondary-glow: rgba(107, 142, 35, 0.1);
  --accent: #b45309;
  --accent-purple: #6d28d9;
  --accent-blue: #0369a1;
  --danger: #dc2626;
  --success: #16a34a;
  
  --bg-dark: #f1f5f9; /* Slate 100 */
  --bg-sidebar: #ffffff; /* White sidebar */
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-input: rgba(248, 250, 252, 0.9);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(0, 127, 102, 0.3);
  
  --text-main: #0f172a; /* Slate 900 */
  --text-muted: #475569; /* Slate 600 */
  --text-dim: #64748b;
  --shadow-lg: 0 10px 30px -10px rgba(15, 23, 42, 0.05);

  /* Theme-specific day colors & subtle item variables */
  --day-mon: #b45309;
  --day-tue: #be185d;
  --day-wed: #047857;
  --day-thu: #c2410c;
  --day-fri: #1d4ed8;
  --bg-item-subtle: rgba(0, 0, 0, 0.02);
  --bg-item-subtle-hover: rgba(0, 0, 0, 0.04);
  --bg-item-success: rgba(22, 163, 74, 0.08);
  --bg-todo-col: rgba(0, 0, 0, 0.02);
  --blue-glow: rgba(3, 105, 161, 0.12);
  --amber-glow: rgba(180, 83, 9, 0.12);
  --purple-glow: rgba(109, 40, 217, 0.12);
}

/* Rx Tone (Olive, Viridian, Cream, White) */
body.theme-rxtone {
  --primary: #007f66; /* Viridian */
  --primary-hover: #005f4c;
  --primary-glow: rgba(0, 127, 102, 0.1);
  --secondary: #6b8e23; /* Olive */
  --secondary-glow: rgba(107, 142, 35, 0.1);
  --accent: #92400e;
  --accent-purple: #5b21b6;
  --accent-blue: #075985;
  --danger: #991b1b;
  --success: #166534;
  
  --bg-dark: #fdfbf7; /* Cream background */
  --bg-sidebar: #ffffff; /* White sidebar */
  --bg-card: rgba(255, 255, 255, 0.85); /* White card */
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-input: rgba(253, 251, 247, 0.9);
  --border-color: rgba(107, 142, 35, 0.15); /* Olive border tint */
  --border-color-hover: rgba(0, 127, 102, 0.45);
  
  --text-main: #2f3e23; /* Very deep olive/slate */
  --text-muted: #556b2f; /* Olive green text */
  --text-dim: #7f8c6d;
  --shadow-lg: 0 10px 30px -10px rgba(47, 62, 35, 0.04);

  /* Theme-specific day colors & subtle item variables */
  --day-mon: #854d0e;
  --day-tue: #9d174d;
  --day-wed: #065f46;
  --day-thu: #9a3412;
  --day-fri: #1e3a8a;
  --bg-item-subtle: rgba(107, 142, 35, 0.05);
  --bg-item-subtle-hover: rgba(107, 142, 35, 0.1);
  --bg-item-success: rgba(22, 163, 74, 0.08);
  --bg-todo-col: rgba(107, 142, 35, 0.04);
  --blue-glow: rgba(7, 89, 133, 0.12);
  --amber-glow: rgba(146, 64, 14, 0.12);
  --purple-glow: rgba(91, 33, 182, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body.theme-dark {
  background-image: 
    radial-gradient(at 10% 10%, rgba(0, 127, 102, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(107, 142, 35, 0.06) 0px, transparent 50%);
}

body.theme-light {
  background-image: 
    radial-gradient(at 10% 10%, rgba(0, 127, 102, 0.03) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(107, 142, 35, 0.02) 0px, transparent 50%);
}

body.theme-rxtone {
  background-image: 
    radial-gradient(at 10% 10%, rgba(0, 127, 102, 0.05) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(107, 142, 35, 0.04) 0px, transparent 50%);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.03); opacity: 1; }
}

/* Auth Screens */
#auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.logo-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.2rem;
  color: white;
  margin-bottom: 15px;
  box-shadow: 0 0 20px var(--primary-glow);
}

.logo-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, var(--text-main), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
}

.input-wrapper i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1.1rem;
}

.login-form input, .modal input, .modal select, .modal textarea {
  width: 100%;
  padding: 14px 16px;
  padding-left: 45px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.login-form input:focus, .modal input:focus, .modal select:focus, .modal textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 166, 153, 0.2);
}

.login-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 166, 153, 0.4);
}

.login-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 20px;
  line-height: 1.4;
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: -10px;
  display: none;
}

/* App Shell Layout */
#app-container {
  display: none; /* hidden until logged in */
  min-height: 100vh;
}

.app-wrapper {
  display: flex;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  height: 100vh;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 25px;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 25px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.3rem;
  color: white;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.brand-dept {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 18px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-item.active a, .nav-item a:hover {
  background: rgba(0, 166, 153, 0.1);
  color: var(--primary);
}

.nav-item.active a {
  border-left: 4px solid var(--primary);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  font-weight: 600;
}

.user-profile {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  font-size: 1rem;
  color: white;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-role {
  font-size: 0.9rem;
  font-weight: 600;
}

.profile-id {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
}

.logout-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-content {
  margin-left: 280px;
  flex-grow: 1;
  padding: 40px;
  min-height: 100vh;
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}

.header-title h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 5px;
}

.header-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* Section Controls & Filters */
.filters-bar {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-select {
  padding: 10px 15px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-input-wrapper i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.search-input-wrapper input {
  padding-left: 42px !important;
}

/* Content Sections (Page view tabs) */
.content-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.content-section.active {
  display: block;
}

/* Dashboard Styles */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1-fraction);
  gap: 25px;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-4 { grid-column: span 4; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  color: white;
}

.stat-icon.blue { background: var(--blue-glow); color: var(--accent-blue); }
.stat-icon.teal { background: var(--primary-glow); color: var(--primary); }
.stat-icon.amber { background: var(--amber-glow); color: var(--accent); }
.stat-icon.purple { background: var(--purple-glow); color: var(--accent-purple); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Cards default styling */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.panel-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--primary);
  padding-left: 10px;
}

/* Lists styling inside panels */
.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.dashboard-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: var(--bg-item-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: var(--transition);
}

.dashboard-list-item:hover {
  background: var(--bg-item-subtle-hover);
  transform: translateX(3px);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.item-time-badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(0, 166, 153, 0.1);
  color: var(--primary);
  text-align: center;
  min-width: 90px;
}

.item-content {
  display: flex;
  flex-direction: column;
}

.item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.item-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-high { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-medium { background: rgba(217, 119, 6, 0.15); color: var(--accent); }
.badge-low { background: rgba(14, 165, 233, 0.15); color: var(--accent-blue); }
.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }

/* Schedule Component Styling */
.schedule-grid-wrap {
  overflow-x: auto;
  margin-top: 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
  text-align: left;
}

.schedule-table th {
  background: var(--bg-sidebar);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.schedule-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.day-cell {
  font-weight: 700;
  font-size: 1rem;
  width: 120px;
}

.day-monday { color: var(--day-mon); }
.day-tuesday { color: var(--day-tue); }
.day-wednesday { color: var(--day-wed); }
.day-thursday { color: var(--day-thu); }
.day-friday { color: var(--day-fri); }

.slot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-slot {
  background: var(--bg-item-subtle);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 12px 16px;
  transition: var(--transition);
  position: relative;
}

.schedule-slot:hover {
  background: var(--bg-item-subtle-hover);
  transform: translateY(-2px);
}

.schedule-slot.lab {
  border-left-color: var(--secondary);
}

.slot-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.slot-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 4px 0;
}

.slot-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  gap: 12px;
}

.slot-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.slot-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  opacity: 0;
  transition: var(--transition);
}

.schedule-slot:hover .slot-actions {
  opacity: 1;
}

/* Course Explorer Grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
}

.course-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-lg);
}

.course-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.course-code {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  padding: 3px 8px;
  background: var(--primary-glow);
  border-radius: 6px;
  border: 1px solid rgba(0, 166, 153, 0.2);
}

.course-credits {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.course-name {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

.course-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.course-grading {
  background: var(--bg-item-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
}

.grading-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.grading-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grading-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grading-row-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.grading-progress-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.grading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
}

.course-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

/* Homework To-Do Board */
.todo-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  align-items: start;
}

@media (max-width: 992px) {
  .todo-board {
    grid-template-columns: 1fr;
  }
}

.todo-column {
  background: var(--bg-todo-col);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.column-title {
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.column-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

#todo-col .column-title::before { background: var(--danger); }
#progress-col .column-title::before { background: var(--accent); }
#done-col .column-title::before { background: var(--success); }

.column-count {
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 200px;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  cursor: grab;
  position: relative;
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-lg);
}

.task-priority-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.task-subject {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

.task-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.task-notes {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.task-deadline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
}

.countdown-wrap {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.task-countdown-container {
  padding: 6px 10px;
  background: var(--bg-item-subtle);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-top: 8px;
}

.task-countdown-container.completed {
  color: var(--success);
  background: var(--bg-item-success);
  border-color: rgba(22, 163, 74, 0.15);
}

.task-divider-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.countdown-active {
  color: var(--accent);
}

.countdown-urgent {
  color: var(--danger);
  animation: pulse 1.5s infinite;
}

.countdown-overdue {
  color: var(--text-dim);
  text-decoration: line-through;
}

.task-actions {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: var(--transition);
}

.task-card:hover .task-actions {
  opacity: 1;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.icon-btn.danger-hover:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Exam & Make-up Cards Grid */
.exam-grid, .makeup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  gap: 15px;
  transition: var(--transition);
  position: relative;
}

.event-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
}

.event-date-badge {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-purple);
  width: 65px;
  height: 75px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.event-date-badge.blue {
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent-blue);
  border-color: rgba(14, 165, 233, 0.15);
}

.date-day {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.date-month {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 3px;
}

.event-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
}

.event-subject-code {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.event-name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

.event-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.event-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-actions {
  position: absolute;
  right: 15px;
  bottom: 15px;
  opacity: 0;
  transition: var(--transition);
}

.event-card:hover .event-actions {
  opacity: 1;
}

/* Lecturer Directory Card */
.lecturer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 25px;
}

.lecturer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 25px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition);
  position: relative;
}

.lecturer-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-lg);
}

.lec-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  color: white;
  font-weight: 700;
  margin-bottom: 15px;
  box-shadow: 0 5px 15px rgba(0, 166, 153, 0.2);
}

.lec-name {
  font-weight: 700;
  font-size: 1rem;
}

.lec-dept {
  font-size: 0.8rem;
  color: var(--primary);
  margin: 6px 0 15px 0;
  font-weight: 500;
}

.lec-contact {
  width: 100%;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: left;
}

.lec-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lec-contact-item i {
  color: var(--text-dim);
  width: 15px;
}

.lec-actions {
  position: absolute;
  right: 15px;
  bottom: 15px;
  opacity: 0;
  transition: var(--transition);
}

.lecturer-card:hover .lec-actions {
  opacity: 1;
}

/* Modals Overlay & Content */
.modal {
  display: none; /* hidden by default */
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 10, 19, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color-hover);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.close-modal:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--border-color-hover);
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.modal-body form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-body .form-group input, 
.modal-body .form-group select, 
.modal-body .form-group textarea {
  padding-left: 15px; /* no icon inside inputs in modal */
}

.modal-body textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-footer {
  padding: 15px 25px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* Responsiveness adjustments & Buttons */
.mobile-menu-toggle-btn {
  display: none;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.2rem;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-right: 5px;
}

.mobile-menu-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
}

.mobile-sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--transition);
  padding: 4px;
  align-items: center;
  justify-content: center;
}

.mobile-sidebar-close-btn:hover {
  color: var(--danger);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 240px;
    padding: 20px 15px;
  }
  .main-content {
    margin-left: 240px;
    padding: 25px;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle-btn {
    display: inline-flex;
  }
  
  .mobile-sidebar-close-btn {
    display: inline-flex;
  }

  .sidebar {
    width: 280px;
    height: 100vh;
    left: -280px; /* Hide to the left */
    position: fixed;
    top: 0;
    z-index: 100;
    padding: 25px;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.25);
    transition: var(--transition);
  }

  .sidebar.active {
    left: 0; /* Slide in */
  }

  .brand-info, .nav-item span, .profile-info, .logout-btn {
    display: flex !important; /* Keep them visible inside the sliding menu */
  }

  .sidebar-brand {
    justify-content: space-between;
    padding-bottom: 25px;
    margin-bottom: 25px;
  }

  .nav-item a {
    justify-content: flex-start;
    padding: 12px 18px;
  }

  .user-profile {
    justify-content: space-between;
    margin-top: auto;
    padding-top: 20px;
  }

  .main-content {
    margin-left: 0; /* No margin since sidebar is overlay */
    padding: 20px;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }
  
  .top-header {
    margin-bottom: 25px;
  }
  
  .header-title h1 {
    font-size: 1.5rem;
  }
  
  .header-title p {
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 30px 20px;
  }
  
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ==================== 5. PASSWORD EYE TOGGLE & THEME DROPDOWN ==================== */
.show-password-below {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.show-password-below span {
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
  user-select: none;
  font-weight: 500;
}

.show-password-below span:hover {
  color: var(--primary);
}

.theme-switcher-wrapper {
  position: relative;
  display: inline-block;
}

.theme-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 120%;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color-hover);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 190px;
  z-index: 600;
  animation: fadeIn 0.2s ease-out;
}

.theme-dropdown.active {
  display: block;
}

.theme-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.theme-option:hover {
  background: var(--primary-glow);
  color: var(--primary);
}

.theme-option.active {
  background: var(--primary);
  color: white !important;
}

.theme-option.active .theme-dot {
  border-color: white;
}

.theme-previews {
  display: flex;
  gap: 4px;
}

.theme-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}


input::placeholder, select::placeholder, textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.8;
}

/* ==================== 6. PASSCODE INPUT READABILITY ENHANCEMENTS ==================== */
/* Modals Styling Enhancements for High Readability */
.modal-content {
  border: 1px solid var(--border-color-hover);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

body.theme-light .modal-content,
body.theme-rxtone .modal-content {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.modal label {
  color: var(--text-main) !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  margin-bottom: 2px;
}

.modal input, .modal select, .modal textarea {
  font-size: 1.05rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease;
}

/* Theme Dark styles for all modal inputs */
body.theme-dark .modal input,
body.theme-dark .modal select,
body.theme-dark .modal textarea {
  background-color: #0f172a !important; /* Dark slate */
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
}
body.theme-dark .modal input:focus,
body.theme-dark .modal select:focus,
body.theme-dark .modal textarea:focus {
  border-color: var(--primary) !important;
  background-color: #1e293b !important;
  box-shadow: 0 0 0 3px rgba(0, 127, 102, 0.25) !important;
}

/* Theme Light styles for all modal inputs */
body.theme-light .modal input,
body.theme-light .modal select,
body.theme-light .modal textarea {
  background-color: #f1f5f9 !important; /* Light gray-blue */
  color: #0f172a !important;
  border: 1.5px solid rgba(0, 0, 0, 0.25) !important;
}
body.theme-light .modal input:focus,
body.theme-light .modal select:focus,
body.theme-light .modal textarea:focus {
  border-color: var(--primary) !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(0, 127, 102, 0.2) !important;
}

/* Theme RxTone styles for all modal inputs */
body.theme-rxtone .modal input,
body.theme-rxtone .modal select,
body.theme-rxtone .modal textarea {
  background-color: #f5efe6 !important; /* Rich cream-beige */
  color: #2f3e23 !important;
  border: 1.5px solid rgba(107, 142, 35, 0.45) !important;
}
body.theme-rxtone .modal input:focus,
body.theme-rxtone .modal select:focus,
body.theme-rxtone .modal textarea:focus {
  border-color: var(--primary) !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(0, 127, 102, 0.2) !important;
}

/* Placeholders for all modal inputs */
.modal input::placeholder,
.modal select::placeholder,
.modal textarea::placeholder {
  font-size: 0.9rem;
  letter-spacing: normal;
}
body.theme-dark .modal input::placeholder,
body.theme-dark .modal select::placeholder,
body.theme-dark .modal textarea::placeholder {
  color: #64748b !important;
  opacity: 0.95 !important;
}
body.theme-light .modal input::placeholder,
body.theme-light .modal select::placeholder,
body.theme-light .modal textarea::placeholder {
  color: #475569 !important;
  opacity: 0.95 !important;
}
body.theme-rxtone .modal input::placeholder,
body.theme-rxtone .modal select::placeholder,
body.theme-rxtone .modal textarea::placeholder {
  color: #556b2f !important;
  opacity: 0.95 !important;
}

/* Improve eye toggles color & spacing */
.modal .show-password-below span {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.modal .show-password-below span:hover {
  color: var(--primary);
}

/* Improve input wrapper icons */
.modal .input-wrapper i {
  color: var(--text-dim);
  font-size: 1.1rem;
}
body.theme-light .modal .input-wrapper i {
  color: #475569 !important;
}
body.theme-rxtone .modal .input-wrapper i {
  color: #556b2f !important;
}

/* Login Page Passcode Styling Enhancements for High Readability */
body.theme-dark .login-form input {
  background-color: #0f172a !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
}
body.theme-dark .login-form input:focus {
  border-color: var(--primary) !important;
  background-color: #1e293b !important;
  box-shadow: 0 0 0 3px rgba(0, 127, 102, 0.25) !important;
}

body.theme-light .login-form input {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1.5px solid rgba(0, 0, 0, 0.25) !important;
}
body.theme-light .login-form input:focus {
  border-color: var(--primary) !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(0, 127, 102, 0.2) !important;
}

body.theme-rxtone .login-form input {
  background-color: #f5efe6 !important;
  color: #2f3e23 !important;
  border: 1.5px solid rgba(107, 142, 35, 0.45) !important;
}
body.theme-rxtone .login-form input:focus {
  border-color: var(--primary) !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(0, 127, 102, 0.2) !important;
}

/* Placeholders for login input */
body.theme-dark .login-form input::placeholder {
  color: #64748b !important;
  opacity: 0.95 !important;
}
body.theme-light .login-form input::placeholder {
  color: #475569 !important;
  opacity: 0.95 !important;
}
body.theme-rxtone .login-form input::placeholder {
  color: #556b2f !important;
  opacity: 0.95 !important;
}

/* Icon in login passcode input wrapper */
body.theme-light .login-form .input-wrapper i {
  color: #475569 !important;
}
body.theme-rxtone .login-form .input-wrapper i {
  color: #556b2f !important;
}

/* Secondary Button Contrast Enhancements in Light & Rx Tone Themes */
body.theme-light .btn-secondary {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #0f172a !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
}
body.theme-light .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.1) !important;
}

body.theme-rxtone .btn-secondary {
  background: rgba(107, 142, 35, 0.08) !important;
  color: #2f3e23 !important;
  border: 1px solid rgba(107, 142, 35, 0.25) !important;
}
body.theme-rxtone .btn-secondary:hover {
  background: rgba(107, 142, 35, 0.15) !important;
}


