/* Base Variables (Soft Dark Theme) */
:root {
  --bg-dark: #0f1115;
  --bg-panel: #16181d;
  --bg-surface: #1e2029;
  --bg-hover: #292d39;

  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-inverse: #000000;

  --theme-color: #4285F4;
  --theme-color-rgb: 66, 133, 244;
  --electric-blue: var(--theme-color);
  --electric-blue-hover: color-mix(in srgb, var(--theme-color), black 15%);
  --accent-color: var(--theme-color);
  --gold-color: #fbbf24;

  --border-radius: 4px;
  --border-color: #2d313d;
  --transition: all 0.3s ease;

  --sidebar-width: 280px;

  /* Hero Section Specifics */
  --hero-bg: linear-gradient(135deg, rgba(var(--theme-color-rgb), 0.1), rgba(var(--theme-color-rgb), 0.05));
  --hero-glow: radial-gradient(circle at center, rgba(var(--theme-color-rgb), 0.1) 0%, transparent 60%);
}

/* Soft Light Theme Variables */
[data-theme="light"] {
  --bg-dark: #f1f3f6;
  --bg-panel: #ffffff;
  --bg-surface: #f8fafc;
  --bg-hover: #e2e8f0;
  --text-main: #1a202c;
  --text-muted: #64748b;
  --border-color: #cbd5e1;

  --hero-bg: linear-gradient(135deg, rgba(var(--theme-color-rgb), 0.05), rgba(var(--theme-color-rgb), 0.02));
  --hero-glow: radial-gradient(circle at center, rgba(var(--theme-color-rgb), 0.05) 0%, transparent 60%);
}

/* 100% Dark (High Contrast) */
[data-theme="dark-hc"] {
  --bg-dark: #000000;
  --bg-panel: #000000;
  --bg-surface: #0a0a0a;
  --text-main: #ffffff;
  --text-muted: #ffff00;
  --border-color: #333333;

  --hero-bg: #000000;
  --hero-glow: none;
}

/* 100% Light (High Contrast) */
[data-theme="light-hc"] {
  --bg-dark: #ffffff;
  --bg-panel: #ffffff;
  --bg-surface: #f9fafb;
  --text-main: #000000;
  --text-muted: #0000ff;
  --border-color: #000000;

  --hero-bg: #ffffff;
  --hero-glow: none;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  overflow-y: scroll;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
  border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--electric-blue);
}

/* Firefox Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-dark);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: visible;
  display: flex;
}

/* Typography & Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

.accent {
  color: var(--electric-blue);
}

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--electric-blue);
}

.text-blue {
  color: var(--accent-color);
}

.text-gold {
  color: var(--gold-color);
}

.mt-3 {
  margin-top: 1rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.hidden {
  display: none !important;
}

/* Buttons */
.btn-primary {
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  outline: none;
}

.btn-primary:hover {
  filter: brightness(0.9);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-outline {
  background-color: transparent;
  color: var(--electric-blue);
  border: 1px solid var(--electric-blue);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-outline:focus {
  outline: none;
}

.btn-outline:hover {
  background-color: rgba(var(--theme-color-rgb), 0.1);
}

.btn-outline.liked {
  background-color: rgba(var(--theme-color-rgb), 0.15);
  color: var(--theme-color);
  border-color: var(--theme-color);
  font-weight: 700;
}

.btn-outline.disliked {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: #ef4444;
  font-weight: 700;
}

[data-theme="light"] .btn-outline.liked {
  background-color: rgba(var(--theme-color-rgb), 0.1);
}

[data-theme="light"] .btn-outline.disliked {
  background-color: rgba(239, 68, 68, 0.08);
}

/* Header Quick Actions */
.btn-icon-nav {
  background: rgba(var(--theme-color-rgb), 0.1);
  border: 1px solid rgba(var(--theme-color-rgb), 0.2);
  color: var(--theme-color);
  padding: 0.4rem 0.85rem;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
}

.btn-icon-nav:hover {
  background: var(--theme-color);
  color: #000;
  border-color: var(--theme-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--theme-color-rgb), 0.3);
}

.btn-icon-nav i {
  font-size: 1.2rem;
}

@media (max-width: 600px) {
  .nav-btn-text {
    display: none;
  }

  .btn-icon-nav {
    padding: 0;
    width: 36px;
    height: 36px;
    justify-content: center;
    border-radius: 50%;
  }
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-panel);
  height: 100dvh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  z-index: 2000;
  /* Ensure it's above almost everything */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  backface-visibility: hidden;
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  letter-spacing: -0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}



.logo i {
  color: var(--electric-blue);
  text-shadow: 0 0 10px rgba(var(--theme-color-rgb), 0.5);
}

