/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #ffffff;
  --text: #1f2937;
  --card-bg: #f9fafb;
  --border: #e5e7eb;
  --primary: #10b981; /* Team Ceylon green */
  --sidebar-bg: #f3f4f6;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  --success: #10b981;
}

[data-theme="dark"] {
  --bg: #111827;
  --text: #f9fafb;
  --card-bg: #1f2937;
  --border: #374151;
  --sidebar-bg: #1e293b;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
  --success: #34d399;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s, color 0.3s;
  line-height: 1.6;
}

/* === Sidebar (Desktop) === */
.sidebar {
  height: 100vh;
  width: 260px;
  position: fixed;
  background: var(--sidebar-bg);
  padding: 20px 15px;
  box-shadow: var(--shadow);
  z-index: 1000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.sidebar a, .sidebar button {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.sidebar a:hover, .sidebar a.active {
  background: var(--primary);
  color: white;
}

.sidebar a i {
  width: 24px;
  text-align: center;
  margin-right: 12px;
}

.theme-toggle {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 15px;
  border-radius: 8px;
  width: 100%;
  margin-top: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
}
/* Hide mobile header on desktop */
@media (min-width: 769px) {
  .mobile-header {
    display: none !important;
  }
}
/* === Mobile Header === */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
}

.mobile-header .hamburger {
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text);
  margin-top: -2px; /* ✅ Slightly raised */
}

.mobile-header .logo-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary);
}

/* === Main Content === */
.main-content {
  margin-left: 260px;
  padding: 25px;
}

/* === Buttons === */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: #059669;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  background: rgba(16, 185, 129, 0.05);
}

.btn-danger {
  background: #ef4444;
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}

/* === Cards === */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* === Timetable Grid === */
.timetable-grid {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.timetable-grid th,
.timetable-grid td {
  border: 1px solid var(--border);
  padding: 12px;
  text-align: center;
}

.timetable-grid th {
  font-weight: 600;
}

/* === Today Page === */
.today-header {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--primary);
}

.today-list {
  list-style: none;
}

.today-list li {
  background: var(--card-bg);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid var(--primary);
}

.today-list li.free {
  border-left-color: #6b7280;
  color: #9ca3af;
}

/* === Form === */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
}

/* === Quick Links === */
.quick-link {
  display: block;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.25s ease;
}

.quick-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
  border-color: var(--primary);
}

.quick-link:hover span {
  color: var(--primary);
  font-weight: 600;
}

/* === Footer === */
footer {
  margin-top: 40px;
  padding: 20px;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

/* === Popup Modal === */
body.popup-open {
  overflow: hidden;
  height: 100vh;
}
body.popup-open .main-content,
body.popup-open .sidebar,
body.popup-open footer {
  filter: blur(3px);
  pointer-events: none;
}

#zoomPopup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.75);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}
#zoomPopup .modal-content {
  background: var(--card-bg);
  padding: 22px;
  border-radius: 16px;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
#zoomPopup .modal-content h3 {
  margin: 14px 0 12px;
  color: var(--text);
  font-size: 1.25rem;
}
#zoomPopup .modal-content p {
  color: #6b7280;
  margin-bottom: 20px;
  line-height: 1.6;
  font-size: 0.95rem;
}
#zoomPopup img {
  width: 100%;
  max-width: 180px;
  margin: 0 auto 16px;
  border-radius: 8px;
}
#zoomPopup .btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}

/* === Mobile Adjustments === */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    top: 0;
    height: 100vh;
    width: 280px;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-logo {
    display: none;
  }

  .main-content {
    margin-left: 0;
    margin-top: 70px;
    padding: 20px 15px;
  }

  /* Scrollable tables */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 10px 0;
  }

  /* Action buttons under Previous Week */
  .mobile-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
  }
  .desktop-buttons {
    display: none;
  }
}

/* === Print Styles === */
@media print {
  .sidebar, .mobile-header, .hamburger, .btn, .theme-toggle, footer {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
  }
}
/* Dark Mode button in sidebar — hidden by default */
.theme-toggle-mobile {
  display: none;
}

/* Show only on mobile */
@media (max-width: 768px) {
  .theme-toggle-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    font-weight: 500;
    width: 100%;
    text-align: left;
  }

  .theme-toggle-mobile i {
    width: 24px;
    text-align: center;
  }

  .theme-toggle-mobile:hover {
    background: rgba(16, 185, 129, 0.1);
  }
}

