:root {
    --primary-dark: #002b5e;
    --primary-blue: #004e92;
    --accent-cyan: #00b4db;
    --text-light: #f8f9fa;
    --text-dark: #333;
    --bg-light: #f4f7f6;
    --white: #ffffff;
    --danger: #dc3545;
    --success: #28a745;
    --nav-height: 80px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: var(--bg-light); color: var(--text-dark); line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* CONTAINER */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* CONTAINER FULL WIDTH */
.full-container { 
    width: 100%; 
    max-width: 100%; 
    padding: 0 20px; 
    box-sizing: border-box; 
    margin: 0 auto;
}

/* Buttons */
.btn { display: inline-block; padding: 12px 30px; border-radius: 50px; border: none; cursor: pointer; font-weight: 600; text-transform: uppercase; }
.btn-primary { background: linear-gradient(135deg, var(--accent-cyan), var(--primary-blue)); color: white; }
.btn-outline { border: 2px solid white; color: white; background: transparent; }
.btn-danger { background: var(--danger); color: white; }

/* Header & Nav */
header { position: fixed; top: 0; width: 100%; height: var(--nav-height); background: rgba(0,43,94,0.95); z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 100%; width: 100%; padding: 0 20px; box-sizing: border-box; }
.logo { color: white; font-size: 1.8rem; font-weight: 700; }

/* HAMBURGER - Wajib Hilang */
.hamburger { display: none !important; }

/* --- MENU DESKTOP (SANGAT RAPAT) --- */
.nav-menu { 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    width: 100%; 
    flex-grow: 1; 
    gap: 5px; /* JARAK DIKECILKAN JADI 5PX */
    padding-right: 0;
}

.nav-link { 
    color: rgba(255,255,255,0.8); 
    font-weight: 500; 
    padding: 5px 8px; /* Padding teks diperkecil */
    border-bottom: 2px solid transparent; 
    font-size: 0.9rem;
}

.nav-link:hover { color: var(--accent-cyan); }

/* --- UKURAN TOMBOL DI MENU (DIPERKECIL AGAR TIDAK NAMBAH JARAK) --- */
.nav-menu .btn {
    padding: 5px 15px !important; 
    font-size: 0.8rem !important; 
    border-radius: 20px !important;
}

/* ACTIVE STATE DESKTOP */
.nav-link.active {
    color: var(--accent-cyan);
    font-weight: 700;
    border-bottom: 2px solid var(--accent-cyan);
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: 100%; left: 0; background: white; min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); opacity: 0; visibility: hidden; transition: 0.3s;
    border-radius: 4px; overflow: hidden;
}
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; top: 100%; }
.dropdown-item { display: block; padding: 10px 20px; color: var(--text-dark); }
.dropdown-item:hover { background: #f0f8ff; color: var(--primary-blue); }

/* Hero Section */
.hero-slider { height: 100vh; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; color: white; }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transition: 1s; }
.slide.active { opacity: 1; }
.hero-overlay { position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(0,20,40,0.7); z-index: 1; }
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 800px; padding: 20px; }
.hero-content h1 { font-size: 3rem; margin-bottom: 20px; text-transform: uppercase; }

/* Sections */
.section { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 50px; color: var(--primary-dark); text-transform: uppercase; }

/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 30px; }
.card { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: 0.3s; }
.card:hover { transform: translateY(-5px); }
.card-img { height: 200px; width: 100%; object-fit: cover; }
.card-body { padding: 20px; }
.card-title { font-size: 1.25rem; margin-bottom: 10px; color: var(--primary-dark); }
.price { color: var(--accent-cyan); font-weight: 700; font-size: 1.1rem; }