.logo span {
  background: linear-gradient(135deg, var(--text-main) 30%, var(--electric-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo .accent {
  -webkit-text-fill-color: var(--electric-blue);
  text-shadow: 0 0 15px rgba(var(--theme-color-rgb), 0.3);
}




.nav-links {
  padding: 1.5rem 0;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-links li a {
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-main);
  opacity: 0.7;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links li a:hover,
.nav-links li a.active {
  background-color: var(--bg-surface);
  color: var(--theme-color);
  opacity: 1;
  border-left: 4px solid var(--theme-color);
}

.nav-links li a i {
  font-size: 1.25rem;
}

/* Submenu */
.dropdown-icon {
  margin-left: auto;
  transition: transform 0.3s;
}

.submenu {
  display: none;
  background-color: var(--bg-dark);
  padding: 0.5rem 0;
}

.dropdown.expanded .submenu {
  display: block;
}

.dropdown.expanded>a .dropdown-icon {
  transform: rotate(180deg);
}

.submenu li a {
  padding: 0.5rem 1.5rem 0.5rem 3rem;
  font-size: 0.85rem;
  border-left: none !important;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.feedback-link {
  display: block;
  margin-top: 0.5rem;
  color: var(--accent-color);
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  /* More stable than calc() width */
  min-width: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top-header {
  height: 64px;
  background-color: var(--bg-panel);
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(200px, 500px) minmax(100px, 1fr);
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 900;
  gap: 1rem;
}

@media (max-width: 600px) {
  .top-header {
    grid-template-columns: 1fr auto auto;
    padding: 0 1rem;
    gap: 0.5rem;
  }
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
}

#page-title {
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-header {
  margin-bottom: 1.25rem;
  position: relative;
}

#sub-page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  display: block;
}

.header-line {
  width: 50px;
  height: 3px;
  background-color: var(--electric-blue);
  border-radius: 10px;
}

.mobile-menu-btn,
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.mobile-toggle:hover {
  color: var(--electric-blue);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: end;
}

.search-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: var(--transition);
}

@media (max-width: 600px) {
  .search-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* User Profile Dropdown */
.user-profile-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 15px);
  right: 0;
  width: 220px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  padding: 0.5rem 0;
  display: none;
  flex-direction: column;
  z-index: 1500;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 12px;
  width: 12px;
  height: 12px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  transform: rotate(45deg);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-dropdown-menu.active {
  display: flex;
}

.dropdown-header {
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
}

.user-full-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.dropdown-item {
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--theme-color);
}

.dropdown-item i {
  font-size: 1.2rem;
  opacity: 0.7;
}

.dropdown-item.logout {
  color: #ff4b4b;
}

.dropdown-item.logout:hover {
  background: rgba(255, 75, 75, 0.1);
}

/* Header Search Styles */
.header-center {
  width: 100%;
  justify-self: center;
  display: flex;
  justify-content: center;
}

.header-search-container {
  width: 100%;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper i.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

#global-search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-main);
  font-size: 0.9rem;
  -webkit-appearance: none;
  appearance: none;
}

/* Remove default search decorations */
#global-search-input::-webkit-search-decoration,
#global-search-input::-webkit-search-cancel-button,
#global-search-input::-webkit-search-results-button,
#global-search-input::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
}

#global-search-input:focus {
  outline: none;
  border-color: var(--electric-blue);
  background: var(--bg-hover);
  box-shadow: 0 0 0 4px rgba(var(--theme-color-rgb), 0.1);
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  max-height: 420px;
  overflow-y: auto;
  z-index: 2000;
  display: none;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-search-close {
  display: none;
}

.search-results-dropdown.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-icon {
  width: 36px;
  height: 36px;
  background: rgba(var(--theme-color-rgb), 0.1);
  color: var(--theme-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-subtitle {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-section-label {
  padding: 0.75rem 1.25rem 0.4rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--electric-blue);
  font-weight: 700;
  background: rgba(var(--theme-color-rgb), 0.03);
}

.search-empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.search-empty-state i {
  font-size: 3rem;
  color: var(--electric-blue);
  opacity: 0.4;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

.search-empty-state span {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
}

.search-empty-state p {
  font-size: 0.85rem;
  max-width: 200px;
  line-height: 1.4;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@media (max-width: 900px) {
  .header-center {
    margin: 0 0.5rem;
  }
}

@media (max-width: 600px) {
  .header-center {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 64px;
    max-width: none;
    margin: 0;
    /* Override inherited margin from 900px media query */
    background: var(--bg-panel);
    z-index: 2200;
    padding: 0 0.5rem;
    /* Balanced minimal padding */
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideDownMobile 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .header-center.active {
    display: flex;
  }

  .header-search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin: 0;
  }

  .search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
  }

  #global-search-input {
    height: 42px;
    /* Fixed height for consistency */
    padding: 0 0.75rem 0 2.5rem;
    font-size: 0.95rem;
  }

  .mobile-search-close {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: var(--transition);
  }

  @keyframes slideDownMobile {
    from {
      transform: translateY(-100%);
      opacity: 0;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .search-results-dropdown {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: none;
    border-radius: 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-dark);
    z-index: 2201;
  }
}

.semester-switch,
.semester-switch-profile {
  position: relative;
  display: flex;
  align-items: center;
}

.sem-display {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  transition: var(--transition);
}

#semester-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.semester-switch:hover .sem-display,
.semester-switch-profile:hover .sem-display {
  border-color: var(--electric-blue);
  background-color: var(--bg-hover);
}

input[type="text"],
input[type="search"],
input[type="password"],
input[type="email"] {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  outline: none;
  font-size: 0.9rem;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  border-color: var(--accent-color);
}

.content-container {
  padding: 2rem 3rem;
  flex-grow: 1;
  position: relative;
  z-index: 5;
}

/* Fix for gallery/memory images on desktop to show full 4:3 aspect ratio */
@media (min-width: 901px) {
  .gallery-item {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }

  .gallery-item img {
    max-height: 75vh !important;
    /* Allow up to 75% of screen height */
    object-fit: contain !important;
    /* Ensure full visibility */
    background: #000;
  }
}

.page-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-greeting {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--theme-color);
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: rgba(var(--theme-color-rgb), 0.1);
  border: 1px solid rgba(var(--theme-color-rgb), 0.15);
  border-radius: 30px;
  animation: fadeIn 0.6s ease;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--hero-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: var(--hero-glow);
  z-index: 0;
  animation: pulse 10s infinite alternate;
}

.hero h1,
.hero p,
.hero button {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -1.5px;
  background: linear-gradient(to right, #fff, var(--electric-blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

[data-theme="light"] .hero h1 {
  background: linear-gradient(to right, var(--text-main), var(--electric-blue));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero h1 .accent {
  -webkit-text-fill-color: var(--electric-blue);
  text-shadow: 0 0 20px rgba(var(--theme-color-rgb), 0.4);
}

[data-theme="light"] .hero h1 .accent {
  text-shadow: 0 0 10px rgba(var(--theme-color-rgb), 0.2);
}


.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

@keyframes pulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.1);
  }
}

/* Quick Links Grid */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.link-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.link-card:hover {
  transform: translateY(-5px);
  border-color: var(--electric-blue);
  background-color: var(--bg-surface);
  box-shadow: 0 10px 20px rgba(0, 225, 255, 0.05);
}

.link-card i {
  font-size: 2.2rem;
  color: var(--electric-blue);
  transition: var(--transition);
}

.link-card:hover i {
  transform: scale(1.1);
}

.link-card.highlight {
  border-color: rgba(var(--theme-color-rgb), 0.5);
  background: linear-gradient(135deg, var(--bg-panel), rgba(var(--theme-color-rgb), 0.05));
  position: relative;
}

.link-card.highlight::before {
  content: 'BONUS COINS';
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--gold-color);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.link-card.highlight i {
  color: var(--gold-color);
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.3));
}

.link-card span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.feature-card {
  background-color: var(--bg-panel);
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.feature-card:hover {
  border-color: var(--electric-blue);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 225, 255, 0.05);
}

.feature-card i {
  font-size: 2.5rem;
  color: var(--electric-blue);
  margin-bottom: 1rem;
  display: block;
}

.feature-card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Dashboard Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.panel {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-surface);
}

.panel-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.panel-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: rgba(var(--theme-color-rgb), 0.02);
  text-align: center;
}

