/* styles.css */
/* Modern Glassmorphism & Premium Dark Theme for Pathum Pittayakorn School Website */

@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');

:root {
  --bg-dark: #070913;
  --bg-deep: #0f1123;
  --bg-gradient: linear-gradient(135deg, #070913 0%, #0f1129 50%, #05060f 100%);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.2);
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --secondary: #10b981;
  --secondary-glow: rgba(16, 185, 129, 0.4);
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.4);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --font-family: 'Sarabun', 'Outfit', sans-serif;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s ease;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Ambient glow orbs wrapper for mouse parallax */
.ambient-orb-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  transition: transform 0.25s cubic-bezier(0.1, 0.8, 0.25, 1); /* organic lag inertia */
}

/* Ambient glow orbs */
.ambient-orb {
  position: absolute; /* Changed from fixed to absolute inside wrapper */
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.orb-primary {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -150px;
  left: -150px;
  animation: floatOrb1 20s infinite alternate;
}

.orb-secondary {
  width: 400px;
  height: 400px;
  background: var(--secondary);
  bottom: -100px;
  right: -100px;
  animation: floatOrb2 25s infinite alternate;
}

.orb-accent {
  width: 350px;
  height: 350px;
  background: #a855f7;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.08;
  animation: floatOrb3 30s infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.1); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-50px, -60px) scale(1.15); }
}

@keyframes floatOrb3 {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-45%, -55%) rotate(360deg); }
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

h1 {
  font-size: 2.2rem;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: #818cf8;
}

/* Glassmorphism helpers */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: border-color var(--transition-normal), transform var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
  border-color: var(--glass-border-hover);
}

/* Navbar - Apple Liquid Style */
.navbar {
  position: sticky;
  top: 15px;
  width: calc(100% - 30px);
  max-width: 1200px;
  margin: 0 auto 1.5rem auto;
  z-index: 1000;
  background: rgba(7, 9, 19, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  transition: all var(--transition-normal);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
  overflow: visible !important;
}

.nav-container {
  padding: 0.7rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: visible !important;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
}

.nav-logo span {
  font-size: 1.8rem;
}

.nav-menu {
  display: flex;
  gap: 0.8rem;
  list-style: none;
  align-items: center;
  flex-wrap: nowrap;
  overflow: visible !important;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  transition: var(--transition-fast);
  position: relative;
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 3px;
  background: var(--primary);
  border-radius: 10px;
  box-shadow: 0 0 10px var(--primary);
}

/* Submenu / Dropdown */
.nav-item-has-children {
  position: relative;
}
/* Bridge the gap so mouse doesn't lose hover when moving to dropdown */
.nav-item-has-children::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 35px;
  background: transparent;
  z-index: 999;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 15px;
  min-width: 200px;
  background: rgba(7, 9, 19, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.95);
  transform-origin: top center;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  list-style: none;
}
.nav-item-has-children:hover .dropdown-menu,
.nav-item-has-children:focus-within .dropdown-menu,
.nav-item-has-children.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(168, 85, 247, 0.15);
}

.dropdown-toggle {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-item-has-children:hover .dropdown-toggle,
.nav-item-has-children.active .dropdown-toggle {
  transform: rotate(180deg);
  color: var(--primary);
}
.dropdown-link {
  position: relative;
  color: var(--text-secondary);
  padding: 0.7rem 1.5rem;
  display: block;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  text-decoration: none;
  overflow: hidden;
}
.dropdown-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
  transition: all 0.3s ease;
  box-shadow: 0 0 8px var(--primary);
}
.dropdown-link:hover, .dropdown-link.active {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding-left: 2rem;
}
.dropdown-link:hover::before, .dropdown-link.active::before {
  height: 60%;
}

.nav-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

/* Container limits */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  width: 100%;
  position: relative;
  z-index: 1;
  flex: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-normal);
  font-family: var(--font-family);
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 14px 0 var(--danger-glow);
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 var(--danger-glow);
}

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

/* Home Section Layouts */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
  padding: 3rem 0;
  animation: fadeIn 0.8s ease;
}

