/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-base:    #0a0a0f;
    --bg-card:    #12121a;
    --bg-card2:   #1a1a26;
    --border:     rgba(255,255,255,0.08);
    --border-h:   rgba(168,85,247,0.4);
    --purple:     #a855f7;
    --cyan:       #06b6d4;
    --pink:       #ec4899;
    --green:      #22c55e;
    --yellow:     #eab308;
    --text-1:     #f1f5f9;
    --text-2:     #94a3b8;
    --text-3:     #64748b;
    --radius:     16px;
    --radius-sm:  10px;
    --shadow:     0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg:  0 8px 48px rgba(0,0,0,0.6);
    --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-base);
    color: var(--text-1);
    line-height: 1.6;
    overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

a { text-decoration: none; color: inherit; }

img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10,10,15,0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.site-header.scrolled { background: rgba(10,10,15,0.95); }
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 68px; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main { font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--text-1); }
.logo-ai { background: linear-gradient(135deg, var(--purple), var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-sub { font-size: 0.65rem; color: var(--text-3); font-weight: 500; }
.header-nav { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 8px 16px; color: var(--text-2); font-weight: 500; font-size: 0.9rem; border-radius: 8px; transition: var(--transition); }
.nav-link:hover { color: var(--text-1); background: rgba(255,255,255,0.06); }
.btn-donate {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: 10px; font-weight: 600; font-size: 0.875rem;
    background: linear-gradient(135deg, #be185d, #9333ea);
    color: white; transition: var(--transition);
    box-shadow: 0 0 20px rgba(168,85,247,0.3);
}
.btn-donate:hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(168,85,247,0.5); }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-2); border-radius: 2px; transition: var(--transition); }
.mobile-nav {
    display: none; flex-direction: column; gap: 4px;
    padding: 12px 20px 16px; border-top: 1px solid var(--border);
    background: rgba(10,10,15,0.98);
}
.mobile-nav a { padding: 10px 12px; color: var(--text-2); font-weight: 500; border-radius: 8px; }
.mobile-nav a:hover { color: var(--text-1); background: rgba(255,255,255,0.06); }
.mobile-donate { color: var(--pink) !important; }
.mobile-nav.open { display: flex; }

/* ===== HERO ===== */
.hero {
    position: relative; min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding-top: 68px;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-orb {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.15; animation: float 8s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: var(--purple); top: -100px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: var(--cyan); bottom: -50px; right: -50px; animation-delay: 3s; }
.orb-3 { width: 300px; height: 300px; background: var(--pink); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: 6s; }
.hero-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
@keyframes float { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-30px) scale(1.05); } }

.hero-content { position: relative; z-index: 1; text-align: center; max-width: 760px; padding: 60px 20px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 18px; border-radius: 100px; font-size: 0.85rem; font-weight: 600;
    background: rgba(168,85,247,0.15); border: 1px solid rgba(168,85,247,0.3);
    color: #c084fc; margin-bottom: 28px;
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800; line-height: 1.1; margin-bottom: 20px; color: var(--text-1);
}
.gradient-text {
    background: linear-gradient(135deg, var(--purple) 0%, var(--cyan) 50%, var(--pink) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-desc { font-size: 1.1rem; color: var(--text-2); max-width: 560px; margin: 0 auto 36px; line-height: 1.7; }

.search-form { width: 100%; max-width: 560px; margin: 0 auto; }
.search-box {
    display: flex; align-items: center; gap: 0;
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: 14px; padding: 6px 6px 6px 16px;
    transition: var(--transition);
}
.search-box:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(168,85,247,0.15); }
.search-icon { color: var(--text-3); flex-shrink: 0; }
.search-input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-1); font-size: 0.95rem; padding: 8px 12px;
    font-family: inherit;
}
.search-input::placeholder { color: var(--text-3); }
.search-btn {
    padding: 10px 22px; border-radius: 10px; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    color: white; font-weight: 600; font-size: 0.9rem; font-family: inherit;
    transition: var(--transition); white-space: nowrap;
}
.search-btn:hover { opacity: 0.9; transform: scale(0.98); }

