/* ================================================
   KELULUSAN - MAIN STYLESHEET
   ================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
  --gold:        #F5C518;
  --gold-light:  #FFE57A;
  --gold-dark:   #C9A227;
  --accent:      #2563EB;
  --accent2:     #3B82F6;
  --green:       #00A87D;
  --green-dark:  #008A66;
  --red:         #FF4757;
  --red-dark:    #C0392B;
  --white:       #FFFFFF;
  --radius:      18px;
  --radius-sm:   10px;

  /* LIGHT THEME (DEFAULT) */
  --bg-main:     linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  --bg-solid:    #F8FAFC;
  --text-primary: #1E293B;
  --text-muted:   #64748B;
  --card-bg:     rgba(255,255,255,0.85);
  --card-border: rgba(203,213,225,0.6);
  --header-bg:   rgba(255,255,255,0.9);
  --input-bg:    rgba(255,255,255,0.8);
  --table-hover: rgba(0,0,0,0.03);
  --sidebar-bg:  linear-gradient(180deg, #FFFFFF, #F1F5F9);
  --shadow:      0 15px 35px rgba(0,0,0,0.08);
  --shadow-sm:   0 4px 15px rgba(0,0,0,0.05);
  --modal-bg:    linear-gradient(135deg, #FFFFFF, #F8FAFC);
  --input-focus: #FFFFFF;
}

html.dark-mode {
  --bg-main:     linear-gradient(135deg, #0F172A 0%, #1E293B 40%, #2563EB 70%, #1E293B 100%);
  --bg-solid:    #0F172A;
  --text-primary: #F0F4FF;
  --text-muted:   #8892B0;
  --card-bg:     rgba(255,255,255,0.06);
  --card-border: rgba(255,255,255,0.12);
  --header-bg:   rgba(13,17,23,0.85);
  --input-bg:    rgba(255,255,255,0.05);
  --table-hover: rgba(255,255,255,0.03);
  --sidebar-bg:  linear-gradient(180deg, #12162B, #1A1F3C);
  --shadow:      0 20px 60px rgba(0,0,0,0.4);
  --shadow-sm:   0 4px 20px rgba(0,0,0,0.3);
  --green:       #00C896;
  --modal-bg:    linear-gradient(135deg, #1A1F3C, #252C57);
  --input-focus: #1A1F3C;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
}

/* Particles removed – caused glitch/blink on landing page */

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  padding: 10px 16px;
}
.header-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.logo-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.logo-icon { font-size: 24px; flex-shrink: 0; }
.logo-title { display: block; font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-sub   { display: block; font-size: 10px; color: var(--text-muted); }

/* ---- Main ---- */
.main-wrap {
  position: relative; z-index: 1;
  max-width: 600px; margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ---- Hero ---- */
.hero-section { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.hero-content  { text-align: center; }
.crown-icon { font-size: 48px; display: block; }
.hero-title {
  font-size: clamp(1.8rem, 8vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  margin: 10px 0 6px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--gold), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { color: var(--text-muted); font-size: 13px; font-weight: 500; }

/* ---- Countdown Landing ---- */
.countdown-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(12px);
}
.countdown-label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.countdown-datetime { color: var(--gold); font-weight: 700; font-size: 13px; margin-bottom: 16px; }
.countdown-boxes {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: nowrap;
}
.countdown-boxes .box {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 8px;
  min-width: 0;
  flex: 1;
  max-width: 70px;
  text-align: center;
}
.countdown-boxes .box span {
  display: block; font-size: clamp(1.2rem, 5vw, 2rem); font-weight: 800; color: var(--gold); line-height: 1;
}
.countdown-boxes .box small {
  display: block; font-size: 9px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.countdown-boxes .sep { font-size: 1.5rem; font-weight: 800; color: var(--gold); flex-shrink: 0; }
.countdown-note { color: var(--text-muted); font-size: 11px; margin-top: 14px; }
.info-badge {
  background: rgba(37,99,235,0.1); border: 1px solid rgba(37,99,235,0.25);
  color: var(--accent); padding: 5px 12px; border-radius: 50px; font-size: 11px;
}
.open-badge {
  background: rgba(0,200,150,0.15); border: 1px solid rgba(0,200,150,0.3);
  color: var(--green); padding: 8px 20px; border-radius: 50px; font-weight: 600; font-size: 14px;
}

/* ---- NISN Card ---- */
.nisn-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  width: 100%;
  backdrop-filter: blur(12px);
}
.nisn-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; text-align: center; }
.alert-error {
  background: rgba(255,71,87,0.12); border: 1px solid rgba(255,71,87,0.3);
  color: #FF8A95; padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 14px; text-align: center;
}
.input-group {
  display: flex; align-items: center;
  background: var(--input-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 12px;
  transition: border-color 0.2s;
}
.input-group:focus-within { border-color: var(--accent); }
.input-icon { padding: 0 12px; }
.input-group input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-family: inherit; font-size: 15px;
  padding: 13px 12px 13px 0;
  letter-spacing: 1px;
}
.input-group input::placeholder { color: var(--text-muted); }

.btn-submit {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1A1400; font-family: inherit; font-size: 15px; font-weight: 700;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.25s; letter-spacing: 0.5px;
}
.btn-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(245,197,24,0.35); }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.nisn-hint { color: var(--text-muted); font-size: 11px; text-align: center; margin-top: 10px; }

/* ---- Result Pages ---- */
.result-wrap { padding: 8px 0; }
.result-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  backdrop-filter: blur(16px);
  position: relative; overflow: hidden;
}
.animate-in { animation: slideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }
@keyframes slideUp {
  from { opacity:0; transform: translateY(30px) scale(0.95); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

/* Status badge */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 50px; font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 16px;
}
.badge-lulus { background: rgba(0,200,150,0.15); border: 2px solid var(--green); color: var(--green); }
.badge-tidak { background: rgba(255,71,87,0.15); border: 2px solid var(--red); color: var(--red); }
.badge-icon { font-size: 14px; }

/* Congrats */
.congrats-text h1 { font-size: clamp(1.5rem, 6vw, 2.2rem); font-weight: 900; color: var(--gold); }
.congrats-sub { color: var(--text-muted); margin: 6px 0 20px; font-size: 13px; line-height: 1.5; }

/* Student data card */
.student-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  text-align: left;
}
.data-grid { display: flex; flex-direction: column; }
.data-row { padding: 9px 0; border-bottom: 1px solid var(--card-border); }
.data-row:last-child { border-bottom: none; }
.data-label { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 2px; }
.data-value { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); word-break: break-word; }
.footer-msg { color: var(--text-muted); font-size: 13px; font-style: italic; margin-bottom: 20px; }

/* Not Lulus */
.notlulus-wrap { padding: 16px 0 20px; }
.notlulus-icon { font-size: 52px; margin-bottom: 12px; }
.notlulus-wrap h1 { font-size: 1.6rem; font-weight: 900; color: var(--red); margin-bottom: 6px; }
.notlulus-name { font-size: 1rem; font-weight: 700; color: var(--gold); margin-bottom: 12px; }
.notlulus-msg { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
.notlulus-info {
  background: rgba(255,71,87,0.06); border: 1px solid rgba(255,71,87,0.2);
  border-radius: var(--radius-sm); padding: 16px; text-align: left;
}
.notlulus-info p { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.6; }
.notlulus-info p:last-child { margin-bottom: 0; }
.notlulus-kelas { color: var(--gold) !important; }

.btn-back {
  width: 100%; padding: 13px;
  background: var(--input-bg); border: 1px solid var(--card-border);
  color: var(--text-primary); font-family: inherit; font-size: 14px;
  border-radius: 50px; cursor: pointer; transition: all 0.2s; margin-top: 4px;
}
.btn-back:hover { background: var(--card-border); }

/* Confetti */
.confetti-wrap { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; top: -10px; animation: confettiFall linear infinite; }
@keyframes confettiFall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ---- Footer ---- */
.site-footer {
  position: relative; z-index: 1;
  text-align: center; padding: 16px;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted); font-size: 11px;
}

/* Desktop enhancement only */
@media (min-width: 600px) {
  .site-header { padding: 14px 24px; }
  .logo-title { font-size: 15px; }
  .main-wrap { padding: 40px 24px 80px; }
  .crown-icon { font-size: 56px; }
  .countdown-section { padding: 28px; }
  .countdown-boxes .box { min-width: 70px; padding: 14px 18px; }
  .countdown-boxes .sep { font-size: 2rem; }
  .nisn-card { padding: 32px; }
  .result-card { padding: 40px 32px; }
  .student-card { padding: 24px; }
  .status-badge { padding: 8px 24px; font-size: 13px; margin-bottom: 24px; }
  .congrats-sub { margin-bottom: 28px; }
  .btn-back { width: auto; padding: 12px 28px; }
}

/* ================================================
   ADMIN STYLES
   ================================================ */
.admin-body {
  background: var(--bg-solid);
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
}

.admin-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 240px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--card-border);
  display: flex; flex-direction: column;
  z-index: 50;
  overflow-y: auto;
}
.admin-logo {
  padding: 24px 20px; border-bottom: 1px solid var(--card-border);
}
.admin-logo .logo-name { font-size: 13px; font-weight: 700; color: var(--gold); margin-top: 4px; }
.admin-logo .logo-sub  { font-size: 11px; color: var(--text-muted); }
.admin-nav { padding: 16px 12px; flex: 1; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px; text-decoration: none;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  transition: all 0.2s; margin-bottom: 4px;
}
.admin-nav a:hover { background: var(--card-bg); color: var(--text-primary); }
.admin-nav a.active { background: rgba(108,99,255,0.15); color: var(--accent); border-left: 3px solid var(--accent); }
.admin-nav .nav-icon { font-size: 16px; }
.admin-footer { padding: 16px; border-top: 1px solid var(--card-border); }
.admin-footer a { color: var(--text-muted); font-size: 12px; text-decoration: none; }
.admin-footer a:hover { color: var(--red); }

