/* ═══════════════════════════════════
   VARIABLES
═══════════════════════════════════ */
:root {
    --ios-blue:       #007AFF;
    --ios-green:      #34C759;
    --ios-orange:     #FF9500;
    --ios-purple:     #AF52DE;
    --card-bg:        rgba(255,255,255,0.10);
    --card-border:    rgba(255,255,255,0.28);
    --text-white:     #ffffff;
    --text-muted:     rgba(255,255,255,0.65);
    --shadow:         0 8px 32px rgba(0,0,0,0.35);
    --r-lg:           24px;
    --r-md:           16px;
    --ts:             0 1px 4px rgba(0,0,0,0.55);   /* text-shadow standar */
    --font:           -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ═══════════════════════════════════
   RESET & BASE
═══════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font);
    background: url('/kelulusan/background.jpeg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    -webkit-user-select: none;
    user-select: none;
}

/* overlay gelap agar teks terbaca */
body::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.52);
    z-index: 0;
    pointer-events: none;
}

/* izinkan seleksi teks pada hasil */
#result-card, .info-value, .student-name, .student-nisn {
    -webkit-user-select: text;
    user-select: text;
}

/* ═══════════════════════════════════
   LAYOUT
═══════════════════════════════════ */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 10px;
}

/* ═══════════════════════════════════
   HEADER
═══════════════════════════════════ */
header {
    text-align: center;
    padding: 10px 0 24px;
    color: var(--text-white);
    text-shadow: var(--ts);
}
.school-logo {
    width: 100px; height: auto;
    margin-bottom: 14px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    animation: logoPop 0.8s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes logoPop {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; line-height: 1.2; text-shadow: 0 2px 12px rgba(0,0,0,0.7); }
header p  { font-size: 0.95rem; opacity: 0.92; font-weight: 500; }

/* ═══════════════════════════════════
   GLASS CARD (kotak transparan)
═══════════════════════════════════ */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.15);
}

/* ═══════════════════════════════════
   MARQUEE
═══════════════════════════════════ */
.marquee-container {
    overflow: hidden;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--r-md);
    padding: 9px 0;
    margin-bottom: 20px;
}
.marquee-text {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: marquee 30s linear infinite;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-white);
    text-shadow: var(--ts);
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ═══════════════════════════════════
   FORM PENCARIAN
═══════════════════════════════════ */
.search-section { display: flex; flex-direction: column; gap: 14px; }

.input-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(255,255,255,0.90);
    margin-bottom: 8px; margin-left: 4px;
    text-shadow: var(--ts);
}

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

.input-wrapper input {
    width: 100%;
    padding: 16px 16px 16px 52px;
    font-size: 1.15rem;
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: 2px;
    color: #111;
    /* input sendiri tetap putih solid agar angka jelas */
    background: rgba(255,255,255,0.93);
    border: none;
    border-radius: var(--r-md);
    outline: none;
    transition: box-shadow 0.2s;
    -webkit-user-select: text; user-select: text;
}
.input-wrapper input::placeholder { color: #aaa; font-weight: 400; letter-spacing: 0; }
.input-wrapper input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(0,122,255,0.45); }

.input-icon { position: absolute; left: 18px; font-size: 1.3rem; color: #888; pointer-events: none; }

.input-error {
    font-size: 0.80rem;
    font-weight: 600;
    color: #ffcdd2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    min-height: 18px;
    margin-top: 5px;
    margin-left: 4px;
}

.btn-search {
    width: 100%;
    padding: 16px;
    background: rgba(0,122,255,0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--r-md);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0,122,255,0.40);
    margin-top: 6px;
    transition: background 0.2s, transform 0.1s;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.btn-search:hover   { background: rgba(0,99,209,0.90); }
.btn-search:active  { transform: scale(0.98); }
.btn-search:disabled { background: rgba(160,160,160,0.5); cursor: not-allowed; box-shadow: none; }

/* ═══════════════════════════════════
   RESULT CARD — WAJIB display:none di awal
═══════════════════════════════════ */
#result-card {
    display: none;          /* <-- JS yang akan mengubah ke 'block' */
    text-align: center;
    animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) both;
    border: 2px solid transparent;
}
#result-card.lulus   { border-color: rgba(52,199,89,0.45); }
#result-card.tertunda { border-color: rgba(255,149,0,0.45); }
#result-card.lainnya { border-color: rgba(175,82,222,0.45); }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(28px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 9px 22px;
    border-radius: 50px;
    font-weight: 800; font-size: 1rem;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.status-lulus   { background: rgba(52,199,89,0.90);  color: #fff; }
.status-tertunda { background: rgba(255,149,0,0.90); color: #fff; }
.status-lainnya { background: rgba(175,82,222,0.90); color: #fff; }

/* Foto siswa */
.student-avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    margin: 0 auto 18px;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.70);
    box-shadow: 0 8px 24px rgba(0,0,0,0.30);
    background: rgba(255,255,255,0.15);
}
.student-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.student-name {
    font-size: 1.4rem; font-weight: 800;
    color: #fff;
    line-height: 1.3; margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.60);
}
.student-nisn {
    font-family: monospace;
    font-size: 1.05rem;
    color: rgba(255,255,255,0.80);
    margin-bottom: 22px;
    letter-spacing: 2px;
    text-shadow: var(--ts);
}

