/* ============================================
   REUNI SMPN 8 MOJOKERTO '97
   Mobile-First Premium Dark Theme (Editable Version)
   ============================================ */

:root {
    --bg: #0a0a0f;
    --bg-alt: #0f0f16;
    --surface: #14141c;
    --surface2: #1a1a25;
    --border: #2a2a3a;
    --text: #ede9e3;
    --text-soft: #9a95a0;
    --text-muted: #6b6678;
    --gold: #f0c040;
    --gold-dim: #a88a2a;
    --gold-glow: rgba(240, 192, 64, 0.25);
    --cyan: #00e5ff;
    --cyan-glow: rgba(0, 229, 255, 0.2);
    --green: #22c55e;
    --green-glow: rgba(34, 197, 94, 0.2);
    --wa-green: #25D366;
    --red: #ef4444;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --font: 'Outfit', system-ui, -apple-system, sans-serif;
    --font-display: 'Playfair Display', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font); background: var(--bg); color: var(--text);
    line-height: 1.6; min-height: 100vh; overflow-x: hidden; padding-bottom: 70px;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

/* ---- EDIT MODE INDICATORS ---- */
[contenteditable="true"] {
    outline: 2px dashed var(--gold); outline-offset: 4px;
    background: rgba(240,192,64,0.1); border-radius: 4px; transition: all 0.2s;
}
[contenteditable="true"]:focus { outline: 2px solid var(--gold); background: rgba(240,192,64,0.2); }
.fab-edit {
    position: fixed; top: 16px; right: 16px; width: 44px; height: 44px;
    border-radius: 50%; border: none; background: var(--surface2); color: var(--text);
    font-size: 1.2rem; box-shadow: 0 4px 15px rgba(0,0,0,0.5); z-index: 9999; cursor: pointer;
    border: 1px solid var(--border);
}
.admin-toolbar {
    position: fixed; top: 0; left: 0; right: 0;
    background: linear-gradient(to right, #2a0845, #6441A5); color: #fff;
    padding: 12px 16px; display: flex; justify-content: space-between; align-items: center;
    z-index: 10000; font-size: 0.85rem; font-weight: 700; box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.btn-save-edit, .btn-cancel-edit { padding: 6px 12px; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; }
.btn-save-edit { background: var(--gold); color: #000; }
.btn-cancel-edit { background: rgba(255,255,255,0.2); color: #fff; margin-left: 8px; }

.admin-only { display: none; }
body.edit-mode .admin-only { display: block; }

.btn-add-item {
    width: 100%; padding: 14px; margin-top: 16px; font-size: 1rem; font-weight: 700;
    background: rgba(240,192,64,0.1); color: var(--gold); border: 2px dashed var(--gold-dim);
    border-radius: var(--radius-sm); cursor: pointer; transition: 0.2s;
}
.btn-add-item:active { background: var(--gold); color: #000; }

.btn-item-action {
    display: flex; gap: 4px; margin-top: 6px;
}
.btn-item-action button {
    flex: 1; padding: 6px; border: none; border-radius: 4px; font-size: 0.7rem; font-weight: 700; cursor: pointer; color: #fff;
}
.btn-edit { background: #3b82f6; }
.btn-delete { background: var(--red); }

/* ---- LIGHTBOX & MODALS ---- */
.lightbox {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,0.9); backdrop-filter: blur(10px);
    display: none; justify-content: center; align-items: center; padding: 20px;
    overflow-y: auto;
}
.lightbox.active { display: flex; }
.lightbox-close {
    position: fixed; top: 20px; right: 20px; font-size: 3rem; color: #fff; cursor: pointer;
    line-height: 1; z-index: 100000;
}
.lightbox img {
    max-width: 100%; max-height: 90vh; border-radius: 8px; box-shadow: 0 0 40px rgba(0,0,0,0.5); border: 2px solid var(--gold-dim);
}
.admin-modal-content {
    background: var(--surface); padding: 20px; border-radius: var(--radius); border: 1px solid var(--border);
    width: 100%; max-width: 500px;
}
.admin-modal-content h3 { margin-bottom: 12px; color: var(--gold); }
.admin-modal-content label { display: block; font-size: 0.8rem; margin-top: 10px; margin-bottom: 4px; color: var(--text-soft); }

/* ---- CONTAINER ---- */
.container { width: 100%; max-width: 600px; margin: 0 auto; padding: 0 16px; }
.section { padding: 48px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 8px; }
.section-desc { text-align: center; color: var(--text-soft); font-size: 0.9rem; margin-bottom: 24px; }

/* ---- GLOBAL PHOTO 4x6 (ASPECT RATIO 2:3) ---- */
.photo-4x6 {
    width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-sm);
    cursor: pointer; transition: transform 0.3s; background: #2a2a3a; border: 2px solid var(--border);
}
.photo-4x6:active { transform: scale(0.95); }

/* ---- INFO CARDS & MAPS BUTTONS ---- */
.info-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.info-card { padding: 16px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); text-align: center; }
.info-card-icon { font-size: 1.8rem; margin-bottom: 6px; }
.info-card h3 { font-size: 0.75rem; color: var(--text-soft); text-transform: uppercase; margin-bottom: 4px; }
.info-card p { font-size: 0.9rem; font-weight: 600; }
.info-sub { font-size: 0.8rem; color: var(--text-soft); font-weight: 400; margin-top: 4px; line-height: 1.4; }
.btn-group-sm { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.btn-loc-sm { padding: 8px 12px; font-size: 0.8rem; font-weight: 700; border-radius: 50px; background: linear-gradient(135deg, #4285F4, #34A853); color: #fff; box-shadow: 0 4px 15px rgba(66,133,244,0.3); }
.btn-loc-sm.alt { background: linear-gradient(135deg, #e94335, #fbbc05); box-shadow: 0 4px 15px rgba(233,67,53,0.3); }

/* ---- HERO ---- */
.hero { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 16px; overflow: hidden; background: linear-gradient(170deg, #0d0b1a 0%, #0a0a14 40%, #0c1018 100%); }
.hero-overlay { position: absolute; inset: 0; background: radial-gradient(circle at 50% 30%, var(--gold-glow), transparent 60%), radial-gradient(circle at 20% 80%, var(--cyan-glow), transparent 50%); pointer-events: none; }
.hero-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-particles .particle { position: absolute; width: 3px; height: 3px; background: var(--gold); border-radius: 50%; opacity: 0; animation: particleFloat 6s ease-in-out infinite; }
@keyframes particleFloat { 0% { opacity: 0; transform: translateY(100vh) scale(0); } 20% { opacity: 0.8; } 100% { opacity: 0; transform: translateY(-20vh) scale(1); } }
@keyframes textPulse { 0% { transform: scale(1); text-shadow: 0 0 0 rgba(0,0,0,0); } 50% { transform: scale(1.05); text-shadow: 0 0 15px var(--gold); color: var(--gold); } 100% { transform: scale(1); text-shadow: 0 0 0 rgba(0,0,0,0); } }
.hero-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; }
.hero-badge { display: inline-block; padding: 6px 18px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; border: 1px solid var(--gold-dim); border-radius: 50px; color: var(--gold); background: rgba(240,192,64,0.08); }
.hero-title { font-family: var(--font-display); font-size: 2.2rem; font-weight: 900; line-height: 1.15; color: var(--text); }
.hero-highlight { background: linear-gradient(135deg, var(--gold) 0%, #ffdf80 50%, var(--gold) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-year { font-size: 1.6rem; font-weight: 900; letter-spacing: 0.3em; color: var(--cyan); text-shadow: 0 0 30px var(--cyan-glow); }
.hero-tagline { font-size: 0.95rem; color: var(--text-soft); max-width: 90%; text-wrap: balance; line-height: 1.4; }
.hero-date-card { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 8px 0; }
.hero-date-icon { font-size: 1.6rem; }
.hero-date-value { font-size: 1rem; font-weight: 700; color: var(--text); display: inline-block; animation: textPulse 2s infinite ease-in-out; }
.btn-primary-hero { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; font-size: 1rem; font-weight: 700; color: #0a0a0f; background: linear-gradient(135deg, var(--gold), #ffe066); border-radius: 50px; box-shadow: 0 4px 20px var(--gold-glow); margin-top: 8px; }

/* ---- RUNDOWN ---- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(to bottom, var(--gold), var(--cyan)); border-radius: 2px; }
.timeline-item { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg); box-shadow: 0 0 10px var(--gold-glow); }
.timeline-time { flex-shrink: 0; font-size: 0.85rem; font-weight: 800; color: var(--cyan); min-width: 42px; padding-top: 2px; }
.timeline-content h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; }
.timeline-content p { font-size: 0.8rem; color: var(--text-soft); }

/* ---- ALBUM & PANITIA GRID ---- */
.album-grid, .panitia-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.album-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.album-card-info { padding: 12px 10px; text-align: center; }
.album-card h4 { font-size: 0.85rem; color: var(--text); font-weight: 700; margin-bottom: 2px; }
.album-role { font-size: 0.7rem; color: var(--gold); margin-bottom: 6px; letter-spacing: 0.05em; text-transform: uppercase; }
.album-card p { font-size: 0.7rem; color: var(--text-soft); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 8px; }
.album-actions { display: flex; flex-direction: column; gap: 4px; align-items: stretch; margin-top: 8px; }
.btn-album-sm { padding: 6px; font-size: 0.7rem; font-weight: 700; border-radius: 6px; text-align: center; }
.btn-album-sm.wa { background: var(--wa-green); color: #fff; }
.btn-album-sm.map { background: var(--surface2); border: 1px solid var(--border); color: var(--text); }

/* ---- DANA / URUNAN ---- */
.dana-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 16px; }
.dana-amount { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.dana-label { font-size: 0.85rem; color: var(--text-soft); }
.dana-value { font-size: 1.4rem; font-weight: 900; color: var(--gold); text-shadow: 0 0 15px var(--gold-glow); }
.dana-progress-wrap { margin-bottom: 20px; }
.dana-progress-header { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-soft); margin-bottom: 6px; }
.dana-progress-bar { height: 10px; background: var(--surface2); border-radius: 10px; overflow: hidden; }
.dana-progress-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); border-radius: 10px; box-shadow: 0 0 10px var(--green-glow); transition: width 1s ease; }
.dana-progress-info { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ---- GUESTBOOK ---- */
.guestbook-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.gb-input, .gb-textarea { width: 100%; padding: 12px 14px; font-size: 0.9rem; font-family: var(--font); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); outline: none; appearance: none; -webkit-appearance: none; }
.gb-input[type="file"] { padding: 8px; background: var(--surface2); }
.gb-input:focus, .gb-textarea:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-glow); }
.upload-box { padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: rgba(255,255,255,0.02); }
.upload-box label { font-size: 0.8rem; color: var(--text-soft); display: block; margin-bottom: 4px; }
.btn-submit-gb { padding: 14px; font-size: 0.95rem; font-weight: 700; color: #0a0a0f; background: linear-gradient(135deg, var(--gold), #ffe066); border: none; border-radius: 50px; cursor: pointer; }
.guestbook-list { display: flex; flex-direction: column; gap: 12px; }
.gb-entry { display: flex; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.gb-entry-photo { width: 60px; height: 90px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #2a2a3a; cursor: pointer; border: 1px solid var(--border); }
.gb-entry-body { flex: 1; min-width: 0; }
.gb-entry-header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.gb-entry-header strong { font-size: 0.9rem; }
.gb-kelas { font-size: 0.65rem; padding: 2px 8px; background: var(--gold-glow); color: var(--gold); border-radius: 50px; font-weight: 700; }
.gb-entry p { font-size: 0.85rem; color: var(--text-soft); line-height: 1.5; word-wrap: break-word; }
.gb-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 6px; display: block; }

/* ---- FOOTER & RSVP ---- */
.btn-wa-big { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; font-size: 1.05rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #25D366, #128C7E); border-radius: 50px; }
.footer { padding: 40px 0 90px; text-align: center; background: var(--surface); border-top: 1px solid var(--border); }
.footer-logo { font-size: 2.5rem; margin-bottom: 8px; }
.footer-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.footer-copy { font-size: 0.7rem; color: var(--text-muted); }

/* ---- BOTTOM NAV ---- */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: rgba(14, 14, 20, 0.95); border-top: 1px solid var(--border); z-index: 999; padding-bottom: env(safe-area-inset-bottom, 4px); }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 4px; font-size: 0.6rem; font-weight: 600; color: var(--text-muted); -webkit-tap-highlight-color:transparent;}
.nav-item.active { color: var(--gold); }
.nav-icon { font-size: 1.2rem; }

.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px); padding: 10px 20px; background: var(--surface2); border: 1px solid var(--gold-dim); border-radius: 50px; font-size: 0.8rem; font-weight: 600; color: var(--gold); z-index: 1000; opacity: 0; transition: all 0.3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 600px) {
    .container { max-width: 700px; padding: 0 24px; }
    .hero-title { font-size: 3rem; }
    .hero-year { font-size: 2rem; }
    .info-cards { grid-template-columns: 1fr 1fr; }
    .album-grid, .panitia-grid { grid-template-columns: repeat(3, 1fr); }
    .gb-entry-photo { width: 80px; height: 120px; }
}
@media (min-width: 900px) {
    .container { max-width: 900px; padding: 0 40px; }
    .album-grid, .panitia-grid { grid-template-columns: repeat(4, 1fr); }
    .bottom-nav { display: none; }
    body { padding-bottom: 0; }
}