.list-group {
  list-style: none;
}

.list-group li {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-group li:last-child {
  border-bottom: none;
}

.list-group li .primary-text {
  font-weight: 500;
  display: block;
}

.list-group li .secondary-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Featured Slot */
.featured-slot {
  margin-bottom: 3rem;
}

.featured-slot h3 {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fbbf24;
}

.slot-card {
  background: linear-gradient(to right, rgba(251, 191, 36, 0.1), transparent);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 2rem;
  border-radius: var(--border-radius);
  border-left: 4px solid #fbbf24;
}

.slot-content p {
  font-size: 1.2rem;
  font-style: italic;
  margin-bottom: 1rem;
}

.slot-author {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Reviews Section */
.reviews-section {
  margin-top: 3rem;
  padding: 0 1.25rem;
  /* Increased separation from side walls */
}

.reviews-section h3 {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.review-card {
  background-color: var(--bg-panel);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
}

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

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stars {
  color: #fbbf24;
  font-size: 0.9rem;
}

.review-text {
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-main);
}

.review-author {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tabs & Section Nav */
.section-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 64px;
  background-color: var(--bg-dark);
  z-index: 100;
  margin-top: -1rem;
  /* Adjust for container padding */
  padding-top: 1rem;
}

/* Ensure background covers scrolling text */
[data-theme="light"] .section-nav {
  background-color: var(--bg-dark);
}

/* Breadcrumbs UI - Single Line with Truncation */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
  width: 100%;
}

.breadcrumbs span {
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Allow the last item (current page) to truncate if needed */
.breadcrumbs span:last-child {
  color: var(--electric-blue);
  font-weight: 700;
  min-width: 0;
  flex-shrink: 1;
}

/* Keep previous levels intact unless space is critical */
.breadcrumbs span:not(:last-child) {
  flex-shrink: 0;
}

.breadcrumbs i {
  font-size: 0.75rem;
  opacity: 0.5;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Root Category Tagline (Stacked Layout) */
.breadcrumb-root {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  overflow: hidden;
}

.root-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1.5rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.root-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.8;
}

@media (max-width: 600px) {
  .root-name {
    font-size: 1.25rem;
  }

  .root-tagline {
    font-size: 0.75rem;
  }
}


.tabs {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.tab-btn:hover {
  background-color: var(--bg-surface);
  color: var(--text-main);
}

.tab-btn.active {
  background-color: var(--accent-color);
  color: #fff;
}

/* Content Grid / Feed */
.dynamic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  width: 100%;
}

@media (min-width: 769px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1000px;
    margin: 2.5rem auto;
    gap: 4.5rem;
    padding: 0;
  }
}

.gallery-item {
  background-color: var(--bg-panel);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

/* .gallery-item:hover {
  transform: translateY(-8px);
  border-color: var(--theme-color);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
} */

.gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
}

/* Landscape/Portrait helpers if classes are added later */
.gallery-item.portrait img {
  aspect-ratio: 3 / 4;
}

/* .gallery-item:hover img {
  transform: scale(1.03);
} */

.gallery-item p {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.5;
}

.gallery-item-content {
  padding: 1.5rem;
}

.gallery-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
}