/* Hide original desktop theme toggle */
@media (min-width: 769px) {
  .theme-toggle-mobile {
    display: none !important;
  }
}
/* Dark Mode button in mobile menu */
.mobile-theme-toggle {
  display: none; /* Hidden by default */
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  margin-top: 8px;
  cursor: pointer;
  font-weight: 500;
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
}

.mobile-theme-toggle i {
  width: 24px;
  text-align: center;
}

.mobile-theme-toggle:hover {
  background: rgba(16, 185, 129, 0.1);
}

/* ✅ Show ONLY on mobile */
@media (max-width: 768px) {
  .mobile-theme-toggle {
    display: flex;
  }
}

/* Ensure it's hidden on desktop */
@media (min-width: 769px) {
  .mobile-theme-toggle {
    display: none !important;
  }
}
/* === Dark Mode Button After "Rate Us" (Mobile Only) === */

/* Create a pseudo-button after the last menu item */
.sidebar a[href="rate.html"] {
  position: relative;
}

/* Insert dark mode button only on mobile */
@media (max-width: 768px) {
  .sidebar a[href="rate.html"]::after {
    content: "Dark Mode";
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px 12px 41px; /* extra left padding for icon */
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    margin-top: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    position: absolute;
    left: 0;
    right: 0;
    bottom: -52px; /* position below "Rate Us" */
    z-index: 10;
  }

  /* Add moon icon using ::before */
  .sidebar a[href="rate.html"]::before {
    content: "\f186"; /* Font Awesome moon icon (fas fa-moon) */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 15px;
    bottom: -38px;
    color: var(--text);
  }

  /* Hover effect */
  .sidebar a[href="rate.html"]:hover::after {
    background: rgba(16, 185, 129, 0.1);
  }
}

/* Hide on desktop */
@media (min-width: 769px) {
  .sidebar a[href="rate.html"]::after,
  .sidebar a[href="rate.html"]::before {
    display: none !important;
  }
}
@media (max-width: 768px) {
  /* Adjust based on your actual button class */
  .mobile-theme-toggle,
  .theme-toggle-mobile,
  .mobile-theme-btn {
    margin-top: 4px !important; /* Reduce top margin to move up */
    transform: translateY(-2px); /* Optional: fine-tune vertical position */
  }
}
@media (max-width: 768px) {
  /* Remove auto margin that pushes Dark Mode to bottom */
  .sidebar .theme-toggle {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    order: 0 !important; /* Ensure it stays in normal flow */
  }

  /* Optional: reduce spacing between "Rate Us" and Dark Mode */
  .sidebar a[href="rate.html"] {
    margin-bottom: 0 !important;
  }
}
/* Center titles on specific pages */
body:has(.timetable-page) h1,
body:has(.settings-page) h1,
body:has(.contact-page) h1 {
  text-align: center;
}

/* Fallback for older browsers (no :has support) */
.timetable-page h1,
.settings-page h1,
.contact-page h1 {
  text-align: center;
}
/* Center titles on specific pages */
body:has(.timetable-page) h1,
body:has(.settings-page) h1,
body:has(.contact-page) h1 {
  text-align: center;
}

/* Fallback for older browsers (no :has support) */
.timetable-page h1,
.settings-page h1,
.contact-page h1 {
  text-align: center;
}
/* Mobile: Full-width, stacked action buttons */
@media (max-width: 768px) {
  .action-buttons {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .action-buttons .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 1rem;
  }
}
.footer {
  margin-top: 40px;
  padding: 20px;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.footer-main, .footer-powered {
  white-space: nowrap;
}

.team-ceylon {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.team-ceylon:hover {
  text-decoration: underline;
}

/* ✅ Mobile: Stack into two rows */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 4px;
  }

  .footer-main, .footer-powered {
    white-space: normal;
    text-align: center;
  }
}
/* Previous Week Description */
.prev-week-desc {
  display: none;
  text-align: center;
  color: #6b7280;
  font-size: 0.85rem;
  margin-top: 12px;
  line-height: 1.5;
}

/* Mobile: Show description + style buttons */
@media (max-width: 768px) {
  .prev-week-desc {
    display: block;
  }

  /* Make buttons smaller and fit in one row */
  .prev-week-section .mobile-action-buttons {
    gap: 8px !important;
  }

  .prev-week-section .mobile-action-buttons .btn {
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
    min-height: auto !important;
  }

  /* Ensure icons scale down */
  .prev-week-section .mobile-action-buttons .btn i {
    font-size: 0.9rem !important;
  }
}