/* --- CSS VARIABLES --- */
:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --accent: #f72585;
  --bg-body: #f8f9fa;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --btn-gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  --table-stripe: #f1f5f9;
  --table-hover: #e2e8f0;
}

body.dark-mode {
  --primary: #6366f1;
  --secondary: #4f46e5;
  --accent: #ec4899;
  --bg-body: #0f172a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --card-bg: #1e293b;
  --card-border: #334155;
  --nav-bg: rgba(15, 23, 42, 0.85);
  --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  --table-stripe: #1e293b;
  --table-hover: #334155;
}

/* --- RESET --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: 80px;
}
a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}

/* --- UTILITIES --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.section-header {
  text-align: center;
  margin-bottom: 50px;
}
.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  letter-spacing: -1px;
}
section {
  padding: 80px 0;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--btn-gradient);
  color: white;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
  transition: 0.3s;
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

/* === NAVBAR === */
header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;

  height: 64px;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.85),
    rgba(15, 23, 42, 0.7)
  );
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--card-border);

  display: flex;
  align-items: center;
}

/* === CONTAINER === */
.container-nav {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  padding: 0 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* grup kanan */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px; /* jarak nav ke toggle */
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === LOGO === */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;

  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.3px;

  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;

  z-index: 1002;
}

.logo i {
  color: var(--primary);
}

.nav-links a {
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-muted);
  transition: 0.25s;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.nav-links a.active {
  background: var(--primary);
  color: white;
}

/* underline halus */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;

  background: var(--primary);
  border-radius: 4px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* === ACTIONS === */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;

  z-index: 1002;
}

/* === THEME TOGGLE === */
.theme-toggle {
  width: 40px;
  height: 40px;

  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);

  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}

.theme-toggle:hover {
  background: var(--table-stripe);
  transform: translateY(-1px);
}

.hamburger {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-main);
  background: none;
  border: none;
}

/* Alert */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
}

.overlay.hidden {
  display: none;
}

.agree-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 20px;
  cursor: pointer;
}

.agree-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* tombol disable */
.overlay-card button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.overlay-card h3 {
  color: rgb(255, 53, 53);
}

.overlay-card a {
  color: rgb(23, 96, 253);
}

/* === CARD === */
.overlay-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;

  padding: 28px 32px;
  max-width: 420px;
  width: 90%;

  text-align: center;
  box-shadow: var(--shadow);
}

.overlay-card hr {
  margin-bottom: 20px;
}
.overlay-card h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.overlay-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.5;
}

/* === BUTTON === */
.overlay-card button {
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;

  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  transition: box-shadow 0.3s ease;
}

.overlay-card button:hover {
  opacity: 0.9;
  box-shadow: 0 0 10px 1px var(--primary);
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: var(--card-bg);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  padding: 100px 40px 40px 40px;
  transition: right 0.4s;
  display: flex;
  flex-direction: column;
  gap: 25px;
  border-left: 1px solid var(--card-border);
}
.mobile-nav.active {
  right: 0;
}
.close-nav-btn {
  position: absolute;
  top: 25px;
  right: 25px;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}
.mobile-nav a {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
}

/* --- HERO --- */
.hero {
  padding: 180px 0 160px 0;
  text-align: center;
  position: relative;
  background-image: url("https://images.unsplash.com/photo-1577896851231-70ef18881754?q=80&w=2070&auto=format&fit=crop");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: white;
  margin-bottom: 10px;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.85),
    rgba(15, 23, 42, 0.7)
  );
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
}
.hero h1 {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -2px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* --- NEWS CARDS --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: 0.3s;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}
.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.card-body {
  padding: 20px;
}
.news-tag {
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 10px;
}
.nama {
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.85rem;
}

[data-label="Senin"] {
  background-color: #ec48481a;
}
[data-label="Selasa"] {
  background-color: #48ec561a;
}
[data-label="Rabu"] {
  background-color: #bae02e1a;
}
[data-label="Kamis"] {
  background-color: #48a2ec1a;
}
[data-label="Jumat"] {
  background-color: #ec48b51a;
}

.nama:last-child {
  border-bottom: none;
}

img {
  content: url("https://tg-stockach.de/wp-content/uploads/2020/12/5f4d0f15338e20133dc69e95_dummy-profile-pic-300x300.png"); /* Ovveride Foto */
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
}
.card-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- TABLES (JADWAL) --- */
.table-container {
  width: 100%;
  overflow: hidden; /* kunci: matikan horizontal scroll */
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--card-border);
  table-layout: fixed; /* kolom patuh lebar tabel */
}