.comments-section {
  border-top: 1px dashed var(--border-color);
  padding-top: 1.25rem;
}

.file-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  /* Flexbox safety */
}

.file-card:hover {
  border-color: var(--electric-blue);
}

.file-card h4 {
  margin-bottom: 0.5rem;
}

.file-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.file-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.file-actions {
  margin-top: auto;
}

.file-actions a {
  display: block;
  text-align: center;
}

/* Subject & Chapter Cards: Compact Row Layout */
.subject-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.subject-card:hover {
  border-color: var(--electric-blue);
  background-color: var(--bg-surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.card-icon-box {
  width: 48px;
  height: 48px;
  background: rgba(var(--theme-color-rgb), 0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.subject-card:hover .card-icon-box {
  background: var(--electric-blue);
}

.subject-card i {
  font-size: 1.8rem;
  color: var(--electric-blue);
  transition: var(--transition);
}

.subject-card:hover i {
  color: #000;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.subject-card h3 {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 2px;
  font-weight: 700;
  line-height: 1.2;
}

.subject-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Chapter specificity */
.chapter-card .card-icon-box {
  background: rgba(var(--theme-color-rgb), 0.04);
}


.btn-small {
  padding: 0.5rem 1rem !important;
  font-size: 0.85rem !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Feed Layout (Notices) */
.feed-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 700px;
  margin: 0 auto;
}

.feed-item {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 0;
  text-align: justify;
}

@media (max-width: 630px) {
  .feed-item {
    padding: 1.25rem;
  }
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 630px) {
  .notice-item .feed-header {
    flex-direction: column-reverse;
    gap: 0.25rem;
  }
}

.feed-header h3 {
  font-size: 1.35rem;
  color: var(--text-main);
  flex: 1;
}

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

.date-badge {
  color: var(--electric-blue);
  font-size: 0.85rem;
  background: rgba(var(--theme-color-rgb), 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  border: 1px solid rgba(var(--theme-color-rgb), 0.2);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.feed-hashtags {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
}

.tag {
  background-color: var(--bg-surface);
  color: var(--electric-blue);
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  border-radius: var(--border-radius);
}

.feed-img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  margin: 1.5rem 0;
  display: block;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.feed-img:hover {
  filter: brightness(1.05);
}

@media (min-width: 901px) {
  .feed-img {
    max-width: 600px;
    margin: 2rem auto;
  }
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: var(--bg-surface);
  font-weight: 500;
  color: var(--text-muted);
}

.data-table tr:hover {
  background-color: var(--bg-surface);
}

/* Center Utilities & Overlays */
.center-content {
  text-align: center;
  padding: 4rem 2rem;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 17, 21, 0.9);
  backdrop-filter: blur(5px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-content {
  text-align: center;
  max-width: 400px;
}

.overlay-content i {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
}

/* Profile Layout */
.profile-card {
  max-width: 600px;
  background-color: var(--bg-panel);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  margin: 0 auto;
  overflow: hidden;
}

.profile-header {
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-panel));
  display: flex;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: var(--bg-dark);
  border: 2px solid var(--electric-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--electric-blue);
}

.profile-stats {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.stat-box {
  flex: 1;
  text-align: center;
  padding: 1.5rem;
  border-right: 1px solid var(--border-color);
}

.stat-box:last-child {
  border-right: none;
}

.stat-val {
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.profile-actions {
  padding: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Theme Selector */
.theme-selector {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.color-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.color-option:hover {
  transform: scale(1.2);
}

.color-option.active {
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Upload Dashboard */
.upload-hero {
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-panel));
  padding: 2.5rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
  gap: 2rem;
}

.upload-hero h3 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  color: var(--electric-blue);
}

.evo-badge {
  background-color: rgba(0, 225, 255, 0.1);
  padding: 1rem 1.5rem;
  border-radius: 50px;
  border: 1px solid var(--electric-blue);
  color: var(--electric-blue);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.evo-badge i {
  font-size: 1.5rem;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.upload-info-card,
.upload-action-card,
.guidelines-card {
  background-color: var(--bg-panel);
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.info-list {
  list-style: none;
  margin-top: 1.5rem;
}

.info-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.info-list li i {
  color: var(--accent-color);
}

/* Logo System - Prevents layout shifts */
.logo-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  /* Reserve space to prevent layout jump */
  background: rgba(var(--theme-color-rgb), 0.05);
  border-radius: 6px;
}

.hero-partnership {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 1s ease;
}

.hero-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: brightness(1.2);
  /* Reserve space */
  min-width: 48px;
}

.partnership-divider {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 300;
  opacity: 0.5;
}

.collaboration-card {
  padding: 2.5rem !important;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-panel));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
}

.collaboration-logos {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.collab-logo-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.collab-logo-img {
  height: 80px;
  width: auto;
  object-fit: contain;
  /* Reserve space */
  min-width: 80px;
}

.logo-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.disclaimer-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.disclaimer-title {
  color: var(--text-main);
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.trademark-notice {
  font-size: 0.8rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
  color: var(--text-muted);
  font-style: italic;
}

/* Global Footer */
.global-footer {
  margin-top: auto;
  padding: 3rem 1.5rem;
  /* Reduced horizontal padding */
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
}

.footer-content {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Center footer items */
}

.footer-disclaimer-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}

.footer-disclaimer-card p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.footer-trademark {
  font-size: 0.75rem;
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-copyright {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Legacy Section Styling */
.legacy-section {
  margin-bottom: 3.5rem;
  padding: 2.5rem;
  border-left: 4px solid var(--theme-color);
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-panel));
}

.legacy-grid {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.legacy-main {
  flex: 1;
  min-width: 300px;
}

.legacy-feature-box {
  flex: 0 0 220px;
  padding: 2rem;
  background: rgba(var(--theme-color-rgb), 0.05);
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  text-align: center;
}

@media (max-width: 600px) {
  .legacy-section {
    padding: 1.5rem 1rem;
  }

  .legacy-main {
    min-width: 100%;
  }

  .legacy-feature-box {
    flex: 1 1 100%;
  }

  .global-footer {
    padding: 2rem 1rem;
  }

  .footer-disclaimer-card {
    padding: 1rem;
    width: 100%;
  }
}

.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 3rem 1.5rem;
  text-align: center;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.drop-zone:hover {
  border-color: var(--electric-blue);
  background-color: var(--bg-surface);
}

.drop-zone i {
  font-size: 3.5rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* MAR Section Styles */
.mar-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.mar-rule-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--electric-blue);
  padding: 1.5rem;
  border-radius: 0;
  transition: var(--transition);
}

.mar-rule-card:hover {
  transform: translateY(-5px);
  border-color: var(--electric-blue);
}

.mar-rule-card i {
  font-size: 2rem;
  color: var(--electric-blue);
  margin-bottom: 1rem;
  display: block;
}

.mar-rule-card h4 {
  color: var(--text-main);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.mar-rule-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.multiplier-info {
  font-size: 0.8rem;
  color: var(--gold-color);
  margin-top: 1rem;
  font-style: italic;
}

.section-title-box {
  margin-bottom: 1.5rem;
}

.mar-table-wrapper {
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

.mar-points-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-panel);
  font-size: 0.95rem;
  color: var(--text-main);
}

.mar-points-table th {
  background: var(--bg-surface);
  color: var(--electric-blue);
  text-align: left;
  padding: 1rem;
  border-bottom: 2px solid var(--electric-blue);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
}

.mar-points-table td {
  padding: 1rem;
  border: 1px solid var(--border-color);
  line-height: 1.5;
  transition: background 0.2s ease;
}

.mar-points-table tr:hover td {
  background: var(--bg-hover);
}

.mar-points-table strong {
  color: var(--text-main);
}

.mt-5 {
  margin-top: 3rem;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .sidebar {
    transform: translate3d(-100%, 0, 0);
    box-shadow: none;
    visibility: hidden;
  }

  .sidebar.open {
    transform: translate3d(0, 0, 0);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
    /* Smaller blur for performance */
    visibility: visible;
  }

  /* Sidebar Overlay for Mobile */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

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

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .mobile-menu-btn,
  .mobile-toggle {
    display: block;
  }
}

@media (max-width: 630px) {
  :root {
    --sidebar-width: 80%;
  }

  .content-container {
    padding: 0.85rem;
  }

  .top-header {
    padding: 0 1rem;
    height: 60px;
  }

  .header-right {
    gap: 0.5rem;
  }

  .sem-display {
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
    gap: 0.4rem;
  }

  #login-btn {
    padding: 0.45rem 0.8rem;
  }

  .hero {
    padding: 3rem 1rem;
    margin-bottom: 2rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .features-grid,
  .dashboard-grid,
  .gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  .gallery-item img {
    aspect-ratio: auto;
    max-height: 400px;
  }

  .dynamic-grid,
  .upload-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .upload-hero {
    flex-direction: column;
    padding: 1.5rem;
    text-align: center;
  }

  .upload-hero h3 {
    font-size: 1.5rem;
  }

  .file-card {
    padding: 1rem;
  }

  .gallery-item img {
    height: 200px;
  }

  .file-meta {
    flex-direction: column;
    gap: 0.3rem;
  }

  #page-title {
    font-size: 1.15rem;
  }

  .header-left {
    gap: 0.75rem;
  }

  #sub-page-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .section-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding-bottom: 0.5rem;
    top: 60px;
    /* Align with mobile top-header height */
  }

  .tabs {
    overflow-x: auto;
    padding-bottom: 0.75rem;
    -webkit-overflow-scrolling: touch;
    display: flex;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    flex-shrink: 0;
  }

  .subject-filter select {
    width: 100%;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1rem;
    gap: 1rem;
  }

  .avatar {
    width: 80px;
    height: 80px;
    font-size: 2.2rem;
  }

  .profile-info h2 {
    font-size: 1.5rem;
  }

  .profile-stats {
    flex-direction: row;
    display: flex;
  }

  .stat-box {
    border-right: 1px solid var(--border-color);
    border-bottom: none;
    padding: 1rem 0.5rem;
  }

  .stat-box h4 {
    font-size: 0.8rem;
  }

  .stat-val {
    font-size: 1.3rem;
  }

  .semester-card>div {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .semester-switch-profile {
    width: 100%;
  }

  .semester-switch-profile select,
  .semester-switch-profile .sem-display {
    width: 100%;
    justify-content: center;
  }

  .profile-actions {
    flex-direction: column;
    padding: 1.5rem 1rem;
  }

  .profile-actions button,
  .profile-actions a {
    width: 100%;
  }

  .color-option {
    width: 32px;
    height: 32px;
  }

  .panel {
    overflow-x: auto;
  }

  .data-table th,
  .data-table td {
    padding: 0.8rem 0.6rem;
    font-size: 0.85rem;
  }
}

/* Leaderboard Styling */
.leaderboard-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(var(--theme-color-rgb), 0.05);
  border-radius: 12px;
  border: 1px solid rgba(var(--theme-color-rgb), 0.1);
}

.leaderboard-header h4 {
  color: var(--theme-color);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 1.25rem 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.donator-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-right: 1.5rem;
  border-radius: 50%;
  background: rgba(var(--theme-color-rgb), 0.05);
}


.donator-info {
  flex-grow: 1;
}

.donator-name {
  font-weight: 700;
  font-size: 1.05rem;
  display: block;
}

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

.donation-badge {
  background: rgba(var(--theme-color-rgb), 0.1);
  color: var(--theme-color);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  border: 1px solid rgba(var(--theme-color-rgb), 0.2);
}

.donation-card {
  max-width: 900px;
  margin: 2rem auto;
  padding: 3.5rem !important;
  background: var(--bg-panel);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 10;
}

.donation-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.donation-header h3 {
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  color: var(--theme-color);
  text-transform: uppercase;
  font-size: 1.5rem;
}

.donation-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  text-align: center;
  margin-bottom: 2.5rem;
}

.expense-table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

.expense-table {
  width: 100%;
  border-collapse: collapse;
}

.expense-table th {
  background: rgba(var(--theme-color-rgb), 0.05);
  text-align: left;
  padding: 1.25rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--theme-color);
  border-bottom: 1px solid var(--border-color);
}

.expense-table td {
  padding: 1.25rem 1.5rem;
  font-size: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.expense-table tfoot td {
  background: rgba(var(--theme-color-rgb), 0.03);
  font-weight: 800;
  color: var(--theme-color);
  border-bottom: none;
  font-size: 1.1rem;
}

.total-amount {
  text-align: right;
  color: var(--theme-color) !important;
}

/* Funding Progress Bar Styles */
.funding-progress-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.progress-text {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.progress-stats {
  font-size: 1.1rem;
  font-weight: 500;
}

.progress-stats strong {
  color: var(--theme-color);
}

.progress-bar-bg {
  width: 100%;
  height: 12px;
  background: var(--bg-dark);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--theme-color), var(--accent-color));
  width: 0%;
  transition: width 1s ease-in-out;
  border-radius: 50px;
  box-shadow: 0 0 15px rgba(var(--theme-color-rgb), 0.3);
}

.progress-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  text-align: center;
}

.upi-section {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.upi-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.upi-apps {
  display: flex;
  gap: 1rem;
}

.btn-gpay,
.btn-phonepe {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-gpay {
  background: #1a73e8;
  color: white;
}

.btn-phonepe {
  background: #512da8;
  color: white;
}

.btn-gpay:hover,
.btn-phonepe:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .donation-card {
    padding: 1.5rem 1rem !important;
    margin: 0.5rem;
    border-radius: 12px;
  }

  .donation-header h3 {
    font-size: 1.25rem;
  }

  .donation-desc {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  .expense-table th,
  .expense-table td {
    padding: 1rem 0.75rem;
    font-size: 0.85rem;
  }

  .expense-table tfoot td {
    font-size: 0.95rem;
  }

  .upi-copy-box {
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1rem;
    text-align: center;
  }

  .funding-progress-container {
    padding: 1rem;
  }

  .event-submission-banner {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem !important;
  }

  .event-submission-banner .btn-primary {
    width: 100%;
  }

  .event-submission-banner div {
    min-width: unset !important;
  }
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
}

.about-card {
  padding: 2.5rem !important;
  position: relative;
  overflow: hidden;
}

.card-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(var(--theme-color-rgb), 0.1);
  color: var(--theme-color);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.about-card h2 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
}

.about-features {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.about-features li i {
  color: var(--theme-color);
  font-size: 1.2rem;
}

.dev-card {
  text-align: center;
}

.avatar-container {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(135deg, var(--theme-color), var(--accent-color));
}

.dev-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-panel);
}

.dev-bio {
  font-size: 0.9rem;
  margin: 1rem 0;
  line-height: 1.6;
}

.dev-socials {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.dev-socials a {
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.dev-socials a:hover {
  color: var(--theme-color);
  transform: translateY(-3px);
}

.tech-stack {
  text-align: center;
  padding: 2rem !important;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.tech-item i {
  font-size: 1.8rem;
  color: var(--theme-color);
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* Toast Notification System */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.custom-toast {
  background-color: #1e293b;
  color: white;
  padding: 16px 24px;
  border-radius: 0px;
  font-size: 0.95rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  pointer-events: auto;
}

.custom-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.custom-toast.success {
  border-left: 4px solid #4a90e2;
  /* Sharp left border for success */
}

.custom-toast.error {
  border-left: 4px solid #ef4444;
  /* Sharp left border for error */
}

/* Center Alert Modal */
#center-alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#center-alert-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.center-alert-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 2.5rem 2rem;
  max-width: 450px;
  width: 90%;
  text-align: center;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#center-alert-overlay.show .center-alert-box {
  transform: translateY(0) scale(1);
}

.center-alert-box.success {
  border-top: 4px solid var(--electric-blue);
}

.center-alert-box.error {
  border-top: 4px solid #ef4444;
}

.center-alert-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.center-alert-box.success .center-alert-icon {
  color: var(--electric-blue);
}

.center-alert-box.error .center-alert-icon {
  color: #ef4444;
}

.center-alert-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.center-alert-message {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* Avatar System */
.avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #334155;
  border: 1px solid var(--border-color);
}

.edit-avatar-trigger {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 32px;
  height: 32px;
  background: var(--electric-blue);
  color: white;
  border: 3px solid var(--bg-surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: var(--transition);
  z-index: 99;
}

.edit-avatar-trigger:hover {
  transform: scale(1.1);
  background: white;
  color: var(--electric-blue);
}

.avatar-selection-container {
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius);
  margin-top: 1.5rem;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 5px;
}

.avatar-item {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 50%;
  padding: 3px;
  transition: var(--transition);
}



.avatar-item.selected {
  border-color: var(--electric-blue);
  background: rgba(var(--theme-color-rgb), 0.15);
}

.avatar-item img {
  width: 100%;
  display: block;
}

.avatar-grid::-webkit-scrollbar {
  width: 4px;
}

.avatar-grid::-webkit-scrollbar-thumb {
  background: var(--border-color);
}

/* PDF Viewer Modal Styles */
.pdf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.pdf-modal.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.pdf-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.pdf-modal-container {
  position: relative;
  width: 90%;
  max-width: 1100px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.pdf-modal-header {
  padding: 1rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pdf-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--theme-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1rem;
}

.pdf-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pdf-close-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.pdf-modal-body {
  height: 80vh;
  background: #1a1a1a;
}

.pdf-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.pdf-modal-footer {
  padding: 0.75rem 1.5rem;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
  .pdf-modal-container {
    width: 95%;
    height: 95vh;
  }
}

/* File Card Theme Implementation */
.file-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 12px;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.file-card:hover {
  border-color: var(--theme-color);
  box-shadow: 0 10px 25px rgba(var(--theme-color-rgb), 0.1);
}

.chapter-card i {
  color: var(--theme-color);
  opacity: 0.8;
}

.file-card h4 {
  margin-bottom: 0.75rem;
  color: var(--text-main);
  font-size: 1.15rem;
}

.file-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.file-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
}

.file-view-btn {
  width: 100%;
  justify-content: center;
  padding: 0.6rem 1.25rem !important;
  font-size: 0.9rem !important;
  border-radius: 6px !important;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--theme-color);
  border: 1.5px solid var(--theme-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.file-view-btn:hover {
  background: var(--theme-color) !important;
  color: var(--bg-dark) !important;
  box-shadow: 0 0 15px rgba(var(--theme-color-rgb), 0.4);
}

.file-view-btn i {
  font-size: 1.1rem;
}

/* ================= SCHEDULE & TABLES CSS ================= */

#daily-schedule-widget {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: var(--transition);
}

#daily-schedule-widget:hover {
  border-color: var(--electric-blue);
  box-shadow: 0 10px 30px rgba(var(--theme-color-rgb), 0.05);
}

.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 1rem;
}

.status-card {
  background-color: var(--bg-surface);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  border: 1px dashed var(--border-color);
}

.status-card.holiday {
  color: var(--gold-color);
  border-color: var(--gold-color);
  background-color: rgba(251, 191, 36, 0.1);
}

.status-card.unlisted {
  color: #ef4444;
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.status-card.exam {
  color: #8b5cf6;
  border-color: #8b5cf6;
  background-color: rgba(139, 92, 246, 0.1);
}

.routine-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.class-card {
  display: flex;
  gap: 1.25rem;
  background-color: var(--bg-surface);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  flex-shrink: 0;
}

.class-card:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-muted);
}

.class-time {
  font-weight: 600;
  color: var(--electric-blue);
  min-width: 140px;
  border-right: 1px solid var(--border-color);
  padding-right: 1rem;
  display: flex;
  align-items: center;
  font-size: 1.05rem;
}

.class-details {
  flex-grow: 1;
}

.class-subject {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.class-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.class-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.live-card {
  border-color: #ef4444;
  border-width: 2px;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
  background-color: rgba(239, 68, 68, 0.02);
}

.live-badge {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}



.full-routine-table,
.holiday-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--bg-panel);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.full-routine-table th,
.full-routine-table td,
.holiday-table th,
.holiday-table td {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.full-routine-table th,
.holiday-table th {
  background-color: var(--bg-dark);
  color: var(--electric-blue);
  font-weight: 600;
}

/* Modern Accordion Routine Styles */
.routine-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--bg-surface);
  overflow: hidden;
  transition: var(--transition);
}

.accordion-header {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  background-color: var(--bg-panel);
  transition: var(--transition);
}

.accordion-header:hover {
  background-color: var(--bg-hover);
}

.accordion-item.active {
  border-color: var(--theme-color);
  box-shadow: 0 5px 20px rgba(var(--theme-color-rgb), 0.1);
}

.accordion-item.active .accordion-header {
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(var(--theme-color-rgb), 0.05);
}

.accordion-header .day-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.accordion-header h4 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}

