/* ==========================================
   1. PALET WARNA & GLOBAL RESET
   ========================================== */
:root {
    --primary: #4a90e2;      /* Biru Sekolah Modern */
    --primary-hover: #357abd;
    --bg-dark: #333333;
    --bg-light: #F8F8F8;
    --text-dark: #2F2E41;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
}

a { 
    text-decoration: none; 
    color: var(--primary); 
    transition: color 0.3s; 
}

ul { 
    list-style: none; 
}

/* ==========================================
   2. HEADER & NAVBAR (TATA LETAK DAN UKURAN)
   ========================================== */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-wrapper img {
    width: 55px;
    height: auto;
}

.logo h1 {
    font-size: 1.2rem;
    margin-left: 5px;
}

/* Kanan: Navigasi Menu */
nav {
    order: 2; /* Menu berada di sebelah logo menuju kanan */
    margin-left: auto; /* Mendorong menu dan tombol ke ujung kanan */
}

nav ul {
    display: flex;
    align-items: center;
    gap: 20px; /* Jarak antar list menu lebih pendek */
    list-style: none;
}

nav ul li {
    position: relative; 
}

nav ul li a {
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
    transition: color 0.3s;
    padding: 10px 0;
}

nav ul li a:hover {
    color: var(--primary); 
}

/* Kanan Ujung: Kontainer Autentikasi (Tombol Login) */
.auth-container {
    order: 3;
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.btn-login {
    background-color: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(74, 144, 226, 0.3);
}

.btn-login:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Hamburger Menu untuk Mobile */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    order: 4; 
    margin-left: 15px;
    color: var(--text-dark);
}

/* ==========================================
   3. DROP-DOWN MENU SYSTEM
   ========================================== */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border-radius: 6px;
    padding: 10px 0;
    min-width: 160px;
    z-index: 1100;
    margin-top: 5px;
    border-top: 3px solid var(--primary);
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu li a {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    display: block;
}

.dropdown-menu li a:hover {
    background-color: #f5f9ff;
    color: var(--primary);
}

nav ul li:hover .dropdown-menu,
nav ul li.show-dropdown .dropdown-menu {
    display: block;
}

/* ==========================================
   4. HERO SECTION (BACKGROUND FULL & RESPONSIVE)
   ========================================== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh; /* Full satu layar monitor */
    min-height: 600px;
    margin-top: 55px; /* Mengimbangi posisi fixed navbar yang menipis */
    color: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('img/beranda.jpeg') no-repeat center center/cover; 
    z-index: -2;
}

.hero-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55); /* Lapisan gelap agar teks putih kontras dan terbaca */
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    width: 100%;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3em;
    margin-bottom: 10px;
    line-height: 1.2;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

.hero p {
    font-size: 2.1em!important;
    margin-bottom: 30px!important;
    width: 70vw!important;               /* Menggunakan 90% dari lebar layar */
    max-width: 1200px!important;
    margin: 180px auto 30px auto!important;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ==========================================
   HERO SLIDER (Beranda - dinamis dari admin)
   ========================================== */
.hero-slider {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    margin-top: 55px;
    color: white;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease;
    z-index: 0;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.hero-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 0;
}

.hero-slide-content {
    position: relative;
    z-index: 1;
    max-width: 850px;
    width: 100%;
    padding: 0 20px;
}

.hero-slide-content h1 {
    font-size: 2.6em;
    margin-bottom: 16px;
    line-height: 1.2;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

.hero-slide-content p {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.6;
    text-shadow: 0 4px 12px rgba(0,0,0,0.6);
    margin: 0 auto;
}

.hero-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.hero-slider-arrow:hover {
    background: rgba(255,255,255,0.3);
}

.hero-slider-arrow.prev { left: 24px; }
.hero-slider-arrow.next { right: 24px; }

.hero-slider-dots {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 10px;
}

.hero-slider-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.hero-slider-dot.active {
    background: #fff;
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .hero-slide-content h1 { font-size: 1.6em; }
    .hero-slide-content p { font-size: 1.1rem; }
    .hero-slider-arrow { width: 38px; height: 38px; font-size: 0.95rem; }
    .hero-slider-arrow.prev { left: 12px; }
    .hero-slider-arrow.next { right: 12px; }
}

/* Buttons inside Hero */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: capitalize;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
    color: white;
}
.btn-secondary:hover {
    background: white;
    color: var(--primary);
}

/* ==========================================
   5. PRODUCT SECTION & FILTERS
   ========================================== */
.product-section {
    padding: 80px 0;
    background-color: var(--bg-light); 
}

.product-section .section-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 40px;
}