.hero-stats { display: flex; align-items: center; justify-content: center; gap: 32px; margin-top: 48px; }
.stat-item { text-align: center; }
.stat-num { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; font-weight: 700; color: var(--text-1); }
.stat-label { font-size: 0.8rem; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

.hero-scroll { position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%); z-index: 1; }
.scroll-indicator {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; color: var(--text-3);
    animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ===== APPS SECTION ===== */
.apps-section { padding: 80px 0; }

.filter-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 32px; flex-wrap: wrap;
}
.filter-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pill {
    padding: 7px 16px; border-radius: 100px; font-size: 0.85rem; font-weight: 600;
    background: var(--bg-card2); border: 1px solid var(--border);
    color: var(--text-2); transition: var(--transition); cursor: pointer;
}
.cat-pill:hover { border-color: var(--purple); color: var(--purple); }
.cat-pill.active { background: rgba(168,85,247,0.15); border-color: var(--purple); color: var(--purple); }

.view-toggle { display: flex; gap: 4px; background: var(--bg-card2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.view-btn {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    border-radius: 7px; color: var(--text-3); transition: var(--transition);
}
.view-btn:hover { color: var(--text-1); background: rgba(255,255,255,0.06); }
.view-btn.active { background: rgba(168,85,247,0.2); color: var(--purple); }

.result-info { margin-bottom: 24px; color: var(--text-2); font-size: 0.9rem; }
.result-info strong { color: var(--text-1); }
.result-info em { color: var(--purple); font-style: normal; }
.result-info a { color: var(--cyan); }
.no-result-text { color: var(--text-3); }

/* ===== GRID VIEW ===== */
.apps-container.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* ===== LIST VIEW ===== */
.apps-container.view-list { display: flex; flex-direction: column; gap: 16px; }
.apps-container.view-list .app-card { display: flex; flex-direction: row; }
.apps-container.view-list .card-image-wrap { width: 200px; flex-shrink: 0; }
.apps-container.view-list .card-image { height: 140px; }
.apps-container.view-list .card-body { flex: 1; }
.apps-container.view-list .card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== DETAIL VIEW ===== */
.apps-container.view-detail {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 28px;
}
.apps-container.view-detail .card-image { height: 220px; }
.apps-container.view-detail .card-desc { display: block; -webkit-line-clamp: unset; }

/* ===== APP CARD ===== */
.app-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: var(--transition); cursor: default;
}
.app-card:hover {
    border-color: var(--border-h);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(168,85,247,0.15);
}

.card-image-wrap { position: relative; overflow: hidden; }
.card-image {
    width: 100%; height: 180px; object-fit: cover;
    transition: transform 0.4s ease;
}
.app-card:hover .card-image { transform: scale(1.04); }

.featured-badge {
    position: absolute; top: 10px; left: 10px;
    padding: 4px 10px; border-radius: 100px; font-size: 0.72rem; font-weight: 700;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white; letter-spacing: 0.02em;
}
.zoom-btn {
    position: absolute; top: 10px; right: 10px;
    width: 30px; height: 30px; border-radius: 8px; border: none; cursor: pointer;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(8px);
    color: white; display: flex; align-items: center; justify-content: center;
    opacity: 0.6; transition: var(--transition);
}
.app-card:hover .zoom-btn { opacity: 1; }
.zoom-btn:hover { background: rgba(168,85,247,0.7); transform: scale(1.1); }

.card-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; }
.cat-tag {
    padding: 3px 10px; border-radius: 100px; font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.cat-game    { background: rgba(168,85,247,0.15); color: #c084fc; }
.cat-health  { background: rgba(34,197,94,0.15);  color: #4ade80; }
.cat-fun     { background: rgba(236,72,153,0.15);  color: #f472b6; }
.cat-edu     { background: rgba(6,182,212,0.15);   color: #22d3ee; }
.cat-tools   { background: rgba(234,179,8,0.15);   color: #facc15; }
.cat-other   { background: rgba(148,163,184,0.1);  color: #94a3b8; }
.card-date { font-size: 0.75rem; color: var(--text-3); }

.card-title { font-size: 1.05rem; font-weight: 700; color: var(--text-1); line-height: 1.3; }
.card-desc {
    font-size: 0.875rem; color: var(--text-2); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.card-author { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-3); }
.author-avatar {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; color: white;
}
.btn-demo {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 14px; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
    background: rgba(6,182,212,0.15); border: 1px solid rgba(6,182,212,0.3);
    color: var(--cyan); transition: var(--transition);
}
.btn-demo:hover { background: rgba(6,182,212,0.25); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.4rem; color: var(--text-1); margin-bottom: 8px; }
.empty-state p { color: var(--text-3); }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.page-btn {
    min-width: 40px; height: 40px; padding: 0 12px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: 0.9rem; font-weight: 600;
    background: var(--bg-card2); border: 1px solid var(--border);
    color: var(--text-2); transition: var(--transition);
}
.page-btn:hover { border-color: var(--purple); color: var(--purple); }
.page-btn.active { background: rgba(168,85,247,0.2); border-color: var(--purple); color: var(--purple); }

/* ===== ABOUT SECTION ===== */
.about-section { padding: 80px 0; background: linear-gradient(180deg, transparent, rgba(168,85,247,0.03), transparent); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.section-badge {
    display: inline-block; padding: 6px 14px; border-radius: 100px; font-size: 0.8rem; font-weight: 600;
    background: rgba(168,85,247,0.15); border: 1px solid rgba(168,85,247,0.3);
    color: #c084fc; margin-bottom: 16px;
}
.section-title { font-family: 'Space Grotesk', sans-serif; font-size: 2.2rem; font-weight: 800; line-height: 1.2; margin-bottom: 20px; }
.about-text p { color: var(--text-2); margin-bottom: 16px; line-height: 1.7; }
.about-text strong { color: var(--text-1); }
.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 12px; font-weight: 700; font-size: 0.95rem;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    color: white; transition: var(--transition); margin-top: 8px;
    box-shadow: 0 4px 20px rgba(168,85,247,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(168,85,247,0.4); }

.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.about-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; transition: var(--transition);
}
.about-card:hover { border-color: var(--border-h); transform: translateY(-2px); }
.about-card-icon { font-size: 2rem; margin-bottom: 12px; }
.about-card h4 { font-size: 1rem; font-weight: 700; color: var(--text-1); margin-bottom: 6px; }
.about-card p { font-size: 0.85rem; color: var(--text-3); line-height: 1.5; }

/* ===== FOOTER ===== */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-logo { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1rem; color: var(--text-2); }
.footer-credit { font-size: 0.85rem; color: var(--text-3); }

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.9); backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-inner { position: relative; max-width: 90vw; max-height: 90vh; }
.lightbox-close {
    position: absolute; top: -44px; right: 0;
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-2); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.lightbox-close:hover { background: var(--bg-card2); color: var(--text-1); }
.lightbox-img { max-width: 90vw; max-height: 80vh; border-radius: var(--radius); object-fit: contain; }
.lightbox-caption { text-align: center; color: var(--text-2); font-size: 0.9rem; margin-top: 12px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .hamburger { display: flex; }
    .hero-stats { gap: 20px; }
    .stat-num { font-size: 1.4rem; }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .about-cards { grid-template-columns: 1fr 1fr; }
    .apps-container.view-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .apps-container.view-list .app-card { flex-direction: column; }
    .apps-container.view-list .card-image-wrap { width: 100%; }
    .apps-container.view-detail { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: flex-start; }
    .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .hero-title { font-size: 2rem; }
    .about-cards { grid-template-columns: 1fr; }
    .apps-container.view-grid { grid-template-columns: 1fr; }
    .hero-stats { flex-direction: column; gap: 16px; }
    .stat-divider { width: 40px; height: 1px; }
}

/* ===== ADMIN STYLES ===== */
.admin-body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-base); color: var(--text-1);
    min-height: 100vh;
}
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
    width: 260px; flex-shrink: 0;
    background: var(--bg-card); border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    transition: transform 0.3s ease;
}
.sidebar-header { padding: 24px 20px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px; font-size: 0.9rem; font-weight: 500;
    color: var(--text-2); transition: var(--transition);
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: var(--text-1); }
.sidebar-link.active { background: rgba(168,85,247,0.15); color: var(--purple); }
.sidebar-link svg { flex-shrink: 0; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); }
.sidebar-logout {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 10px; font-size: 0.875rem; font-weight: 500;
    color: var(--text-3); transition: var(--transition); width: 100%; background: none; border: none; cursor: pointer;
}
.sidebar-logout:hover { background: rgba(239,68,68,0.1); color: #f87171; }

/* Admin Main */
.admin-main { margin-left: 260px; flex: 1; display: flex; flex-direction: column; }
.admin-topbar {
    height: 64px; background: var(--bg-card); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; position: sticky; top: 0; z-index: 40;
}
.admin-topbar h1 { font-size: 1.1rem; font-weight: 700; }
.admin-content { padding: 28px; flex: 1; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 16px;
}
.stat-card-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0;
}
.stat-card-num { font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-card-label { font-size: 0.8rem; color: var(--text-3); margin-top: 4px; }

/* Table */
.admin-table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.table-header h2 { font-size: 1rem; font-weight: 700; }
.btn-add {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: 10px; font-size: 0.875rem; font-weight: 600;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    color: white; border: none; cursor: pointer; transition: var(--transition); font-family: inherit;
}
.btn-add:hover { opacity: 0.9; transform: scale(0.98); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 12px 16px; text-align: left; font-size: 0.78rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 0.875rem; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.table-thumb { width: 56px; height: 40px; border-radius: 6px; object-fit: cover; }
.table-actions { display: flex; gap: 6px; }
.btn-edit, .btn-del {
    padding: 6px 12px; border-radius: 7px; font-size: 0.78rem; font-weight: 600;
    border: none; cursor: pointer; transition: var(--transition); font-family: inherit;
}
.btn-edit { background: rgba(6,182,212,0.15); color: var(--cyan); }
.btn-edit:hover { background: rgba(6,182,212,0.25); }
.btn-del { background: rgba(239,68,68,0.15); color: #f87171; }
.btn-del:hover { background: rgba(239,68,68,0.25); }

/* Modal / Form */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); width: 100%; max-width: 560px;
    max-height: 90vh; overflow-y: auto; padding: 28px;
    transform: translateY(20px); transition: transform 0.3s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 24px; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 11px 14px; border-radius: 10px;
    background: var(--bg-base); border: 1px solid var(--border);
    color: var(--text-1); font-size: 0.9rem; font-family: inherit;
    transition: var(--transition); outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(168,85,247,0.1); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select option { background: var(--bg-card); }
.form-check { display: flex; align-items: center; gap: 10px; }
.form-check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--purple); cursor: pointer; }
.form-check label { font-size: 0.875rem; color: var(--text-2); cursor: pointer; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.btn-cancel {
    padding: 10px 20px; border-radius: 10px; font-size: 0.875rem; font-weight: 600;
    background: var(--bg-card2); border: 1px solid var(--border);
    color: var(--text-2); cursor: pointer; transition: var(--transition); font-family: inherit;
}
.btn-cancel:hover { color: var(--text-1); }
.btn-save {
    padding: 10px 24px; border-radius: 10px; font-size: 0.875rem; font-weight: 600;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    color: white; border: none; cursor: pointer; transition: var(--transition); font-family: inherit;
}
.btn-save:hover { opacity: 0.9; }

/* Alert */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.875rem; font-weight: 500; margin-bottom: 20px; }
.alert-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #4ade80; }
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }

/* Login Page */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--bg-base); position: relative; overflow: hidden;
}
.login-bg { position: absolute; inset: 0; }
.login-bg .hero-orb { opacity: 0.1; }
.login-card {
    position: relative; z-index: 1;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 20px; padding: 40px; width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--text-3); font-size: 0.875rem; margin-bottom: 28px; }
