/* =========================================
   1. GLOBAL LAYOUT & UTILITIES
   ========================================= */
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden; /* Mencegah scroll pada body utama */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.app-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* =========================================
   2. LOGIN PAGE (GLASSMORPHISM)
   ========================================= */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-size: cover; 
    background-position: center;
}

.login-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    color: #fff;
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.user-icon {
    width: 80px; height: 80px;
    background: linear-gradient(45deg, #0d6efd, #0dcaf0);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 35px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.form-control-glass {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 30px;
    padding: 12px 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.form-control-glass:focus {
    background: #fff;
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
    transform: scale(1.02);
}

.btn-glass-login {
    width: 100%;
    border-radius: 30px;
    padding: 12px;
    font-weight: bold;
    background: linear-gradient(45deg, #0d6efd, #0099ff);
    border: none;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 153, 255, 0.4);
    transition: all 0.3s ease;
}

.btn-glass-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 153, 255, 0.6);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   3. SIDEBAR (DASHBOARD)
   ========================================= */
.sidebar {
    width: 250px;
    background: #343a40;
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar a {
    color: #cfd8dc;
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    border-bottom: 1px solid #454d55;
    transition: 0.3s;
}

.sidebar a:hover, .sidebar a.active {
    background: #495057;
    color: #fff;
    padding-left: 25px;
    border-left: 4px solid #0d6efd;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    background: #212529;
}

/* =========================================
   4. MAIN PANEL & CONTENT
   ========================================= */
.main-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.top-navbar {
    background: white;
    padding: 15px 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-scrollable {
    flex-grow: 1;
    overflow-y: auto;
    padding: 25px;
}

/* =========================================
   5. FOOTER
   ========================================= */
.fixed-footer {
    background: #fff;
    padding: 15px;
    border-top: 1px solid #dee2e6;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

/* =========================================
   6. TIMELINE (HISTORY)
   ========================================= */
.timeline-wrapper {
    position: relative;
    padding-left: 10px;
}

.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 20px;
    width: 3px;
    background: #e9ecef;
    z-index: 0;
}

.timeline-date-label {
    position: relative;
    z-index: 1;
    margin: 30px 0 15px 0;
}

.timeline-date-badge {
    background: #6c757d;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-date-badge.today {
    background: #0d6efd;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

.timeline-item {
    position: relative;
    z-index: 1;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    margin-left: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: transform 0.2s;
}

.timeline-item:hover {
    transform: translateX(5px);
    border-color: #0d6efd;
}

.timeline-dot {
    position: absolute;
    left: -36px;
    top: 25px;
    width: 15px;
    height: 15px;
    background: white;
    border: 3px solid #0d6efd;
    border-radius: 50%;
}

/* =========================================
   7. SIDEBAR CATEGORY (NEW)
   ========================================= */
.sidebar-category {
    color: #adb5bd !important; /* Warna teks jauh lebih terang */
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px; /* Memberi jarak enak diklik */
    transition: all 0.3s;
}

.sidebar-category:hover {
    color: #ffffff !important; /* Putih saat dihover */
}

/* Animasi Panah Dropdown */
.sidebar-category .fa-chevron-down {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}

/* Saat menu terbuka (aria-expanded=true), panah berputar */
.sidebar-category[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Geser submenu sedikit ke kanan agar terlihat seperti anak menu */
.collapse div a {
    padding-left: 30px !important; 
    font-size: 0.9rem;
}

/* =========================================
   8. ANIMASI MEWAH (BREATH EFFECT - UPDATE)
   ========================================= */
@keyframes luxury-breath {
    0% {
        opacity: 0.8;
        text-shadow: 0 0 5px currentColor;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        /* Glow lebih kuat & melebar */
        text-shadow: 0 0 20px currentColor; 
        transform: scale(1.05); /* Membesar sedikit saat "tarik nafas" */
    }
    100% {
        opacity: 0.8;
        text-shadow: 0 0 5px currentColor;
        transform: scale(1);
    }
}

.text-breath {
    display: inline-block; /* Wajib agar transform scale bekerja */
    animation: luxury-breath 3s ease-in-out infinite;
    font-weight: 800;
    letter-spacing: 0.5px;
}


/* HOME.PHP
=========================================
   10. /* Style untuk Chat Log (Modifikasi di bagian <style> home.php)
========================================= */
    
    /* CUSTOM STYLE: DARK RED STATUS */
    .bg-dark-danger {
        background-color: #8b0000 !important; 
        color: #ffffff !important; 
    }
    
    /* Scrollbox style */
    .scroll-list {
        max-height: 350px; 
        overflow-y: auto;
    }
    
    /* Style untuk Chat Log */
    .chat-log-box {
        background: #343a40; 
        color: #ffffff;
        font-family: monospace;
        padding: 5px 10px; /* Padding minimal */
        height: 350px; 
        overflow-y: auto;
        /* Hapus white-space: pre-wrap; jika ada */
        border-radius: 0 0 0.25rem 0.25rem;
    }
    
    /* --- PERBAIKAN KERAPATAN HORIZONTAL DAN VERTIKAL --- */
    
    .chat-log-entry { 
        margin: 0;          /* HAPUS SEMUA MARGIN VERTIKAL */
        padding: 1px 0;     /* Padding vertikal sangat minimal */
        
        display: flex;
        gap: 8px;           /* Sedikit jarak antar kolom (Horizontal) */
        align-items: flex-start;
        
        /* Border tipis untuk memisahkan baris */
        border-bottom: 1px solid rgba(255,255,255,0.08); 
        line-height: 1.2;
    }
    
    /* Gaya untuk elemen kolom (Waktu, Tipe, Map, ID) */
    .chat-log-time, .chat-log-type, .chat-log-map, .chat-log-sender {
        /* Pastikan elemen ini tidak memiliki wrapping */
        white-space: nowrap; 
        flex-shrink: 0; 
        font-size: 0.85rem;
        /* Padding horizontal agar lebih mudah dibaca */
        padding-right: 2px;
    }

    /* Gaya untuk Teks Pesan */
    .chat-log-msg {
        flex-grow: 1;           /* Ambil semua sisa ruang */
        white-space: normal;    /* Izinkan pesan wrap (turun baris) */
        padding: 0;
        margin: 0;
    }

    /* Gaya warna untuk elemen log */
    .chat-log-time { color: #aaaaaa; } 
    /* .chat-log-name (Pengirim) diubah menjadi chat-log-sender */
    .chat-log-sender { color: #99ccff; font-weight: normal; }
    .chat-log-map { color: #88ff88; font-weight: bold; }
    .chat-log-msg { color: #ffffff; }
    
    /* Gaya warna berdasarkan tipe chat (diambil dari config.php) */
    .chat-type-normal { color: #aaaaaa; }     /* Umum */
    .chat-type-whisper { color: #ff99ff; }  /* Whisper */
    .chat-type-party { color: #66ff66; }    /* Party */
    .chat-type-guild { color: #66ccff; }    /* Guild */
    .chat-type-map { color: #ffcc66; }      /* Map/Global */
    

.chat-log-box {
    background: #343a40; 
    color: #ffffff;
    font-family: monospace;
    padding: 0 5px; /* Kurangi padding vertikal ke 0, sisakan horizontal */
    height: 350px; 
    overflow-y: auto;
    border-radius: 0 0 0.25rem 0.25rem;
}

/* Modifikasi KRITIS: Mengurangi margin dan padding pada setiap entri */
.chat-log-entry { 
    margin: 0;          /* Hapus semua margin */
    padding: 2px 0;     /* Beri padding vertikal minimal (2px) */
    
    /* Flexbox memastikan semua elemen dalam satu baris */
    display: flex;
    gap: 5px;           /* Jarak horizontal antar kolom log */
    align-items: flex-start;
    
    border-bottom: 1px solid rgba(255,255,255,0.05); 
    line-height: 1.2;
}

/* Pastikan semua elemen inline di dalam baris sangat padat */
.chat-log-entry > span {
    display: inline;
    white-space: nowrap; 
    margin: 0; 
    padding: 0; 
    font-size: 0.85rem; /* Menjaga font agar tetap kecil */
}

/* Gaya untuk pesan itu sendiri (mengambil sisa ruang) */
.chat-log-msg {
    flex-grow: 1; 
    white-space: normal; 
    padding-right: 5px; /* Jaga agar teks tidak terlalu dekat ke tepi kanan */
    /* Pastikan tidak ada margin-left yang tersisa */
    margin-left: 0 !important; 
}

/* Tambahan: Jarak antar kolom waktu/tipe/map dibuat lebih padat */
.chat-log-time, .chat-log-type, .chat-log-map {
    flex-shrink: 0; /* Mencegah kolom ini menyusut jika lebar kurang */
}

/* Gaya default sender name */
.chat-log-sender, .chat-log-receiver {
    margin: 0;
    padding: 0;
    font-weight: bold;
}