/* ============================================
   PPDB SEKOLAH - PREMIUM CSS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #1e1b4b;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
}

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

body {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* === NAVBAR === */
.navbar {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1000; padding: 0 2rem; height: 72px;
    display: flex; align-items: center; justify-content: space-between;
    transition: var(--transition);
}
[data-theme="dark"] .navbar {
    background: rgba(15,23,42,0.85);
}
.navbar-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.navbar-brand img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.navbar-brand h1 { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.navbar-brand small { font-size: 0.75rem; color: var(--text-muted); display: block; margin-top: -2px; }
.navbar-actions { display: flex; align-items: center; gap: 10px; }

/* === BUTTONS === */
.btn {
    padding: 10px 24px; border-radius: var(--radius-sm); font-weight: 600;
    font-size: 0.9rem; border: none; cursor: pointer;
    transition: var(--transition); display: inline-flex;
    align-items: center; gap: 8px; text-decoration: none;
    font-family: inherit; line-height: 1.4;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; box-shadow: 0 4px 15px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(99,102,241,0.45); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: linear-gradient(135deg, var(--success), #16a34a); color: #fff; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #dc2626); color: #fff; }
.btn-warning { background: linear-gradient(135deg, var(--warning), #d97706); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: var(--radius-xs); }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn-icon { width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 12px; }

/* === HERO === */
.hero {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: center; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding-top: 72px;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { text-align: center; z-index: 2; color: #fff; max-width: 700px; padding: 2rem; }
.hero-content h2 { font-size: 3.5rem; font-weight: 900; line-height: 1.1; margin-bottom: 1rem; text-shadow: 0 2px 20px rgba(0,0,0,0.15); }
.hero-content p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 2rem; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-buttons .btn { padding: 14px 36px; font-size: 1rem; border-radius: 50px; }
.btn-glass { background: rgba(255,255,255,0.2); backdrop-filter: blur(10px); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.btn-glass:hover { background: rgba(255,255,255,0.3); }
.btn-white { background: #fff; color: var(--primary-dark); font-weight: 700; }
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.2); }

/* === SLIDER === */
.slider-section { position: relative; overflow: hidden; }
.slider-container { display: flex; transition: transform 0.6s cubic-bezier(0.4,0,0.2,1); }
.slider-item { min-width: 100%; height: 400px; position: relative; }
.slider-item img { width: 100%; height: 100%; object-fit: cover; }
.slider-caption {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 2rem; color: #fff;
}
.slider-dots { display: flex; justify-content: center; gap: 8px; padding: 1rem; }
.slider-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); cursor: pointer; transition: var(--transition); border: none; }
.slider-dot.active { background: var(--primary); width: 30px; border-radius: 5px; }

/* === CARDS === */
.card {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    overflow: hidden; transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-body { padding: 1.5rem; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); font-weight: 700; display: flex; align-items: center; justify-content: space-between; }

/* === SIDEBAR (ADMIN) === */
.admin-layout { display: flex; min-height: 100vh; padding-top: 72px; }
.sidebar {
    width: 280px; background: var(--bg-sidebar); color: #fff;
    position: fixed; top: 72px; left: 0; bottom: 0;
    overflow-y: auto; transition: var(--transition); z-index: 900;
    padding: 1.5rem 0;
}
.sidebar-menu { list-style: none; padding: 0; }
.sidebar-menu a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 24px; color: rgba(255,255,255,0.7);
    text-decoration: none; font-weight: 500;
    transition: var(--transition); border-left: 3px solid transparent;
}
.sidebar-menu a:hover, .sidebar-menu a.active {
    color: #fff; background: rgba(255,255,255,0.1);
    border-left-color: var(--primary-light);
}
.sidebar-menu a svg, .sidebar-menu a i { width: 20px; opacity: 0.7; }
.main-content { margin-left: 280px; flex: 1; padding: 2rem; min-height: calc(100vh - 72px); }

/* === STATS GRID === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 1.5rem; border: 1px solid var(--border);
    display: flex; align-items: center; gap: 1rem;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.stat-icon {
    width: 56px; height: 56px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.stat-icon.blue { background: rgba(99,102,241,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(34,197,94,0.1); color: var(--success); }
.stat-icon.yellow { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }
.stat-info h3 { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-info p { color: var(--text-muted); font-size: 0.85rem; }

/* === FORM === */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; color: var(--text); }
.form-control {
    width: 100%; padding: 12px 16px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 0.95rem;
    background: var(--bg-card); color: var(--text);
    transition: var(--transition); font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,0.1); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* === WIZARD === */
.wizard-steps { display: flex; justify-content: center; gap: 0; margin-bottom: 2rem; position: relative; }
.wizard-step { display: flex; flex-direction: column; align-items: center; position: relative; flex: 1; }
.wizard-step::before {
    content: ''; position: absolute; top: 20px; left: -50%; right: 50%;
    height: 3px; background: var(--border); z-index: 0;
}
.wizard-step:first-child::before { display: none; }
.wizard-step.active .step-number, .wizard-step.completed .step-number { background: var(--primary); color: #fff; }
.wizard-step.completed .step-number { background: var(--success); }
.wizard-step.active::before, .wizard-step.completed::before { background: var(--primary); }
.step-number {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--border); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; z-index: 1; transition: var(--transition);
}
.step-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; text-align: center; }
.wizard-panel { display: none; animation: fadeInUp 0.4s ease; }
.wizard-panel.active { display: block; }

/* === PROGRESS BAR === */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 1rem; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 4px; transition: width 0.6s ease; }
.progress-text { font-size: 0.85rem; color: var(--text-muted); text-align: right; }

/* === STATUS BADGES === */
.badge {
    padding: 4px 12px; border-radius: 50px; font-size: 0.75rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-success { background: rgba(34,197,94,0.1); color: #16a34a; }
.badge-warning { background: rgba(245,158,11,0.1); color: #d97706; }
.badge-danger { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge-info { background: rgba(14,165,233,0.1); color: #0284c7; }

/* === TABLE === */
.table-container { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th { background: var(--bg); padding: 12px 16px; text-align: left; font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tr:hover td { background: rgba(99,102,241,0.03); }

/* === MODAL === */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px); z-index: 2000;
    display: none; align-items: center; justify-content: center;
    padding: 1rem;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-card); border-radius: var(--radius);
    width: 100%; max-width: 500px; max-height: 90vh;
    overflow-y: auto; box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-weight: 800; font-size: 1.1rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1; }

/* === CHAT === */
.chat-container { display: flex; flex-direction: column; height: 500px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 12px; }
.chat-bubble { max-width: 75%; padding: 10px 16px; border-radius: 16px; font-size: 0.9rem; line-height: 1.5; }
.chat-bubble.sent { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.received { align-self: flex-start; background: var(--bg); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble .time { font-size: 0.7rem; opacity: 0.7; margin-top: 4px; }
.chat-input-area { display: flex; gap: 8px; padding: 1rem; border-top: 1px solid var(--border); }
.chat-input-area input { flex: 1; }

/* === NOTIFICATION BELL === */
.notif-bell { position: relative; cursor: pointer; }
.notif-count {
    position: absolute; top: -4px; right: -4px;
    background: var(--danger); color: #fff;
    font-size: 0.65rem; font-weight: 700;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.notif-dropdown {
    position: absolute; top: 100%; right: 0;
    width: 320px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-xl); display: none; z-index: 1001;
    max-height: 400px; overflow-y: auto;
}
.notif-dropdown.show { display: block; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--transition); }
.notif-item:hover { background: rgba(99,102,241,0.05); }
.notif-item.unread { border-left: 3px solid var(--primary); }

/* === WHATSAPP FLOAT === */
.wa-float {
    position: fixed; bottom: 24px; right: 24px; z-index: 999;
    width: 60px; height: 60px; border-radius: 50%;
    background: #25d366; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; text-decoration: none;
    box-shadow: 0 4px 20px rgba(37,211,102,0.4);
    transition: var(--transition); animation: pulse 2s infinite;
}
.wa-float:hover { transform: scale(1.1); }

/* === PENGUMUMAN === */
.pengumuman-section { padding: 4rem 2rem; max-width: 900px; margin: 0 auto; }
.pengumuman-item { padding: 1.5rem; border-left: 4px solid var(--primary); margin-bottom: 1rem; background: var(--bg-card); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* === DASHBOARD SISWA (APP STYLE) === */
.dashboard-app { padding: 1.5rem; max-width: 600px; margin: 72px auto 0; }
.app-header { text-align: center; padding: 1.5rem 0; }
.app-header .avatar { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 12px; object-fit: cover; border: 3px solid var(--primary); }
.app-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 1.5rem 0; }
.app-menu-item {
    display: flex; flex-direction: column; align-items: center;
    padding: 1.25rem 0.5rem; background: var(--bg-card);
    border-radius: var(--radius); border: 1px solid var(--border);
    text-decoration: none; color: var(--text); transition: var(--transition);
    gap: 8px; font-size: 0.8rem; font-weight: 600;
}
.app-menu-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.app-menu-item .icon { font-size: 1.5rem; }

/* === ANIMATIONS === */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { box-shadow: 0 4px 20px rgba(37,211,102,0.4); } 50% { box-shadow: 0 4px 30px rgba(37,211,102,0.7); } }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .hero-content h2 { font-size: 2.2rem; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .wizard-steps { gap: 0; }
    .step-label { display: none; }
    .app-menu { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .modal { margin: 1rem; }
}

/* === PRINT (Formulir A4) === */
@media print {
    body { background: #fff; }
    .navbar, .sidebar, .wa-float, .btn, .no-print { display: none !important; }
    .print-area { padding: 2cm; font-size: 12pt; }
    .kop-sekolah { text-align: center; border-bottom: 3px double #000; padding-bottom: 15px; margin-bottom: 20px; }
    .kop-sekolah img { width: 80px; }
    .biodata-table td { padding: 4px 8px; border: 1px solid #000; }
    .foto-cetak { width: 3cm; height: 4cm; border: 1px solid #000; object-fit: cover; }
    .ttd-area { display: flex; justify-content: space-between; margin-top: 40px; }
    .ttd-box { text-align: center; width: 200px; }
    .ttd-line { border-bottom: 1px solid #000; margin-top: 60px; }
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === DARK MODE TOGGLE === */
.dark-toggle { cursor: pointer; font-size: 1.2rem; }

/* === LOGIN/REGISTER INLINE === */
.auth-section {
    padding: 4rem 2rem; max-width: 480px; margin: 0 auto;
}
.auth-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.auth-tab { flex: 1; padding: 12px; text-align: center; font-weight: 700; cursor: pointer; background: var(--bg); color: var(--text-muted); transition: var(--transition); border: none; font-family: inherit; font-size: 0.9rem; }
.auth-tab.active { background: var(--primary); color: #fff; }
.auth-panel { display: none; animation: fadeInUp 0.3s ease; }
.auth-panel.active { display: block; }