.accordion-header i.chevron {
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.accordion-item.active i.chevron {
  transform: rotate(180deg);
  color: var(--theme-color);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active .accordion-content {
  max-height: 1000px;
  /* Large enough to fit any routine */
}

.accordion-inner {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.compact-class-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background-color: var(--bg-panel);
  border-radius: 8px;
  border-left: 3px solid var(--theme-color);
  transition: var(--transition);
}

.compact-class-row:hover {
  transform: translateX(4px);
  background-color: var(--bg-hover);
}

.row-time {
  font-weight: 700;
  color: var(--theme-color);
  font-size: 0.85rem;
  min-width: 100px;
}

.row-details {
  flex-grow: 1;
}

.row-subject {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
}

.row-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

@media (max-width: 600px) {
  .compact-class-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Horizontal Swipe for Today's Schedule on Home */
  .routine-list {
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
    gap: 0.75rem;
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-overflow-scrolling: touch;
  }

  .routine-list::-webkit-scrollbar {
    display: none;
  }

  .class-card {
    flex-direction: column;
    width: 260px;
    gap: 0.75rem;
    padding: 1rem;
    scroll-snap-align: center;
  }

  .class-time {
    min-width: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 0.5rem;
    font-size: 0.95rem;
  }

  .class-subject {
    font-size: 1rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .class-meta {
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    opacity: 0.8;
  }
}

.break-card {
  position: relative;
  overflow: hidden;
}

.break-card::after {
  content: '☕';
  position: absolute;
  right: -10px;
  bottom: -10px;
  font-size: 5rem;
  opacity: 0.05;
  transform: rotate(-15deg);
}

.break-timer {
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
  animation: glow-gold 2s infinite alternate;
}

@keyframes glow-gold {
  from {
    text-shadow: 0 0 5px rgba(251, 191, 36, 0.2);
  }

  to {
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
  }
}

.completed-card {
  opacity: 0.6;
  filter: grayscale(0.5);
  border-style: dashed !important;
  background-color: rgba(var(--bg-panel-rgb), 0.5) !important;
}

.completed-card .class-time {
  color: var(--text-muted) !important;
  text-decoration: line-through;
}

.done-badge {
  background-color: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced UPI Section */
.upi-reveal-wrapper {
  padding: 1rem 0;
  max-width: 500px;
  margin: 0 auto;
}

.reveal-btn {
  width: 100%;
  padding: 1rem !important;
  font-size: 1.1rem !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 15px rgba(var(--theme-color-rgb), 0.2);
}

.upi-details-box {
  animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.upi-id-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: left;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.upi-id-card label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.upi-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(var(--theme-color-rgb), 0.2);
}

.upi-copy-row code {
  color: var(--theme-color);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  word-break: break-all;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  padding: 5px;
  display: flex;
  align-items: center;
}

.copy-btn:hover {
  color: var(--theme-color);
  transform: scale(1.1);
}

.wa-verify-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(34, 197, 94, 0.08);
  border-left: 5px solid #22c55e;
  padding: 1.25rem 1.5rem;
  border-radius: 6px 16px 16px 6px;
  text-align: left;
}

.wa-verify-banner i {
  font-size: 2.2rem;
  color: #22c55e;
  filter: drop-shadow(0 0 5px rgba(34, 197, 94, 0.3));
}

.banner-text strong {
  display: block;
  color: #22c55e;
  font-size: 1rem;
  margin-bottom: 4px;
}

.banner-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.6;
  opacity: 0.9;
}

/* Featured Supporter Slot */
.featured-slot {
  margin: 3rem 0;
}

.supporter-card {
  display: flex;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-panel));
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  border-left: 5px solid var(--accent-color);
}

