/* ==========================================
   STYLE.CSS - FINAL VERSION
   Tema: Dark Premium dengan Aksen Emas
   Responsif & Modern UI
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Plus+Jakarta+Sans:wght@300;400;500;600&display=swap');

/* --- 1. VARIABLES & RESET --- */
:root {
    --primary: #D4AF37; /* Emas Premium */
    --primary-hover: #b5952f;
    --bg-dark: #0f1014;
    --bg-card: #1b1e26;
    --bg-input: #232732;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --danger: #ff4d4d;
    --success: #00cc66;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0,0,0,0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    color: var(--text-main);
}

/* --- 2. LAYOUT UTAMA --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex: 1;
}

header {
    background: rgba(15, 16, 20, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo { font-size: 1.5rem; font-weight: 700; letter-spacing: 1px; }
.logo span { color: var(--primary); }

/* --- 3. COMPONENTS (BUTTONS, INPUTS) --- */
.btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
}
.btn:hover { background: var(--primary); color: #000; }

.btn-primary {
    background: var(--primary);
    color: #000;
    border: none;
    width: 100%;
    padding: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-danger {
    background: rgba(255, 77, 77, 0.2);
    color: var(--danger);
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

input, select {
    width: 100%;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    transition: 0.3s;
}
input:focus, select:focus { border-color: var(--primary); }

/* --- 4. USER SECTION --- */
section { display: none; animation: fadeIn 0.5s ease; }
section.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.booking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Barber Cards */
.barber-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.barber-card {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.3s;
}
.barber-card:hover, .barber-card.selected {
    border-color: var(--primary);
    background: #22252e;
    transform: translateY(-5px);
}
.barber-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 0.5rem; }

/* Form Card & Time Slots */
.form-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
}
.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 5px; font-size: 0.9rem; color: var(--text-muted); }

.time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.time-slot {
    padding: 8px;
    background: var(--bg-input);
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: 0.2s;
}
.time-slot:hover:not(.disabled) { background: rgba(212, 175, 55, 0.2); }
.time-slot.selected { background: var(--primary); color: #000; font-weight: bold; }
.time-slot.disabled { opacity: 0.3; cursor: not-allowed; text-decoration: line-through; }

/* --- 5. ADMIN SECTION --- */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

/* Sidebar */
.admin-menu {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius);
}
.menu-item {
    padding: 12px 15px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 8px;
    margin-bottom: 5px;
    transition: 0.3s;
}
.menu-item:hover { background: rgba(255,255,255,0.05); color: white; }
.menu-item.active { background: var(--primary); color: #000; font-weight: 600; }

/* Content Area */
.tab-pane { display: none; animation: fadeIn 0.4s ease; }
.tab-pane.active { display: block; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 1rem;
}
th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
th {
    background: rgba(0,0,0,0.3);
    color: var(--primary);
    font-weight: 600;
}

/* Stats Cards */
.stat-card {
    background: linear-gradient(145deg, #1e222b, #16191f);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.stat-card h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
}
.badge.confirmed { background: rgba(212, 175, 55, 0.2); color: var(--primary); }
.badge.completed { background: rgba(0, 204, 102, 0.2); color: #00cc66; }
.badge.cancelled { background: rgba(255, 77, 77, 0.2); color: var(--danger); }

/* --- 6. MODALS & OVERLAYS --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}
.modal-content {
    background-color: var(--bg-card);
    padding: 2.5rem;
    border: 1px solid var(--primary);
    width: 90%;
    max-width: 400px;
    border-radius: var(--radius);
    position: relative;
}
.close-modal {
    color: #aaa;
    position: absolute;
    top: 10px; right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-modal:hover { color: white; }

/* Receipt Style (Tiket Putih) */
.receipt-style {
    background: #fff !important;
    color: #000 !important;
    border: 2px dashed var(--primary) !important;
    padding: 2rem !important;
    max-width: 350px;
    text-align: center;
}
.receipt-style h2, .receipt-style h3, .receipt-style p {
    color: #000 !important;
}
.receipt-style .btn-primary {
    background: var(--bg-dark) !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary);
}

/* Toast Notification */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 1;
    right: 30px;
    bottom: 30px;
    font-size: 17px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-left: 4px solid var(--primary);
}
#toast.show { visibility: visible; animation: slidein 0.5s, fadeout 0.5s 2.5s; }

@keyframes slidein { from { bottom: 0; opacity: 0; } to { bottom: 30px; opacity: 1; } }
@keyframes fadeout { from { bottom: 30px; opacity: 1; } to { bottom: 0; opacity: 0; } }

/* --- 7. RESPONSIVE DESIGN (MOBILE) --- */
@media (max-width: 768px) {
    /* Responsive Grids */
    .booking-grid { grid-template-columns: 1fr; }
    .time-grid { grid-template-columns: repeat(3, 1fr); }
    .stat-number { font-size: 2rem; }

    /* Admin Layout Mobile */
    .admin-layout { grid-template-columns: 1fr; }
    
    /* Hamburger Button */
    #hamburgerBtn { display: block !important; }

    /* Mobile Sidebar */
    .admin-menu {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        width: 250px;
        background: var(--bg-card);
        z-index: 1500;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
        padding-top: 60px; /* Space untuk header */
    }

    .admin-menu.show-mobile { transform: translateX(0); }

    /* Overlay gelap saat menu terbuka */
    body.menu-open::after {
        content: '';
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1400;
    }
}