.hero-text h1 {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 1.2rem;
}

.hero-text p {
  font-size: 1.15rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
}

.hero-visual {
  display: flex;
  justify-content: center;
  position: relative;
}

.hero-avatar-glow {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.25), 0 0 50px rgba(99, 102, 241, 0.35);
  position: relative;
  overflow: hidden;
  border: 5px solid #ffffff;
}

.hero-avatar-glow::before {
  content: '';
  position: absolute;
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: var(--bg-deep);
  z-index: 1;
}

.hero-avatar-glow span {
  font-size: 6rem;
  z-index: 2;
  filter: drop-shadow(0 0 15px var(--primary));
}

/* Sections */
.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title h2 {
  font-size: 2rem;
  line-height: 1.35;
  padding-bottom: 0.35rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Announcement News Cards Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.news-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border-color: rgba(99, 102, 241, 0.3);
}

.news-img {
  height: 180px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.news-img-fallback {
  font-size: 3rem;
  opacity: 0.6;
}

.news-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.news-title {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  line-height: 1.4;
  color: #fff;
}

.news-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.news-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Staff & Teacher cards */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
}

.teacher-card {
  padding: 2rem 1.5rem;
  text-align: center;
}

.teacher-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 3px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.15), 0 0 20px rgba(0, 0, 0, 0.2);
}

.teacher-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teacher-name {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: #fff;
}

.teacher-pos {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

/* Gallery Grid */
.gallery-filter {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 16px;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.gallery-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to top, rgba(7, 9, 19, 0.9) 0%, rgba(7, 9, 19, 0.2) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: var(--transition-normal);
}

.gallery-card:hover img {
  transform: scale(1.1);
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-card-title {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.2rem;
}

.gallery-card-cat {
  font-size: 0.75rem;
  color: var(--secondary);
  font-weight: 600;
  text-transform: uppercase;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
  background: rgba(0, 0, 0, 0.3);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Contact layout */
.contact-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 3rem;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  padding: 1.5rem;
}

.contact-icon {
  width: 45px;
  height: 45px;
  border-radius: 10px;
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.contact-detail h4 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
  color: #fff;
}

.contact-detail p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.map-container {
  width: 100%;
  height: 250px;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  filter: invert(90%) hue-rotate(180deg) grayscale(10%);
}

.contact-form-panel {
  padding: 2.5rem;
}

/* Admin Dashboard layout */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  min-height: 70vh;
}

.admin-sidebar {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  height: fit-content;
}

.admin-user-info {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 1rem;
}

.admin-user-info .avatar {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 0.8rem;
  border: 1px solid var(--primary);
}

.admin-user-info h3 {
  font-size: 1.1rem;
}

.admin-user-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-menu-btn {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: var(--transition-fast);
}

.admin-menu-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
}

.admin-menu-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.admin-content {
  padding: 2rem;
  min-height: 600px;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.sidebar-separator {
  display: block;
  border-top: 1px solid var(--glass-border);
  margin: 0.8rem 0;
  width: 100%;
}

/* Dashboard Tables */
.admin-table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  background: rgba(0, 0, 0, 0.25);
  padding: 1rem;
  color: #fff;
  font-weight: 600;
  border-bottom: 1px solid var(--glass-border);
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
  color: #fff;
}

.table-actions {
  text-align: center;
  white-space: nowrap;
}
.table-actions button, .table-actions .btn {
  display: inline-block;
  margin: 0 4px !important;
  vertical-align: middle;
}

/* Modal and Lightbox */
.lightbox-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(7, 9, 19, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  overflow-y: auto;
  padding: 3rem 1rem;
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  max-width: 90%;
  position: relative;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
  border: 1px solid var(--glass-border);
}

.lightbox-title {
  margin-top: 1rem;
  color: #fff;
  font-size: 1.2rem;
}

.lightbox-close {
  position: absolute;
  top: -40px; right: 0;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
}

/* Custom Alert box */
.alert {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid transparent;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fecaca;
}