.supporter-img-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  flex-shrink: 0;
}

.supporter-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.badge-hero {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  background: rgba(var(--accent-color-rgb, 0, 225, 255), 0.9);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.supporter-info {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.supporter-quote {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  position: relative;
}

.supporter-quote::before {
  content: '"';
  position: absolute;
  left: -1rem;
  top: -0.5rem;
  font-size: 3rem;
  opacity: 0.1;
  font-family: serif;
}

.supporter-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.supporter-name {
  font-weight: 700;
  color: var(--accent-color);
  font-size: 1rem;
}

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

@media (max-width: 600px) {
  .supporter-card {
    flex-direction: column;
  }

  .supporter-img-wrapper {
    width: 100%;
    height: 300px;
  }
}

/* ================= PRELOADER & SKELETON ================= */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-container {
  position: relative;
  width: 80px;
  height: 80px;
}

.loader-thunder {
  font-size: 80px;
  color: var(--bg-surface);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader-thunder-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  color: var(--electric-blue);
  overflow: hidden;
  animation: thunderFill 2s infinite ease-in-out;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.loader-thunder-fill i {
  font-size: 80px;
}

@keyframes thunderFill {
  0% {
    height: 0%;
  }

  50% {
    height: 100%;
  }

  100% {
    height: 100%;
    opacity: 0;
  }
}

.loader-text {
  margin-top: 1.5rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--text-main);
  font-size: 0.8rem;
  animation: blink 1.5s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-hover) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}