.admin-main {
  margin-left: 240px;
  padding: 32px;
  min-height: 100vh;
}
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.admin-topbar h1 { font-size: 1.5rem; font-weight: 800; }
.admin-topbar p  { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* Stats cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-sm); padding: 20px;
  backdrop-filter: blur(8px);
}
.stat-card .stat-num { font-size: 2rem; font-weight: 900; }
.stat-card .stat-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.stat-gold   { border-left: 3px solid var(--gold); }
.stat-green  { border-left: 3px solid var(--green); }
.stat-red    { border-left: 3px solid var(--red); }
.stat-accent { border-left: 3px solid var(--accent); }

/* Panels */
.panel {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 24px;
  backdrop-filter: blur(8px); margin-bottom: 24px;
}
.panel-title { font-size: 15px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }

/* Table */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 10px 14px;
  color: var(--text-muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--card-border);
}
tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); transition: background 0.15s; }
tbody tr:hover { background: var(--table-hover); }
tbody td { padding: 11px 14px; }

/* Badges in table */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 50px;
  font-size: 11px; font-weight: 600;
}
.badge-green { background: rgba(0,200,150,0.15); color: var(--green); border: 1px solid rgba(0,200,150,0.3); }
.badge-red   { background: rgba(255,71,87,0.15);  color: var(--red);   border: 1px solid rgba(255,71,87,0.3); }