.btn-login {
    width: 100%; padding: 13px; border-radius: 12px; font-size: 1rem; font-weight: 700;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    color: white; border: none; cursor: pointer; transition: var(--transition); font-family: inherit;
    box-shadow: 0 4px 20px rgba(168,85,247,0.3);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(168,85,247,0.4); }

/* Image preview */
.img-preview { margin-top: 10px; border-radius: 8px; overflow: hidden; max-height: 160px; }
.img-preview img { width: 100%; height: 160px; object-fit: cover; }

@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-topbar { padding: 0 16px; }
    .admin-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== THEMES ===== */

/* GELAP (default) */
[data-theme="gelap"] {
    --bg-base:  #0a0a0f;
    --bg-card:  #12121a;
    --bg-card2: #1a1a26;
    --border:   rgba(255,255,255,0.08);
    --text-1:   #f1f5f9;
    --text-2:   #94a3b8;
    --text-3:   #64748b;
    --purple:   #a855f7;
    --cyan:     #06b6d4;
}

/* TERANG */
[data-theme="terang"] {
    --bg-base:  #f8fafc;
    --bg-card:  #ffffff;
    --bg-card2: #f1f5f9;
    --border:   rgba(0,0,0,0.1);
    --border-h: rgba(99,102,241,0.4);
    --text-1:   #0f172a;
    --text-2:   #475569;
    --text-3:   #94a3b8;
    --purple:   #6366f1;
    --cyan:     #0891b2;
    --pink:     #db2777;
}
[data-theme="terang"] .hero-orb { opacity: 0.08; }
[data-theme="terang"] .hero-grid { background-image: linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px); }
[data-theme="terang"] .site-header { background: rgba(248,250,252,0.85); border-bottom-color: rgba(0,0,0,0.08); }
[data-theme="terang"] .site-header.scrolled { background: rgba(248,250,252,0.97); }
[data-theme="terang"] .app-card { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
[data-theme="terang"] .app-card:hover { box-shadow: 0 8px 30px rgba(99,102,241,0.15); }

/* DISCO */
[data-theme="disco"] {
    --bg-base:  #0d0015;
    --bg-card:  #150020;
    --bg-card2: #1e0030;
    --border:   rgba(255,0,255,0.15);
    --border-h: rgba(255,0,255,0.5);
    --text-1:   #fff0ff;
    --text-2:   #d8b4fe;
    --text-3:   #a855f7;
    --purple:   #ff00ff;
    --cyan:     #00ffff;
    --pink:     #ff0080;
}
[data-theme="disco"] .hero-orb { opacity: 0.25; animation: discoFloat 3s ease-in-out infinite; }
[data-theme="disco"] .orb-1 { background: #ff00ff; }
[data-theme="disco"] .orb-2 { background: #00ffff; }
[data-theme="disco"] .orb-3 { background: #ff0080; }
[data-theme="disco"] .gradient-text { background: linear-gradient(135deg, #ff00ff, #00ffff, #ff0080, #ffff00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; background-size: 300%; animation: discoGrad 2s linear infinite; }
[data-theme="disco"] .app-card { border-color: rgba(255,0,255,0.2); }
[data-theme="disco"] .app-card:hover { box-shadow: 0 0 30px rgba(255,0,255,0.3), 0 0 60px rgba(0,255,255,0.1); }
[data-theme="disco"] .logo-ai { background: linear-gradient(135deg, #ff00ff, #00ffff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
@keyframes discoFloat { 0%,100% { transform: translateY(0) rotate(0deg); } 33% { transform: translateY(-20px) rotate(120deg); } 66% { transform: translateY(10px) rotate(240deg); } }
@keyframes discoGrad { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }

/* GURUN */
[data-theme="gurun"] {
    --bg-base:  #1a1208;
    --bg-card:  #241a0a;
    --bg-card2: #2e2210;
    --border:   rgba(210,160,60,0.2);
    --border-h: rgba(210,160,60,0.5);
    --text-1:   #fef3c7;
    --text-2:   #d97706;
    --text-3:   #92400e;
    --purple:   #f59e0b;
    --cyan:     #ef4444;
    --pink:     #dc2626;
}
[data-theme="gurun"] .hero-orb { opacity: 0.12; }
[data-theme="gurun"] .orb-1 { background: #f59e0b; }
[data-theme="gurun"] .orb-2 { background: #ef4444; }
[data-theme="gurun"] .orb-3 { background: #d97706; }
[data-theme="gurun"] .gradient-text { background: linear-gradient(135deg, #f59e0b, #ef4444, #fbbf24); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
[data-theme="gurun"] .btn-donate { background: linear-gradient(135deg, #d97706, #ef4444); }
[data-theme="gurun"] .cat-pill.active, [data-theme="gurun"] .view-btn.active { background: rgba(245,158,11,0.2); border-color: #f59e0b; color: #f59e0b; }

/* LAUT */
[data-theme="laut"] {
    --bg-base:  #020b18;
    --bg-card:  #041525;
    --bg-card2: #062035;
    --border:   rgba(0,150,255,0.15);
    --border-h: rgba(0,200,255,0.5);
    --text-1:   #e0f4ff;
    --text-2:   #7dd3fc;
    --text-3:   #0369a1;
    --purple:   #0ea5e9;
    --cyan:     #06b6d4;
    --pink:     #0284c7;
}
[data-theme="laut"] .hero-orb { opacity: 0.15; }
[data-theme="laut"] .orb-1 { background: #0ea5e9; }
[data-theme="laut"] .orb-2 { background: #06b6d4; }
[data-theme="laut"] .orb-3 { background: #0284c7; }
[data-theme="laut"] .gradient-text { background: linear-gradient(135deg, #0ea5e9, #06b6d4, #38bdf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
[data-theme="laut"] .app-card:hover { box-shadow: 0 8px 40px rgba(14,165,233,0.2); }
[data-theme="laut"] .btn-donate { background: linear-gradient(135deg, #0284c7, #06b6d4); }
[data-theme="laut"] .hero-grid { background-image: linear-gradient(rgba(14,165,233,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(14,165,233,0.05) 1px, transparent 1px); }

/* HUTAN */
[data-theme="hutan"] {
    --bg-base:  #050f08;
    --bg-card:  #0a1a0e;
    --bg-card2: #102516;
    --border:   rgba(34,197,94,0.15);
    --border-h: rgba(34,197,94,0.5);
    --text-1:   #dcfce7;
    --text-2:   #86efac;
    --text-3:   #166534;
    --purple:   #22c55e;
    --cyan:     #16a34a;
    --pink:     #15803d;
}
[data-theme="hutan"] .hero-orb { opacity: 0.12; }
[data-theme="hutan"] .orb-1 { background: #22c55e; }
[data-theme="hutan"] .orb-2 { background: #16a34a; }
[data-theme="hutan"] .orb-3 { background: #4ade80; }
[data-theme="hutan"] .gradient-text { background: linear-gradient(135deg, #22c55e, #4ade80, #86efac); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
[data-theme="hutan"] .app-card:hover { box-shadow: 0 8px 40px rgba(34,197,94,0.15); }
[data-theme="hutan"] .btn-donate { background: linear-gradient(135deg, #15803d, #22c55e); }
[data-theme="hutan"] .hero-grid { background-image: linear-gradient(rgba(34,197,94,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(34,197,94,0.04) 1px, transparent 1px); }

/* SALJU */
[data-theme="salju"] {
    --bg-base:  #f0f8ff;
    --bg-card:  #ffffff;
    --bg-card2: #e8f4fd;
    --border:   rgba(147,197,253,0.4);
    --border-h: rgba(59,130,246,0.5);
    --text-1:   #1e3a5f;
    --text-2:   #3b82f6;
    --text-3:   #93c5fd;
    --purple:   #3b82f6;
    --cyan:     #0ea5e9;
    --pink:     #6366f1;
}
[data-theme="salju"] .hero-orb { opacity: 0.15; }
[data-theme="salju"] .orb-1 { background: #bfdbfe; }
[data-theme="salju"] .orb-2 { background: #e0f2fe; }
[data-theme="salju"] .orb-3 { background: #dbeafe; }
[data-theme="salju"] .gradient-text { background: linear-gradient(135deg, #3b82f6, #0ea5e9, #6366f1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
[data-theme="salju"] .site-header { background: rgba(240,248,255,0.85); border-bottom-color: rgba(147,197,253,0.4); }
[data-theme="salju"] .site-header.scrolled { background: rgba(240,248,255,0.97); }
[data-theme="salju"] .app-card { box-shadow: 0 2px 16px rgba(59,130,246,0.08); }
[data-theme="salju"] .app-card:hover { box-shadow: 0 8px 30px rgba(59,130,246,0.2); }
[data-theme="salju"] .hero-grid { background-image: linear-gradient(rgba(59,130,246,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(59,130,246,0.06) 1px, transparent 1px); }
[data-theme="salju"] .btn-donate { background: linear-gradient(135deg, #3b82f6, #0ea5e9); }

/* Theme Switcher Button */
.theme-switcher { position: relative; }
.theme-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 10px; font-size: 0.875rem; font-weight: 600;
    background: var(--bg-card2); border: 1px solid var(--border);
    color: var(--text-2); cursor: pointer; transition: var(--transition);
    font-family: inherit; white-space: nowrap;
}
.theme-btn:hover { border-color: var(--purple); color: var(--text-1); }
.theme-dot-active {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    background: var(--purple); transition: background 0.3s;
}
.theme-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 6px; width: 160px;
    box-shadow: var(--shadow-lg); z-index: 200;
    opacity: 0; pointer-events: none; transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s;
}
.theme-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.theme-option {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 8px; cursor: pointer;
    font-size: 0.85rem; font-weight: 500; color: var(--text-2);
    transition: var(--transition); border: none; background: none;
    width: 100%; text-align: left; font-family: inherit;
}
.theme-option:hover { background: rgba(255,255,255,0.06); color: var(--text-1); }
.theme-option.active { background: rgba(168,85,247,0.12); color: var(--purple); font-weight: 600; }
.theme-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
