/* 1. VARIABLE & RESET */
:root {
    --primary: #003066;
    --accent: #ffc107;
    --success: #28a745;
    --dark-bg: #0f172a;
    --light-bg: #f8f9fa;
    --text-main: #334155;
    --text-muted: #64748b;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; /* Mencegah horizontal scroll */
}

/* 2. HEADER & NAVIGATION */
.navbar-custom {
    background-color: var(--primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent);
}

/* Nav Link Desktop */
#nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link-custom {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
    transition: var(--transition);
}

.nav-link-custom::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transition: var(--transition);
}

.nav-link-custom:hover::after {
    width: 100%;
}

.nav-link-custom:hover {
    color: var(--accent) !important;
}

.btn-admin-nav {
    background-color: var(--accent);
    color: var(--primary) !important;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-admin-nav:hover {
    background-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.menu-close {
    display: none;
}

/* 3. HERO SECTION */
.hero-portal {
    background: linear-gradient(rgba(0, 48, 102, 0.8), rgba(0, 48, 102, 0.85)), 
                url('../img/hero-desa.jpg') no-repeat center center;
    background-size: cover;
    padding: 120px 0;
    color: white;
    text-align: center;
    border-bottom: 6px solid var(--accent);
}

.hero-portal h1 {
    font-size: clamp(2rem, 5vw, 3.5rem); /* Responsive font size */
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

/* 4. CARDS & STATS */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
    text-align: center;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 5. FOOTER */
.site-footer {
    background-color: var(--dark-bg);
    color: var(--text-muted);
    padding: 80px 0 0;
    margin-top: auto;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* 6. RESPONSIVE MEDIA QUERIES */

/* Tablet & Mobile Navigation */
@media (max-width: 991px) {
    .menu-toggle {
        display: block;
    }

    #nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        padding: 100px 40px;
        transition: 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        z-index: 9999;
        box-shadow: -10px 0 30px rgba(0,0,0,0.2);
    }

    #nav-menu.active {
        right: 0;
    }

    .menu-close {
        display: block;
        position: absolute;
        top: 25px;
        right: 25px;
        background: none;
        border: none;
        font-size: 1.8rem;
        color: var(--primary);
    }

    .nav-link-custom {
        color: var(--primary);
        font-size: 1.2rem;
        width: 100%;
        border-bottom: 1px solid #f1f5f9;
        padding: 15px 0;
    }

    .nav-link-custom::after { display: none; }

    .btn-admin-nav {
        margin-top: 20px;
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.6);
        display: none;
        z-index: 9998;
        
    }
}


/* Mobile Small Adjustments */
@media (max-width: 768px) {
    .hero-portal {
        padding: 80px 20px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-column h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .card-container {
        padding: 2rem 1rem;
    }
}