/* Grid info */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
    text-align: left;
}
.info-item {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.20);
    padding: 13px 14px;
    border-radius: 14px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.info-item.full-width {
    grid-column: 1 / -1;
    background: rgba(255,255,255,0.14);
    text-align: center;
}
.info-label {
    font-size: 0.72rem; font-weight: 700;
    color: rgba(255,255,255,0.60);
    text-transform: uppercase; letter-spacing: 0.7px;
    margin-bottom: 4px;
}
.info-value {
    font-weight: 800; font-size: 1.02rem;
    color: #fff;
    text-shadow: var(--ts);
}
.info-item.full-width .info-value {
    font-size: 0.90rem; font-weight: 600;
    line-height: 1.6;
    color: rgba(255,255,255,0.95);
}

/* ═══════════════════════════════════
   FOTO PEJABAT
═══════════════════════════════════ */
.officials-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0 18px;
    padding: 18px 12px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    gap: 0;
}

.official-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
}

.official-avatar {
    width: 78px; height: 78px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.70);
    box-shadow: 0 5px 18px rgba(0,0,0,0.35);
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}
.official-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.official-info { text-align: center; }

.official-role {
    font-size: 0.68rem; font-weight: 700;
    color: rgba(255,255,255,0.65);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.official-name {
    font-size: 0.80rem; font-weight: 650;
    color: #fff;
    line-height: 1.35;
    text-shadow: 0 1px 5px rgba(0,0,0,0.6);
    word-break: break-word;
}

.official-divider {
    width: 1px; height: 76px;
    background: rgba(255,255,255,0.25);
    flex-shrink: 0;
}

/* Tombol bawah */
.btn-reset {
    margin-top: 20px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.90);
    width: 100%; padding: 13px;
    border-radius: var(--r-md);
    font-size: 0.95rem; font-weight: 700;
    cursor: pointer;
    text-shadow: var(--ts);
    transition: background 0.2s;
}
.btn-reset:hover  { background: rgba(255,255,255,0.20); }
.btn-reset:active { background: rgba(255,255,255,0.08); }

.btn-print {
    display: none;
    margin-top: 14px;
    background: rgba(52,199,89,0.85);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff; width: 100%; padding: 15px;
    border-radius: var(--r-md);
    font-size: 1rem; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(52,199,89,0.35);
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: background 0.2s, transform 0.1s;
}
.btn-print:hover  { background: rgba(45,181,78,0.92); }
.btn-print:active { transform: scale(0.98); }

/* ═══════════════════════════════════
   TOAST
═══════════════════════════════════ */
#toast-container {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    z-index: 9000;
    display: flex; flex-direction: column; gap: 10px;
    width: 90%; max-width: 380px;
    pointer-events: none;
}
.toast {
    background: rgba(18,18,18,0.94);
    backdrop-filter: blur(20px);
    padding: 20px 22px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 10px 40px rgba(0,0,0,0.40);
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    text-align: center;
    color: #fff; font-size: 0.98rem; font-weight: 600;
    transform: scale(0.8); opacity: 0;
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: auto;
}
.toast.show { transform: scale(1); opacity: 1; }
.toast-icon { font-size: 2rem; }
.toast.error   .toast-icon { color: #ff6b6b; }
.toast.success .toast-icon { color: #34C759; }
.toast.warning .toast-icon { color: #FF9500; }
.toast.info    .toast-icon { color: #64b5f6; }

/* ═══════════════════════════════════
   CONFETTI
═══════════════════════════════════ */
.particle {
    position: fixed; top: -10px; z-index: 9999;
    pointer-events: none;
    animation: fall linear forwards;
}
@keyframes fall {
    0%   { transform: translateY(0)    rotate(0deg);   opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Footer */
footer {
    position: relative; z-index: 1;
    text-align: center;
    padding: 28px 20px;
    color: rgba(255,255,255,0.82);
    font-size: 0.83rem;
    margin-top: auto;
    text-shadow: var(--ts);
}

/* ═══════════════════════════════════
   PRINT
═══════════════════════════════════ */
@media print {
    body { background: white; color: black; display: block; padding: 0; -webkit-print-color-adjust: exact; }
    body::before { display: none; }
    footer, .search-section, .btn-reset, #toast-container, .particle { display: none !important; }
    .app-container { width: 100%; max-width: 100%; }
    #result-card {
        display: block !important;
        background: white !important; color: black;
        backdrop-filter: none; border: 1px solid #ddd;
        box-shadow: none; padding: 20px;
    }
    .status-badge { border: 2px solid black; color: black !important; background: white !important; }
    .student-name, .student-nisn, .info-value, .official-name, .official-role { color: black !important; text-shadow: none !important; }
    .info-item { background: #f5f5f5 !important; border-color: #ddd !important; backdrop-filter: none; }
    .info-label { color: #666 !important; }
    .officials-row { background: #f9f9f9 !important; border: 1px solid #ddd !important; backdrop-filter: none !important; }
    .official-avatar { border-color: #aaa !important; box-shadow: none !important; }
    .official-divider { background: #ccc !important; }
}