.filter-status-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-reset-filter {
    background-color: #f0f4f8;
    color: var(--primary);
    border: 1px dashed var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    display: none;
    transition: all 0.3s;
}

.btn-reset-filter:hover {
    background-color: var(--primary);
    color: #fff;
    border-style: solid;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    justify-content: center;
}

.product-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.product-card.hide-card {
    display: none !important;
}

.product-image-placeholder {
    height: 180px;
    background: #f0f0f0;
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
}

.product-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================
   6. MODAL LOGIN (TAB SYSTEM)
   ========================================== */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.login-modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
}

.close-modal:hover { color: #333; }

.login-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #aaa;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    margin-bottom: -2px;
}

.form-content { display: none; }
.form-content.active { display: block; }

.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
}
.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.form-group input:focus {
    border-color: var(--primary);
    outline: none;
}

.btn-submit-login {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
}
.btn-submit-login:hover { background-color: var(--primary-hover); }
.btn-submit-admin { background-color: #333; }
.btn-submit-admin:hover { background-color: #111; }

/* ==========================================
   7. MOBILE RESPONSIVE (MEDIA QUERIES)
   ========================================== */
@media (max-width: 768px) {
    header .container {
        justify-content: space-between;
        flex-wrap: wrap;
    }
    nav {
        order: 4;
        margin-left: 0;
        width: 100%;
    }
    .logo {
        order: 1;
    }
    .auth-container {
        order: 2;
        margin-left: auto;
    }
    .menu-toggle {
        display: block;
        order: 3;
    }
    
    /* Menu vertikal saat mobile aktif */
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 15px 0;
        border-top: 1px solid #eee;
        box-shadow: 0 4px 5px rgba(0,0,0,0.05);
        gap: 10px;
    }
    nav ul.active {
        display: flex;
    }
    nav ul li {
        text-align: center;
        width: 100%;
    }
    nav ul li a {
        justify-content: center;
        padding: 10px 0;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background-color: #f9f9f9;
        width: 100%;
    }
    .dropdown-menu li a {
        text-align: center;
    }
    
    .hero h1 { font-size: 1.6em; }
    .hero-buttons { flex-direction: column; gap: 10px; }
} /* CLOSE @media (max-width: 768px) */

/* Mobile kecil */
@media (max-width: 480px) {
    .container {
        width: 92%;
    }

    /* Header */
    header .container {
        padding: 10px 15px;
    }

    .logo-wrapper {
        gap: 5px;
    }

    .logo-wrapper img {
        width: 35px;
        height: auto;
    }

    .logo h1 {
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .btn-login {
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    .menu-toggle {
        font-size: 1.3rem;
    }

    /* Hero */
    .hero {
        min-height: 500px;
        padding: 20px;
    }

    .hero h1 {
        font-size: 1.7em;
        line-height: 1.3;
    }

    .hero p {
        font-size: 0.9em;
        margin-bottom: 20px;
    }

    .hero-buttons {
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    /* Product Section */
    .product-section {
        padding: 50px 0;
    }

    .product-section .section-title {
        font-size: 1.8em;
        margin-bottom: 25px;
    }

    /* Filter */
    .filter-status-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Grid jadi 1 kolom */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-card {
        padding: 15px;
    }

    .product-image-placeholder {
        height: 200px;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .tab-btn {
        font-size: 0.85rem;
    }

    .form-group input {
        padding: 12px;
    }
}
.video-card video {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
/* Footer baru */
.footer {
    background: linear-gradient(to right, #1c1f26, #111827);
    color: white;
    text-align: center;
    padding: 18px 0;
    font-size: 18px;
    width: 100%;
    margin-top: 40px;
}

/* Supaya footer nempel bawah */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main, .main-content, section:not(.hero):not(.product-section):not(#ekskul) {
    flex: 1;
}

.product-section {
    flex: 1 0 auto;
}

/* Close media query max-width: 480px - Removed broken brace */

/* ==========================================
   8. USER PROFILE DROPDOWN (ADMIN / SISWA)
   ========================================== */
.user-profile {
    position: relative;
}

.user-profile .dropdown-menu {
    right: 0;
    left: auto;
    min-width: 200px;
}

.user-profile:hover .dropdown-menu,
.user-profile.show-dropdown .dropdown-menu {
    display: block;
}

/* ==========================================
   9. FOOTER RESPONSIVE
   ========================================== */
@media (max-width: 992px) {
    footer .container > div:first-of-type {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 600px) {
    footer .container > div:first-of-type {
        grid-template-columns: 1fr !important;
    }
    footer .container > div:last-child {
        flex-direction: column !important;
        text-align: center;
    }
    #ekskul > .container > div {
        grid-template-columns: 1fr !important;
    }
}