/* Member Dashboard */
.dashboard-layout { display: flex; min-height: 100vh; padding-top: var(--nav-height); }
.sidebar { width: 250px; background: white; padding: 20px; border-right: 1px solid #ddd; }
.main-content { flex: 1; padding: 30px; }
.cert-digital { border: 2px dashed var(--primary-blue); padding: 20px; border-radius: 10px; text-align: center; background: #f0f8ff; margin-bottom: 20px; }
.qr-code { margin: 15px auto; }

/* Admin Panel */
.admin-sidebar { background: #1a1a1a; color: white; width: 250px; min-height: 100vh; position: fixed; left: 0; top: var(--nav-height); }
.admin-main { margin-left: 250px; padding: 30px; }
.table { width: 100%; border-collapse: collapse; background: white; margin-top: 20px; }
.table th, .table td { padding: 12px; border-bottom: 1px solid #ddd; text-align: left; }
.table th { background: var(--primary-dark); color: white; }

/* Forms */
.form-group { margin-bottom: 15px; }
.form-control { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; }

/* Footer */
footer { background: #002b5e; color: white; padding: 60px 0 20px; width: 100%; margin-bottom: 70px; box-sizing: border-box; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { font-size: 1.2rem; margin-bottom: 20px; border-bottom: 2px solid #00b4db; display: inline-block; padding-bottom: 5px; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: #ccc; text-decoration: none; transition: 0.3s; }
.footer-col ul li a:hover { color: #00b4db; padding-left: 5px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 0.9rem; color: #aaa; }


/* --- LIVE CHAT WIDGET (GLOBAL) --- */
.chat-widget { position: fixed; bottom: 20px; right: 20px; z-index: 10000; font-family: 'Segoe UI', sans-serif; }
.chat-btn {
    width: 60px; height: 60px; background: #25D366; color: white; border-radius: 50%; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.3s; font-size: 28px; border: none;
}
.chat-btn:hover { transform: scale(1.1); }
.chat-btn:active { transform: scale(0.9); }

.chat-box {
    position: absolute; bottom: 80px; right: 0; width: 350px; height: 450px;
    background: white; border-radius: 12px; box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    display: none; flex-direction: column; overflow: hidden; border: 1px solid #ddd;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.chat-header {
    background: #075E54; color: white; padding: 15px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.chat-header h4 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.status-dot { width: 10px; height: 10px; background: #ccc; border-radius: 50%; display: inline-block; }
.status-dot.online { background: #25D366; box-shadow: 0 0 5px #25D366; }
.status-dot.ai { background: #FFD700; box-shadow: 0 0 5px #FFD700; } /* Kuning untuk AI */

.chat-body { flex: 1; padding: 15px; overflow-y: auto; background: #E5DDD5; background-size: contain; }
.message { margin-bottom: 10px; max-width: 80%; padding: 8px 12px; border-radius: 8px; font-size: 14px; line-height: 1.4; position: relative; clear: both; }
.message.bot { background: white; float: left; border-top-left-radius: 0; }
.message.user { background: #dcf8c6; float: right; border-top-right-radius: 0; }
.message-meta { font-size: 10px; color: #999; margin-top: 5px; text-align: right; display: block; }

.chat-footer { padding: 10px; border-top: 1px solid #ddd; display: flex; gap: 10px; background: white; }
.chat-input { flex: 1; border: 1px solid #ddd; border-radius: 20px; padding: 10px 15px; outline: none; }
.send-btn { background: #075E54; color: white; border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; transition: 0.2s; }
.send-btn:hover { background: #054c3b; }

/* Avatar Chat */
.avatar { width: 30px; height: 30px; border-radius: 50%; position: absolute; bottom: 0; }
.avatar.bot { left: -38px; background: white; padding: 2px; }
.avatar.user { right: -38px; background: #dcf8c6; padding: 2px; }
/* =========================================
   PERBAIKAN POSISI CHAT WIDGET (FIX SEJATI)
   ========================================= */
@media (max-width: 991px) {
    /* 
       Kita naikkan posisi menjadi 130px. 
       Tinggi Menu Navigasi = 70px. 
       130px - 60px (tinggi tombol) = 70px.
       Tombol akan tepat muncul di ATAS garis batas atas menu navigasi.
    */
    .chat-widget {
        bottom: 130px !important; 
        z-index: 99999 !important; /* Paling atas agar tidak tertutup */
    }
}


/* =========================================
   ADMIN LIVE CHAT (SESUAI DENGAN KODE PHP LIVE_CHAT.PHP)
   ========================================= */

/* 1. Container Utama (Menggunakan class chat-container sesuai kode PHP) */
.chat-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    height: 500px;
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    position: relative;
    z-index: 99999; /* Agar muncul paling depan */
}

/* 2. Header Chat */
.chat-header {
    padding: 15px;
    background: #075E54;
    color: white;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

/* 3. Area Pesan */
.chat-msg-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #E5DDD5; /* Background pola WA */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 4. Style Pesan Chat (Bubble Chat) */
.msg {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 14px;
    position: relative;
    clear: both;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 5. Style Pesan Admin (Hijau) */
.msg.admin { background: #dcf8c6; float: right; border: 2px solid #008069; border-bottom-right-radius: 0; color: #075E54; }

/* 6. Style Pesan User (Putih) */
.msg.user { background: white; float: left; border: 2px solid #25D366; border-bottom-left-radius: 0; color: #333; }

/* 7. Meta Pesan (Jam & Pengirim) */
.msg-meta {
    font-size: 10px;
    color: #999;
    margin-top: 5px;
    display: block;
    text-align: right;
}

/* 8. Area Input Balas Admin */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid #ddd;
    background: white;
    display: flex;
    gap: 10px;
    position: sticky; /* Menempel di bawah konten chat */
    bottom: 0;
    border-radius: 0 0 8px 8px; 
    z-index: 99999 !important; /* Pastikan selalu di atas layer lain */
}

.chat-input { 
    flex: 1; 
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    outline: none; 
}

.send-btn { 
    background: #075E54; 
    color: white; 
    border: none; 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    cursor: pointer; 
    transition: 0.2s; 
}

/* 9. Tabel History Chat (Sesuai kode PHP) */
.table { width: 100%; border-collapse: collapse; background: white; margin-top: 20px; }
.table th, .table td { padding: 15px; border-bottom: 1px solid #eee; text-align: left; }
.table th { background: #f8f9fa; color: #555; font-weight: 600; }

/* =========================================
   MOBILE RESPONSIVE & STICKY BOTTOM NAV
   ========================================= */

/* 1. Default: HILANGKAN MENU BAWAH (DESKTOP) */
.mobile-bottom-nav {
    display: none !important; /* Wajib Hilang */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    border-top: 1px solid #eee;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #888;
    font-size: 0.7rem; /* Font diperkecil agar muat di HP kecil */
    transition: 0.3s;
    flex: 1;
    height: 100%;
    position: relative;
}

.nav-item i { font-size: 1.2rem; margin-bottom: 4px; transition: 0.3s; }

/* ACTIVE STATE MOBILE */
.nav-item.active {
    color: var(--primary-blue);
    background: #f0f8ff;
}
.nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 0 0 4px 4px;
}

/* Dropup Menu (MEMPERBAIKI UKURAN) */
.dropup-content {
    display: none;
    position: absolute;
    bottom: 100%; 
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: white;
    min-width: 200px; /* Diperkecil dari 220px */
    max-width: 90%; /* Agar tidak melebihi batas layar HP */
    box-shadow: 0 -5px 20px rgba(0,0,0,0.15);
    border-radius: 12px 12px 0 0;
    z-index: 10000;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    padding-bottom: 10px;
}

.show-dropup {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dropup-content a {
    color: #333;
    padding: 12px 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.85rem; /* Font dropup diperkecil */
    border-bottom: 1px solid #f0f0f0;
    transition: 0.2s;
    white-space: nowrap; /* Mencegah teks turun baris */
}

.dropup-content a:last-child { border-bottom: none; }
.dropup-content a:hover {
    background-color: #f9f9f9;
    color: var(--primary-blue);
    padding-left: 25px;
}

.dropup-content a i {
    width: 25px;
    font-size: 0.9rem;
    margin-bottom: 0;
    margin-right: 10px;
    color: #888;
}
.dropup-content a:hover i { color: var(--primary-blue); }

.dropup-content::before {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    margin-left: -6px;
    width: 12px;
    height: 12px;
    background-color: white;
    transform: rotate(45deg);
    z-index: 10001;
    box-shadow: -2px -2px 5px rgba(0,0,0,0.1);
}

/* Media Query HP & TABLET (BREAKPOINT DINAIKKAN KE 991px) */
@media (max-width: 991px) {
    .hamburger { display: none !important; }
    .nav-menu { display: none !important; } /* Hilangkan Menu Desktop di HP/Tablet */
    header { height: 60px; } 
    
    /* TAMPILKAN MENU BAWAH HANYA DI HP */
    .mobile-bottom-nav { 
        display: flex !important; 
    }
    
    body { padding-bottom: 80px; }
    .grid-3 { grid-template-columns: 1fr; gap: 20px; }
    .course-card { flex-direction: column; }
    .course-img { width: 100%; height: 200px; }
    .course-info { width: 100%; padding: 20px; }
    .btn-register { float: none; width: 100%; text-align: center; margin-top: 15px; }
    h1, h2 { font-size: 1.8rem; }
    .hero-content h1 { font-size: 2rem; }
    .hero-content p { font-size: 1rem; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-col h4 { margin-top: 20px; }
}