/* Premium Footer Grid */
.main-footer {
  background: rgba(15, 23, 42, 0.6); /* Glassmorphic dark slate */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--glass-border);
  padding: 3rem 2rem 1.5rem 2rem;
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

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

/* Login panel */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  text-align: center;
}

.login-icon {
  width: 70px;
  height: 70px;
  background: var(--primary-glow);
  border: 1px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 20px var(--primary-glow);
}

.login-card h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.login-card p {
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

/* Mobile responsive menu */
@media(max-width: 1024px) {
  .nav-container {
    padding: 1rem;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(7, 9, 19, 0.95);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    gap: 1rem;
  }
  
  .nav-menu.active {
    display: flex;
  }
  
  .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    background: transparent;
    border: none;
    border-left: 2px solid var(--primary);
    border-radius: 0;
    padding: 0;
    margin-left: 1rem;
    margin-top: 0.5rem;
    display: none;
  }
  .nav-item-has-children:hover .dropdown-menu,
  .nav-item-has-children:focus-within .dropdown-menu,
  .nav-item-has-children.active .dropdown-menu {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  .dropdown-link {
    padding: 0.5rem 1rem;
  }
  
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .hero-visual {
    order: -1;
  }
  
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .admin-layout {
    grid-template-columns: 1fr;
  }
  
  .admin-sidebar {
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    padding: 1rem;
  }
  
  .admin-menu-btn {
    padding: 0.6rem 1rem;
  }
  
  .sidebar-separator {
    display: none !important;
  }
}

/* Horizontal Scrolling Marquee for News */
.news-marquee-container {
  overflow: hidden;
  width: 100%;
  padding: 1.5rem 0;
  position: relative;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.news-marquee-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: marqueeScroll 45s linear infinite;
}

.news-marquee-track:hover {
  animation-play-state: paused;
}

.news-marquee-track .news-card {
  width: 340px;
  flex-shrink: 0;
  height: 420px; /* fixed height for cards in horizontal marquee */
}

@keyframes marqueeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-50% - 1rem));
  }
}

/* Emoji Picker styling */
.emoji-item:hover {
  background: var(--primary) !important;
  color: #fff;
  transform: scale(1.25);
  box-shadow: var(--neon-glow);
}
.emoji-grid::-webkit-scrollbar {
  width: 6px;
}
.emoji-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.emoji-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.emoji-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Director Message Responsive Layout */
.director-msg-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .director-msg-layout {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }
  .director-msg-layout .teacher-avatar {
    margin: 0 auto 1.5rem auto !important;
  }
  .director-msg-layout h3 {
    justify-content: center;
  }
}

/* Gallery Album Enhancements */
.gallery-card {
  position: relative;
  overflow: hidden;
}

.album-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--glass-border);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
}

.custom-scrollbar::-webkit-scrollbar {
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Futuristic SweetAlert2 Theme Overrides */
.swal2-popup.futuristic-swal {
  background: rgba(15, 17, 35, 0.94) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5) !important;
  border-radius: 16px !important;
  font-family: inherit !important;
}

.swal2-title.futuristic-swal-title {
  color: #ffffff !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1) !important;
}

.swal2-html-container.futuristic-swal-html {
  color: var(--text-secondary) !important;
  font-size: 0.95rem !important;
}

.swal2-actions.futuristic-swal-actions {
  gap: 12px !important;
}

.swal2-confirm.futuristic-swal-confirm {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-glow) 100%) !important;
  color: #fff !important;
  box-shadow: 0 0 12px var(--primary-glow) !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  padding: 0.55rem 1.6rem !important;
  transition: 0.25s !important;
  cursor: pointer !important;
}
.swal2-confirm.futuristic-swal-confirm:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 0 20px var(--primary-glow) !important;
}

.swal2-cancel.futuristic-swal-cancel {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  padding: 0.55rem 1.6rem !important;
  transition: 0.25s !important;
  cursor: pointer !important;
}
.swal2-cancel.futuristic-swal-cancel:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

/* Announcement Popup Overlay styles (Raw Floating Theme) */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 9, 19, 0.88);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.popup-overlay.active {
  opacity: 1;
}