/* Action buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #5753D4; }
.btn-success { background: var(--green-dark); color: white; }
.btn-success:hover { background: #009B73; }
.btn-danger  { background: var(--red-dark); color: white; }
.btn-danger:hover  { background: #A93226; }
.btn-gold    { background: var(--gold); color: #1A1400; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-secondary { background: var(--input-bg); color: var(--text-muted); border: 1px solid var(--card-border); }
.btn-secondary:hover { background: var(--card-border); color: var(--text-primary); }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* Form fields */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 14px;
  background: var(--input-bg); border: 1px solid var(--card-border);
  border-radius: 8px; color: var(--text-primary); font-family: inherit; font-size: 14px;
  transition: border-color 0.2s; outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group select option { background: var(--input-focus); }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: rgba(0,200,150,0.12); border: 1px solid rgba(0,200,150,0.3); color: var(--green); }
.alert-error   { background: rgba(255,71,87,0.12);  border: 1px solid rgba(255,71,87,0.3);  color: #FF8A95; }
.alert-info    { background: rgba(108,99,255,0.12); border: 1px solid rgba(108,99,255,0.3); color: #A8A4FF; }

/* Pagination */
.pagination { display: flex; gap: 6px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 6px 12px; border-radius: 6px; font-size: 12px; text-decoration: none;
  border: 1px solid var(--card-border); color: var(--text-muted); transition: all 0.2s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); color: white; border-color: var(--accent); }

/* Upload area */
.upload-area {
  border: 2px dashed var(--card-border); border-radius: var(--radius);
  padding: 40px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--accent); background: rgba(108,99,255,0.05);
}
.upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-area p { color: var(--text-muted); font-size: 13px; }
.upload-area strong { color: var(--text-primary); }

/* Search bar */
.search-bar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap;
}
.search-bar input {
  flex: 1; min-width: 200px; padding: 9px 14px;
  background: var(--input-bg); border: 1px solid var(--card-border);
  border-radius: 8px; color: var(--text-primary); font-family: inherit; font-size: 13px;
  outline: none;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar select {
  padding: 9px 14px; background: var(--input-bg); border: 1px solid var(--card-border);
  border-radius: 8px; color: var(--text-primary); font-family: inherit; font-size: 13px; outline: none;
}
.search-bar select option { background: var(--input-focus); }

/* Modal */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 200;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--modal-bg);
  border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 32px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.08); border: none; color: var(--text-muted);
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 16px; transition: all 0.2s;
}
.modal-close:hover { background: rgba(255,71,87,0.2); color: var(--red); }
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }

/* Login page */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-main);
}
.login-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 44px 40px;
  width: 100%; max-width: 400px;
  backdrop-filter: blur(16px);
}
.login-icon { text-align: center; font-size: 48px; margin-bottom: 16px; }
.login-title { text-align: center; font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.login-sub   { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }

/* Mobile sidebar toggle */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .hamburger { display: flex; }
}
.hamburger {
  display: none; background: none; border: none; color: var(--text-primary);
  font-size: 22px; cursor: pointer; margin-right: 12px;
}

/* Theme Toggle Button */
.theme-toggle {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}
.theme-toggle:hover {
  background: var(--card-border);
}

/* Reveal Overlay */
.reveal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-solid);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; text-align: center;
  padding: 20px;
}
.reveal-overlay.active { display: flex; }
.reveal-number {
  font-size: clamp(24px, 9vw, 140px);
  font-weight: 900; color: var(--accent);
  margin-bottom: 16px;
  text-shadow: 0 0 40px rgba(37,99,235,0.4);
  line-height: 1;
  max-width: 90vw;
  word-break: break-word;
  overflow-wrap: break-word;
}
.reveal-number.pulse { animation: countPulse 0.5s ease-out; }
.reveal-text {
  font-size: clamp(11px, 3.5vw, 18px);
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
  max-width: 90vw;
  line-height: 1.4;
}

@keyframes countPulse {
  0% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
