/* ==============================================
   GURULINK — Global Stylesheet
   Mencakup: Login, Dashboard, Halaman Publik
   Responsive: Desktop + Mobile
   Font: Google Sans / Outfit
   ============================================== */

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

/* ── CSS Custom Properties ── */
:root {
    --primary: #0B4627;
    --primary-hover: #07331C;
    --primary-light: #F0F9E8;
    --primary-glow: rgba(150, 229, 22, 0.25);

    --success: #96E516;
    --danger: #ef4444;
    --warning: #f59e0b;

    --bg: #F7F9F5;
    --surface: #ffffff;
    --border: #DDE8DF;
    --border-hover: #96E516;

    --text: #0B4627;
    --text-secondary: #2C5F42;
    --text-muted: #5C836C;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.05);
    --shadow-xl: 0 25px 50px rgba(0,0,0,0.12);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 64px;
    --mobile-nav-height: 70px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Google Sans', 'Outfit', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; outline: none; }
img { max-width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ════════════════════════════════════
   UTILITY CLASSES
════════════════════════════════════ */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 600; transition: all var(--transition);
    white-space: nowrap; border: 1.5px solid transparent;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px var(--primary-glow); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: var(--text); border-color: var(--success); }
.btn-success:hover { background: #8cd614; color: var(--text); border-color: #8cd614; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(150, 229, 22, 0.3); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ── Form Elements ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group label { font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); }
.form-control {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 0.925rem; color: var(--text);
    background: var(--surface); transition: all var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }

/* ── Badge & Pills ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.badge-public { background: var(--bg); color: var(--success); }
.badge-private { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.badge-pdf { background: #fef2f2; color: #dc2626; }
.badge-excel { background: #E8F5E9; color: #059669; }
.badge-word { background: #F0F9E8; color: var(--text); }
.badge-video { background: #faf5ff; color: #7c3aed; }
.badge-drive { background: #fff7ed; color: #d97706; }
.badge-link { background: var(--primary-light); color: var(--primary); }
.badge-gambar { background: #fdf4ff; color: #a21caf; }
.badge-instagram { background: linear-gradient(135deg, #fdf2f8, #fff7ed); color: #c2410c; border: 1px solid #fed7aa; }
.badge-tiktok { background: #E0F2F1; color: #0f766e; border: 1px solid #b2dfdb; }
.badge-twitter { background: #F0F9E8; color: var(--text); border: 1px solid var(--border); }
.badge-facebook { background: #F0F9E8; color: var(--text); border: 1px solid var(--border); }
.badge-whatsapp { background: #E8F5E9; color: #15803d; border: 1px solid #c8e6c9; }
.badge-lainnya { background: var(--bg); color: var(--text-secondary); }

/* Category colors */
.cat-rpp { background: #F0F9E8; color: var(--text); }
.cat-absensi { background: #E8F5E9; color: #065f46; }
.cat-nilai { background: #fff7ed; color: #c2410c; }
.cat-laporan { background: #faf5ff; color: #6d28d9; }
.cat-jadwal { background: #fef9c3; color: #854d0e; }
.cat-silabus { background: #fdf2f8; color: #9d174d; }
.cat-sk { background: #E8F5E9; color: #15803d; }
.cat-lainnya { background: var(--bg); color: var(--text-muted); }

/* ── Toast Notification ── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--text); color: white; padding: 12px 20px;
    border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 500;
    box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
    animation: slideInRight 0.3s ease, fadeOut 0.4s ease 2.6s forwards;
    max-width: 300px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideInRight { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateY(10px); } }

/* ════════════════════════════════════
   PAGE: LOGIN
════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface);
}

.login-brand {
    background: linear-gradient(145deg, #022c22, #064e3b, #047857);
    display: flex; flex-direction: column; justify-content: center;
    align-items: flex-start; padding: 60px;
    position: relative; overflow: hidden;
}
.login-brand::before {
    content: ''; position: absolute; top: -80px; right: -80px;
    width: 300px; height: 300px; background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.login-brand::after {
    content: ''; position: absolute; bottom: -50px; left: -50px;
    width: 200px; height: 200px; background: rgba(255,255,255,0.04);
    border-radius: 50%;
}
.brand-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 60px; }
.brand-logo-icon { width: 44px; height: 44px; background: rgba(255,255,255,0.2); backdrop-filter: blur(10px); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; }
.brand-logo span { font-size: 2.2rem; font-weight: 800; color: var(--success); letter-spacing: -0.5px; }
.brand-title { font-size: 2.4rem; font-weight: 800; color: white; line-height: 1.2; margin-bottom: 16px; }
.brand-subtitle { font-size: 1rem; color: rgba(255,255,255,0.7); line-height: 1.6; max-width: 380px; margin-bottom: 48px; }
.brand-features { display: flex; flex-direction: column; gap: 16px; }
.brand-feature { display: flex; align-items: center; gap: 14px; }
.brand-feature-icon { width: 36px; height: 36px; background: rgba(255,255,255,0.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; }
.brand-feature p { color: rgba(255,255,255,0.85); font-size: 0.95rem; font-weight: 500; }

.login-form-area {
    display: flex; flex-direction: column; justify-content: center;
    align-items: center; padding: 60px;
}
.login-form-box { width: 100%; max-width: 420px; }
.login-form-box h2 { font-size: 1.75rem; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.login-form-box .subtitle { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 32px; }

.auth-tabs { display: flex; background: var(--bg); border-radius: var(--radius-md); padding: 4px; margin-bottom: 28px; gap: 4px; }
.auth-tab { flex: 1; padding: 10px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600; color: var(--text-muted); background: transparent; transition: all var(--transition); }
.auth-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.divider span { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* ════════════════════════════════════
   LAYOUT: DASHBOARD
════════════════════════════════════ */
.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: var(--nav-height) 1fr;
    height: 100vh;
    overflow: hidden;
}

/* ── Top Navbar ── */
.top-nav {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    position: sticky; top: 0;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo-icon { width: 34px; height: 34px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; }
.nav-logo-text { font-size: 1.8rem; font-weight: 800; color: var(--success); letter-spacing: -0.5px; }

.nav-search-bar {
    flex: 1; max-width: 500px; margin: 0 32px;
    position: relative;
}
.nav-search-bar input {
    width: 100%; padding: 9px 16px 9px 42px;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 50px; font-size: 0.9rem; color: var(--text); transition: all var(--transition);
}
.nav-search-bar input:focus { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.nav-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.nav-search-bar .search-clear { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); cursor: pointer; }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: var(--radius-md); cursor: pointer; transition: background var(--transition); }
.nav-user:hover { background: var(--bg); }
.nav-avatar { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background-color: #dcfce7; color: var(--success); font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.nav-user-info { display: flex; flex-direction: column; }
.nav-user-name { font-size: 0.875rem; font-weight: 700; color: var(--success); line-height: 1.2; }
.nav-user-school { font-size: 0.72rem; color: var(--text-muted); line-height: 1.2; }
.nav-actions .btn-icon { color: var(--success); }
.nav-actions .btn-outline { border-color: rgba(150, 229, 22, 0.4); }
/* ── Sidebar ── */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 24px 16px;
    overflow-y: auto;
    grid-row: 2;
}
.sidebar-section-title { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 0 8px; margin-bottom: 8px; margin-top: 20px; }
.sidebar-section-title:first-child { margin-top: 0; }

.sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 500; color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition);
    position: relative;
}
.sidebar-item:hover { background: var(--bg); color: var(--text); }
.sidebar-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-item .count { margin-left: auto; font-size: 0.75rem; background: var(--bg); padding: 1px 7px; border-radius: 20px; color: var(--text-muted); font-weight: 600; }
.sidebar-item.active .count { background: rgba(79,70,229,0.15); color: var(--primary); }

.sidebar-divider { height: 1px; background: var(--border); margin: 12px 0; }

.sidebar-add-btn { margin-top: auto; padding-top: 16px; }

/* ── Main Content ── */
.main-content {
    overflow-y: auto;
    padding: 28px 32px;
    display: flex; flex-direction: column; gap: 24px;
    grid-row: 2;
}

/* ── Page Content ── */
.page-content { padding: 32px 24px 100px; max-width: 1200px; margin: 0 auto; width: 100%; overflow-y: auto; }
.page-header { 
    margin-bottom: 24px; 
    background: linear-gradient(145deg, #022c22, #064e3b, #047857);
    padding: 80px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(2, 44, 34, 0.4);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-header::before {
    content: ''; position: absolute; top: -50px; right: -50px;
    width: 200px; height: 200px; background: rgba(255,255,255,0.03);
    border-radius: 50%; pointer-events: none;
}
.header-three-cols {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    width: 100%;
    position: relative;
    z-index: 2;
    transform: translateY(-8px); /* Menggeser sedikit ke atas agar terlihat seimbang secara optikal */
}
.header-date {
    justify-self: start;
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 600;
}
.page-header-text { justify-self: center; }
.page-header-text h1 { font-size: 2.7rem; font-weight: 900; color: var(--success); line-height: 1.1; letter-spacing: -0.5px; text-align: center; text-shadow: 0 0 20px rgba(150, 229, 22, 0.4); }
.page-header-text p { color: rgba(255,255,255,0.85); margin-top: 4px; font-size: 0.9rem; text-align: center; font-style: italic; }

.real-time-clock {
    justify-self: end;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--success);
    background: var(--primary-light);
    padding: 6px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-grid { 
    display: grid; 
    grid-template-columns: repeat(8, 1fr); 
    gap: 14px; 
    margin-bottom: 24px; 
    position: relative; 
}
.category-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0; padding: 4px; border-radius: 16px;
    aspect-ratio: 1 / 1;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
}
.category-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 12px 24px rgba(249, 115, 22, 0.15); 
    border-color: var(--primary); 
    background: var(--primary-light); 
}
.category-card.active { 
    border-color: var(--primary); 
    background: var(--primary); 
    color: white; 
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(249, 115, 22, 0.25);
}
.cat-icon { 
    display: flex; align-items: center; justify-content: center; 
    font-size: 5.2rem; 
    line-height: 0.8;
    margin-top: 10px;
    margin-bottom: 4px;
    background: transparent !important; 
    transition: transform 0.3s;
}
.category-card:hover .cat-icon { transform: scale(1.1); }
.category-card span { 
    font-family: 'Harabara', sans-serif; 
    font-size: 1rem; 
    font-weight: normal; 
    color: var(--text-secondary); 
    line-height: 1; 
    letter-spacing: 0.5px; 
    text-align: center;
    position: relative;
    z-index: 2;
}
.category-card:hover span { color: var(--primary); }
.category-card.active span { color: white; }

.cat-action-btn {
    display: none;
    position: absolute; top: -6px; right: -6px;
    width: 20px; height: 20px;
    background: var(--danger); color: white;
    border-radius: 50%; border: 2px solid white;
    align-items: center; justify-content: center;
    cursor: pointer; z-index: 10;
}
.category-grid.edit-mode .cat-action-btn { display: flex; }
.category-grid.edit-mode .category-card:not(.no-drag) {
    border-color: var(--danger);
}

/* ── Category Grid Delete Button ── */
.cat-grid-del {
    position: absolute; top: -4px; right: -4px;
    width: 18px; height: 18px;
    background: #ef4444; color: white;
    border: 2px solid white; border-radius: 50%;
    font-size: 0.6rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; transition: opacity 0.2s;
    z-index: 5; padding: 0; line-height: 1;
}
.category-item:hover .cat-grid-del { opacity: 1; }
.cat-grid-del:hover { background: #dc2626; transform: scale(1.15); }

/* ── Filter Bar ── */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-pill {
    padding: 6px 16px; border-radius: 6px; font-family: 'Harabara', sans-serif; font-size: 0.8rem; font-weight: normal; letter-spacing: 0.5px;
    color: var(--text-muted); background: var(--surface); border: 1.5px solid var(--border);
    cursor: pointer; transition: all var(--transition);
}
.filter-pill:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.filter-pill.active { background: var(--primary); color: white; border-color: var(--primary); }
.filter-divider { width: 1px; height: 24px; background: var(--border); }

/* ── Link Cards Grid ── */
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.link-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex; flex-direction: column; gap: 14px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.link-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); border-radius: 4px 0 0 4px; opacity: 0; transition: opacity var(--transition); }
.link-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.link-card:hover::before { opacity: 1; }

.link-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.link-card.pinned-card {
    border-color: #fbbf24;
    background-color: #fffbeb;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15);
}
.link-card.pinned-card::before {
    opacity: 1;
    background: #f59e0b;
}
.link-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.link-title { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.4; margin: 0; }
.link-card-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; margin-top: 4px; }
.link-card-author-inline { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-right: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.link-card-meta-inline { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-right: 2px; }
.link-card-meta { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; }
.link-card-meta .dot { width: 3px; height: 3px; background: var(--text-muted); border-radius: 50%; flex-shrink: 0; }

.link-card-actions { display: flex; gap: 8px; }
.link-card-actions .btn { flex: 1; font-size: 0.82rem; padding: 8px 12px; }
.link-delete-btn { background: none; border: none; padding: 6px; color: var(--text-muted); cursor: pointer; border-radius: 6px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.link-delete-btn:hover { background: #fee2e2; color: #ef4444; }

.btn-favorite { background: none; border: none; padding: 6px; color: var(--text-muted); cursor: pointer; border-radius: 6px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-favorite:hover { background: #f0fdf4; color: var(--success); }
.btn-favorite.active { color: var(--success); }
.btn-favorite.active svg { fill: var(--success); }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; color: var(--text-muted); max-width: 300px; margin: 0 auto 20px; }

/* ── Stats Row ── */
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 32px; }
.stat-card { background: var(--success); border: none; border-radius: 12px; padding: 16px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 4px 12px rgba(150, 229, 22, 0.2); text-align: center; }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(150, 229, 22, 0.4); background: #8cd614; }
.stat-icon { display: none; }
.stat-info { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-info h3 { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; margin: 0; }
.stat-info p { font-size: 0.75rem; color: var(--text); font-weight: 700; margin: 0; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.85; }

/* ════════════════════════════════════
   PAGE: PUBLIC SEARCH (index.html)
════════════════════════════════════ */
.public-page { min-height: 100vh; display: flex; flex-direction: column; }

.public-hero {
    background: linear-gradient(145deg, #01120e, #022c22, #011f18);
    padding: 80px 24px 100px;
    text-align: center; color: white;
    position: relative; overflow: hidden;
}
.public-hero::before { content: ''; position: absolute; top: -100px; left: 50%; transform: translateX(-50%); width: 500px; height: 500px; background: radial-gradient(circle, rgba(129,140,248,0.3) 0%, transparent 70%); pointer-events: none; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); padding: 6px 16px; border-radius: 50px; font-size: 0.85rem; margin-bottom: 24px; border: 1px solid rgba(255,255,255,0.15); }
.public-hero h1 { font-size: 2.8rem; font-weight: 800; line-height: 1.2; max-width: 600px; margin: 0 auto 16px; }
.public-hero p { font-size: 1.1rem; color: rgba(255,255,255,0.75); max-width: 500px; margin: 0 auto 40px; }

.hero-search-box { max-width: 620px; margin: 0 auto; position: relative; }
.hero-search-box input { width: 100%; padding: 18px 24px 18px 56px; border-radius: 50px; border: none; font-size: 1rem; background: white; color: var(--text); box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.hero-search-box input:focus { box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 0 4px rgba(129,140,248,0.4); }
.hero-search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.hero-search-box .search-count { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }

.public-content { flex: 1; max-width: 1200px; margin: 0 auto; width: 100%; padding: 48px 24px; }
.public-nav { position: sticky; top: 0; background: rgba(247,249,245,0.9); backdrop-filter: blur(10px); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; z-index: 50; border-bottom: 1px solid var(--border); }
.public-nav-brand { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 800; }
.public-nav-logo { width: 32px; height: 32px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; }

/* ════════════════════════════════════
   MODAL
════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(11,70,39,0.7); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 500;
    padding: 20px;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--surface); width: 100%; max-width: 500px;
    border-radius: var(--radius-xl); padding: 32px;
    box-shadow: var(--shadow-xl);
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 1.25rem; font-weight: 800; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: var(--bg); color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: all var(--transition); }
.modal-close:hover { background: var(--border); color: var(--text); transform: rotate(90deg); }

/* Toggle for Public/Private */
.privacy-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.privacy-option { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border-radius: var(--radius-md); border: 2px solid var(--border); cursor: pointer; transition: all var(--transition); text-align: center; }
.privacy-option:hover { border-color: var(--border-hover); background: var(--bg); }
.privacy-option.selected { border-color: var(--primary); background: var(--primary-light); }
.privacy-option input[type="radio"] { display: none; }
.privacy-icon { font-size: 1.5rem; }
.privacy-label { font-size: 0.875rem; font-weight: 700; color: var(--text-secondary); }
.privacy-desc { font-size: 0.75rem; color: var(--text-muted); }
.privacy-option.selected .privacy-label { color: var(--primary); }



/* ════════════════════════════════════
   MOBILE RESPONSIVE
════════════════════════════════════ */
@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: var(--nav-height) 1fr var(--mobile-nav-height);
        height: 100dvh;
    }
    .sidebar { display: none; }
    .main-content { padding: 20px 16px; grid-row: 2; padding-bottom: 20px; }

    /* Mobile Bottom Nav */
    .mobile-nav {
        display: flex !important;
        grid-column: 1;
        grid-row: 3;
        background: var(--surface);
        border-top: 1px solid var(--border);
        align-items: stretch;
    }
    .mobile-nav-item {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 4px; padding: 8px; font-size: 0.68rem; font-weight: 600; color: #94a3b8;
        cursor: pointer; transition: all var(--transition); position: relative;
    }
    .mobile-nav-item.active { color: var(--primary); }
    .mobile-nav-item.active svg { filter: drop-shadow(0 2px 6px rgba(249, 115, 22, 0.4)); }
    .mobile-nav-item svg { width: 22px; height: 22px; transition: all 0.2s; }
    .mobile-add-btn { flex: none; width: 64px; display: flex; align-items: center; justify-content: center; position: relative; }
    .mobile-add-circle { width: 56px; height: 56px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; box-shadow: 0 8px 16px var(--primary-glow); transform: translateY(-18px); border: 4px solid var(--surface); transition: transform 0.2s; }
    .mobile-add-circle:active { transform: translateY(-14px) scale(0.95); box-shadow: 0 4px 8px rgba(249, 115, 22, 0.4); }

    /* Nav search on mobile */
    .nav-search-bar { display: none; }
    .nav-actions .btn span { display: none; }
    .nav-user-info { display: none; }
    .nav-logo-text { font-size: 1.5rem; }
    .mobile-search-box { display: block !important; margin-bottom: 20px; }

    /* Cards on mobile */
    .links-grid { grid-template-columns: 1fr; gap: 10px; }
    .link-card { padding: 12px; gap: 10px; border-radius: 8px; }
    .link-card-badges { gap: 4px; }
    .badge { padding: 2px 8px; font-size: 0.65rem; }
    .link-title { font-size: 12px; line-height: 1.3; }
    .link-card-desc { font-size: 10px; }
    .link-card-author-inline { font-size: 8px; max-width: 100px; }
    .link-card-meta-inline { font-size: 8px; }
    .link-card-meta { font-size: 0.75rem; }
    .link-card-actions .btn { padding: 6px 10px; font-size: 0.75rem; }
    .stats-row { grid-template-columns: repeat(5, 1fr); gap: 4px; }
    .stat-card { flex-direction: column; padding: 8px 2px; gap: 2px; text-align: center; justify-content: center; }
    .stat-icon { display: none; } /* Hide icon to make it super minimalist */
    .stat-info h3 { font-size: 1rem; margin: 0 auto; }
    .stat-info p { font-size: 0.5rem; margin: 0; line-height: 1.1; letter-spacing: 0; }
    .category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
    .category-card { flex-direction: column; padding: 4px; border: none; background: transparent; box-shadow: none; gap: 4px; aspect-ratio: auto; border-radius: 8px; }
    .category-card.active { border: none; background: transparent; transform: scale(1.05); box-shadow: none; }
    .category-card span { font-size: 0.65rem; text-align: center; color: var(--text-secondary); }
    .category-card.active span { color: var(--primary); }
    .cat-icon { width: 100%; height: auto; font-size: 1.6rem; }
    .category-card:hover { transform: none; box-shadow: none; border: none; background: transparent; }
    .category-card:hover .cat-icon { transform: none; }
    
    .page-header { margin-bottom: 16px; padding: 0; border-radius: 12px; }
    .header-three-cols { 
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        transform: none !important;
    }

    /* Tanggal seukuran jam */
    .header-date { font-size: 0.75rem; font-weight: 600; }

    /* Nama pengguna (h1) lebih besar dari motivasi */
    .mobile-user-name { font-size: 1.25rem !important; font-weight: 700 !important; line-height: 1.2 !important; }
    .motivasi-text { font-size: 0.72rem !important; color: #ccff00; font-weight: 500; margin-top: 2px; letter-spacing: 0.4px; font-style: normal !important; }

    .real-time-clock { font-size: 0.75rem; padding: 4px 8px; gap: 3px; border-radius: 6px; }
    .real-time-clock svg { width: 12px; height: 12px; }

    /* Login on mobile */
    .login-page { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .login-form-area { padding: 40px 24px; }

    /* Mobile Header EGOVERN Style */
    .top-nav { background: linear-gradient(135deg, var(--primary-hover), var(--primary)); border-bottom: none; }
    .top-nav svg { color: var(--success); }
    .top-nav .nav-logo-text { color: var(--success); }
    .nav-brand { flex-direction: row; align-items: center; gap: 10px; }
    .top-nav .btn-outline { border-color: rgba(150, 229, 22, 0.4); color: var(--success); }
    .top-nav .btn-ghost { color: var(--success); }
    
    .main-content { position: relative; }
    .main-content::before {
        content: "";
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 110px;
        background: linear-gradient(135deg, var(--primary-hover), var(--primary));
        border-bottom-left-radius: 36px;
        border-bottom-right-radius: 36px;
        z-index: 0;
    }
    .page-header { position: relative; z-index: 1; padding: 30px 16px !important; overflow: visible !important; margin-bottom: 24px !important; }
    .mobile-user-name { color: white !important; font-size: 1.8rem !important; margin-top: 4px; margin-bottom: 2px; line-height: 1.3 !important; }
    .motivasi-text { color: #ccff00 !important; font-size: 0.85rem !important; margin-bottom: 12px; }
    .header-date { color: rgba(255,255,255,0.9) !important; margin-bottom: 6px; }
    .real-time-clock { background: rgba(255,255,255,0.15) !important; border: none !important; color: #ccff00 !important; margin-top: 4px; }
    .mobile-search-box { margin-top: 15px; }

    /* Mobile bottom nav — ikon menyala hijau saat hover & aktif */
    .mobile-nav-item { color: #94a3b8; transition: all 0.2s; }
    .mobile-nav-item svg { stroke: currentColor; transition: stroke 0.2s, filter 0.2s; }
    .mobile-nav-item:hover { color: #4ade80; }
    .mobile-nav-item:hover svg { filter: drop-shadow(0 0 6px rgba(74,222,128,0.7)); }
    .mobile-nav-item.active { color: #4ade80; }
    .mobile-nav-item.active svg { filter: drop-shadow(0 0 8px rgba(74,222,128,0.8)); }

    /* Public hero on mobile */
    .public-hero { padding: 60px 24px 80px; }
}

@media (min-width: 769px) {
    .mobile-nav { display: none; }
}

/* ── Loading Spinner ── */
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Search Highlight ── */
.highlight { background: #fef08a; border-radius: 3px; padding: 0 2px; font-weight: 600; }

/* ── Custom Categories ── */
.custom-category-badge { background: #e0f2fe; color: #0284c7; }

/* ── Emoji Picker ── */
.emoji-item {
    font-size: 1.5rem;
    padding: 6px;
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}
.emoji-item:hover {
    transform: scale(1.1);
    background: var(--bg);
}
.emoji-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.1);
}
.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.emoji-item {
    font-size: 1.5rem;
    text-align: center;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    user-select: none;
}
.emoji-item:hover { background: #e2e8f0; transform: scale(1.1); }
.emoji-item.selected { background: var(--primary-light); border: 2px solid var(--primary); }


.sidebar-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.sidebar-item-header button {
    font-size: 0.8rem;
    color: var(--primary);
    background: transparent;
    border: none;
    font-weight: 600;
    cursor: pointer;
}
.sidebar-item-header button:hover { text-decoration: underline; }

/* ── Auth Tabs ── */
.auth-tabs { display: flex; gap: 10px; margin: 15px 0 25px; background: var(--bg); padding: 6px; border-radius: var(--radius-md); }
.auth-tab { flex: 1; padding: 12px; font-weight: 600; font-size: 1rem; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm); transition: all 0.2s; }
.auth-tab:hover { color: var(--primary); }
.auth-tab.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }

/* ── Emoji Picker ── */
.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    margin-top: 8px;
}
.emoji-btn {
    font-size: 1.3rem;
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    line-height: 1;
}
.emoji-btn:hover { background: var(--primary-light, #e8f5e9); border-color: var(--primary); transform: scale(1.15); }
.emoji-btn.selected { border-color: var(--primary); background: var(--primary-light, #e8f5e9); box-shadow: 0 0 0 2px var(--primary); }

/* ── Category Item (grid dashboard) ── */
.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px;
    border-radius: 10px;
    cursor: pointer;
    background: var(--surface);
    border: 1.5px solid var(--border);
    transition: all 0.15s;
    text-align: center;
}
.category-item:hover { border-color: var(--primary); background: var(--primary-light, #e8f5e9); transform: translateY(-2px); }
.category-item .category-icon { font-size: 1.5rem; }
.category-item span { font-size: 0.7rem; color: var(--text-secondary); font-weight: 600; line-height: 1.2; }

/* ── Privacy Mini Toggle ── */
.privacy-mini {
    display: flex;
    gap: 8px;
}
.privacy-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.privacy-mini-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.privacy-mini-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* ── Privacy Status Group (tengah + box) ── */
.privacy-status-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.privacy-status-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.privacy-mini-centered {
    justify-content: center;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 6px;
    gap: 6px;
    display: inline-flex;
}
.privacy-mini-centered .privacy-mini-btn {
    border: none;
    background: transparent;
}
.privacy-mini-centered .privacy-mini-btn.selected {
    background: var(--primary);
    color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ── Tombol Hapus Link (1-klik) ── */
.btn-delete-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.btn-delete-link:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

/* ── Tombol Hapus Kategori di Sidebar ── */
.sidebar-del-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
}
.sidebar-item:hover .sidebar-del-btn {
    opacity: 1;
}
.sidebar-del-btn:hover {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
}