.popup-content-raw {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  max-width: 90%;
  max-height: 90vh;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-overlay.active .popup-content-raw {
  transform: scale(1);
}

.popup-close-x {
  position: absolute;
  top: 30px;
  right: 30px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 3.5rem;
  cursor: pointer;
  line-height: 1;
  z-index: 100000;
  transition: color 0.2s, transform 0.2s;
}

.popup-close-x:hover {
  color: #fff;
  transform: scale(1.1);
}

/* Sidebar Accordion Groups */
.sidebar-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  margin-top: 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
  user-select: none;
  -webkit-user-select: none;
}
.sidebar-group-header:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-group-content {
  max-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 0.5rem;
  border-left: 1px dashed var(--glass-border);
  margin-left: 0.75rem;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease, margin-top 0.3s ease;
  margin-top: 0;
}

.sidebar-group-content.expanded {
  max-height: 500px;
  opacity: 1;
  margin-top: 0.35rem;
}

.sidebar-group-header .chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.sidebar-group-header:hover .chevron {
  color: #fff;
}

/* Academics Page Responsive Grid Layout */
.academics-card-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: center;
}

.academics-card-grid.reversed {
  grid-template-columns: 280px 1fr;
}

@media (max-width: 768px) {
  .academics-card-grid, 
  .academics-card-grid.reversed {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 1.5rem !important;
  }
  
  /* On mobile, stack text above the activity badge */
  .academics-card-grid.reversed {
    display: flex !important;
    flex-direction: column-reverse !important;
  }
}

/* -------------------------------------
   Light Mode Overrides
-------------------------------------- */
body.light-mode {
  --bg-dark: #f0f4f8;
  --bg-deep: #e2e8f0;
  --bg-gradient: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 50%, #cbd5e1 100%);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-bg-hover: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-border-hover: rgba(0, 0, 0, 0.1);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
}

body.light-mode .navbar {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

body.light-mode h1, body.light-mode h2, body.light-mode h3, body.light-mode h4, body.light-mode h5, body.light-mode h6 {
  color: #0f172a;
}
body.light-mode h1, body.light-mode .section-title h2 {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.light-mode .nav-logo { color: #0f172a; }
body.light-mode .nav-link, body.light-mode .dropdown-link { color: var(--text-secondary); }
body.light-mode .nav-link:hover, body.light-mode .nav-link.active, body.light-mode .dropdown-link:hover { color: #0f172a; background: rgba(0, 0, 0, 0.05); }
body.light-mode .dropdown-menu, body.light-mode .nav-menu { background: rgba(255, 255, 255, 0.95); border-color: rgba(0, 0, 0, 0.1); }
body.light-mode .btn-secondary { color: var(--text-primary); border-color: rgba(0,0,0,0.1); }
body.light-mode .form-control { background: rgba(255, 255, 255, 0.6); color: #0f172a; border-color: rgba(0,0,0,0.1); }
body.light-mode .ambient-orb { opacity: 0.25; }
body.light-mode .news-card { border-color: rgba(0, 0, 0, 0.05); background: rgba(255, 255, 255, 0.4); }
body.light-mode .news-title { color: #0f172a; }
body.light-mode .admin-sidebar, body.light-mode .admin-content { background: rgba(255, 255, 255, 0.5); }
body.light-mode .admin-table th { background: rgba(0, 0, 0, 0.05); color: #0f172a; }
body.light-mode .admin-table td { color: #334155; }
body.light-mode .sidebar-group-header:hover { background: rgba(0, 0, 0, 0.05); color: #0f172a; }
body.light-mode .admin-menu-btn:hover { background: rgba(0, 0, 0, 0.03); color: #0f172a; }
body.light-mode .gallery-card-title { color: #0f172a; }
body.light-mode .gallery-overlay { background: linear-gradient(to top, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.2) 100%); }
body.light-mode .nav-toggle { color: #0f172a; }

/* Theme Toggle Button in Navbar */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-left: 10px;
}
.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) rotate(15deg);
}
body.light-mode .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}