th,
td {
  padding: 10px 8px;
  text-align: center;
  font-size: 0.85rem;
  border: 1px solid var(--card-border);
  word-break: break-word; /* lebih kuat dari word-wrap */
  white-space: normal; /* pastikan teks boleh turun */
}

/* --- VERTICAL LIST (PIKET & RANKING) --- */
.list-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.list-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow);
  transition: 0.3s;
}
.list-card:hover {
  transform: translateX(10px);
  border-color: var(--primary);
}
.badge {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  min-width: 100px;
  text-align: center;
  margin-right: 20px;
}
.list-text {
  color: var(--text-main);
  font-weight: 500;
}

/* --- CARD GRID SYSTEM (SISWA & STRUKTUR) --- */
.grid-container {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.student-card,
.wali-card {
  padding: 10px;
  border-radius: 12px;
  box-shadow: none;
}

.wali-card {
  grid-column: span 2;
}
.student-card,
.wali-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: none;
  transition: 0.3s ease;
}

/* GRID */
#data-siswa .grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 22px;
}

/* CARD */
#data-siswa .student-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  border-radius: 18px;
  padding: 18px 14px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;

  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);

  transition: 0.3s ease;
}

/* HOVER HALUS & MAHAL */
#data-siswa .student-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.12);
}

/* FOTO */
#data-siswa .square-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;

  background: var(--table-stripe);
  border: 3px solid rgba(255, 255, 255, 0.15);
}

/* NAMA */
#data-siswa .student-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.2px;
  margin-bottom: 6px;
  text-align: center;
}

.coming-soon {
  justify-content: center;
  align-items: center;
  display: flex;
  background-color: #0c1324;
  padding: 150px 0;
  border-radius: 5px;
}

.meja-guru {
  background-color: rgba(0, 68, 255, 0.295);
  padding: 10px 10px;
  border-radius: 5px;
  margin-right: 170px;
}

/* JABATAN */
#data-siswa .student-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;

  color: var(--primary);
  background: rgba(67, 97, 238, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
}

.square-photo {
  width: 80px;
  height: 80px;
  margin-bottom: 8px;
  border-radius: 10px;
}
.student-name h3,
.student-name {
  font-size: 0.85rem;
  margin: 0;
}

.student-titles {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap; /* kalau sempit, turun rapi */
}

.student-title {
  font-size: 0.5rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(67, 97, 238, 0.12);
  color: var(--primary);
}

#data-siswa .student-title.ketos {
  background: rgba(247, 37, 133, 0.15);
  color: #f72585;
}

#data-siswa .student-title.dev {
  background: rgba(247, 191, 37, 0.15);
  color: #f7b525;
}

/* Family Section Special */
.family-section {
  padding: 20px 15px;
  border-radius: 20px;
}
.student-card {
  flex-direction: row;
  gap: 8px;
}

.student-card img {
  width: 55px;
  height: 55px;
}

.student-card .student-name {
  text-align: left;
}

.wali-card:hover,
.student-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}
.wali-name {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
  font-size: 0.95rem;
}
.wali-title {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  background: rgba(67, 97, 238, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
}
/* --- MAP --- */
.map-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.seats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 25px;
}
.seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: 0.3s;
}
.seat-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--card-border);
  transition: 0.3s;
}
.seat:hover .seat-img {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent);
  transform: scale(1.1);
}
.seat-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* --- GALLERY (PREMIUM) --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.6s ease,
    filter 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.12);
  filter: brightness(0.85);
}

/* overlay */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.65),
    rgba(0, 0, 0, 0.25),
    rgba(0, 0, 0, 0)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  backdrop-filter: blur(2px);
  transition: opacity 0.35s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}
/* --- LIGHTBOX FULLSCREEN --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 9999;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: scale(0.9);
  transition: transform 0.35s ease;
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

/* close button */
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  font-size: 2.5rem;
  color: white;
  cursor: pointer;
  opacity: 0.8;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.lightbox-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* icon */
.gallery-overlay i {
  color: white;
  font-size: 1.8rem;
  transform: scale(0.8);
  opacity: 0.85;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
}

.gallery-item:hover .gallery-overlay i {
  transform: scale(1);
  opacity: 1;
}

/* --- RANKING & PRESTASI --- */
.layout-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.rank-item {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
}
.rank-num {
  font-weight: 800;
  font-size: 1.2rem;
  width: 40px;
  color: var(--primary);
}
.achieve-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--card-bg);
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
}
.achieve-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-body);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .hamburger {
    display: block;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .seats {
    grid-template-columns: repeat(4, 1fr);
  }
  .layout-split {
    grid-template-columns: 1fr;
  }
}
