/* public/css/style.css - FINAL STABLE VERSION */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* === WARNA TEMA (UINSU Modern) === */
    --primary-color: #0F52BA;
    --primary-gradient: linear-gradient(135deg, #0F52BA 0%, #2563EB 100%);
    --secondary-gradient: linear-gradient(135deg, #10B981 0%, #059669 100%);
    
    /* === WARNA TOMBOL === */
    --btn-blue: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --btn-purple: linear-gradient(135deg, #818cf8 0%, #4f46e5 100%);
    --btn-dark: linear-gradient(135deg, #475569 0%, #1e293b 100%);
    --btn-warning: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    --btn-danger: linear-gradient(135deg, #f87171 0%, #dc2626 100%);

    /* === GLASS EFFECT (Soliditas ditingkatkan agar teks jelas) === */
    --glass-bg: rgba(255, 255, 255, 0.92); 
    --glass-border: 1px solid rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    
    --text-dark: #1e293b;
    --text-muted: #64748b;
}

/* === RESET GLOBAL === */
*, *::before, *::after {
    box-sizing: border-box; 
}

body {
    font-family: 'Outfit', sans-serif;
    margin: 0; padding: 0;
    min-height: 100vh;
    color: var(--text-dark);
    background-color: #f1f5f9;
    
    /* Background Mewah Halus */
    background-image: 
        radial-gradient(at 0% 0%, hsla(210, 100%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(220, 100%, 96%, 1) 0px, transparent 50%);
    background-attachment: fixed;
    background-size: cover;
    
    /* Mencegah scroll horizontal */
    overflow-x: hidden;
    width: 100%;
}

img { max-width: 100%; height: auto; }

/* === 1. LOGO HANDLING (Agar Tidak Oversize) === */
.logo {
    display: block;
    margin: 0 auto 1rem auto;
    height: 55px; /* Tinggi Fix Desktop */
    max-height: 55px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.logo-small { height: 40px; max-height: 40px; margin-bottom: 0; }


/* === 2. LAYOUT WRAPPERS (PEMISAH ADMIN & MAHASISWA) === */

/* Layout Mahasiswa (Tengah Layar) */
.layout-centered {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.container-center {
    width: 100%;
    max-width: 420px; /* Lebar maksimal kartu mahasiswa */
    margin: 0 auto;
    text-align: center;
}

/* Layout Admin (Dashboard Full Width) */
.admin-layout {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    min-height: 100vh;
}

/* === 3. KOMPONEN UI DASAR === */

/* Glass Card */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
}

/* Garis Aksen Biru di Atas Kartu */
.card-accent::before, .control-panel::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
    background: var(--primary-gradient);
}

/* Typography */
h1 { margin: 0; font-size: 1.5rem; color: var(--primary-color); font-weight: 800; letter-spacing: -0.5px; }
h3 { margin: 0; font-size: 1.1rem; color: var(--text-dark); font-weight: 700; }
.subtitle { margin: 0.3rem 0 1.5rem; color: var(--text-muted); font-size: 0.9rem; font-weight: 400; }

/* Form Inputs */
.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 600; font-size: 0.85rem; color: #475569; margin-left: 2px; }
.form-group label i { margin-right: 6px; color: var(--primary-color); }

input, select {
    width: 100%; padding: 0.8rem 1rem;
    border: 1px solid #e2e8f0; border-radius: 10px;
    background: #ffffff; font-size: 0.95rem; color: var(--text-dark); font-family: inherit;
    transition: border 0.2s, box-shadow 0.2s;
}
input:focus, select:focus { outline: none; border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

/* Buttons */
.button-group { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1.5rem; }
.btn {
    width: 100%; padding: 0.75rem 1rem; border: none; border-radius: 10px;
    font-weight: 600; font-size: 0.9rem; cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    display: inline-flex; justify-content: center; align-items: center; gap: 0.5rem;
    text-decoration: none; color: white;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }

/* Varian Warna Tombol */
.btn-primary { background: var(--primary-gradient); box-shadow: 0 4px 10px rgba(15, 82, 186, 0.3); }
.btn-secondary { background: white; color: var(--text-muted); border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #f8fafc; color: var(--text-dark); }
.btn-call { background: var(--secondary-gradient); color: white; }
.btn-danger { background: var(--btn-danger); }
.btn-blue { background: var(--btn-blue); }
.btn-purple { background: var(--btn-purple); }
.btn-dark { background: var(--btn-dark); }
.btn-warning { background: var(--btn-warning); }

/* Tombol Kecil (Grid Action) */
.btn-grid-action { padding: 0.5rem; font-size: 0.8rem; border-radius: 8px; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 8px; background: white; border: 1px solid #e2e8f0; color: var(--text-dark); }
.btn-icon:hover { background: #f1f5f9; }

/* === 4. ADMIN DASHBOARD SPESIFIK === */

/* Header Monitor (Angka Besar) */
.header-monitor {
    display: flex; justify-content: space-between; align-items: center; gap: 2rem;
    padding: 1rem 1.5rem; background: white; border-radius: 16px; border: 1px solid #e2e8f0;
}
.monitor-title { display: flex; align-items: center; gap: 1rem; min-width: 200px; }
.monitor-grid { display: flex; gap: 3rem; flex-grow: 1; justify-content: center; }
.monitor-item { text-align: center; min-width: 80px; position: relative; }
.monitor-number { 
    font-size: 2.8rem; font-weight: 800; line-height: 1; 
    background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.monitor-divider { width: 1px; height: 40px; background: #e2e8f0; }
.monitor-status { font-size: 0.75rem; font-weight: 600; color: #10B981; margin-top: 4px; }

/* Control Grid (4 Kolom Admin) */
.control-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Default Desktop 4 Kolom */
    gap: 1rem;
}

.control-panel {
    background: rgba(255,255,255,0.9); padding: 1.2rem; border-radius: 16px;
    display: flex; flex-direction: column; justify-content: space-between; min-height: 240px;
    border-top: 4px solid var(--primary-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.role-badge { background: #eff6ff; color: var(--primary-color); padding: 4px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.queue-box { text-align: center; padding: 0.5rem; margin: 0.8rem 0; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.queue-num { font-size: 2rem; font-weight: 800; color: var(--text-dark); line-height: 1; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; margin-bottom: 0.8rem; border-top: 1px solid #f1f5f9; }

/* === FOOTER ADMIN (GRID 2x3 & WIDE HISTORY) === */
.footer-area {
    display: grid;
    grid-template-columns: 380px 1fr; /* Kiri: Fixed 380px, Kanan: Sisa Ruang */
    gap: 1.5rem;
    align-items: stretch;
}

/* Menu Cepat Grid (2 Kolom x 3 Baris) */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 Kolom */
    grid-template-rows: repeat(3, 1fr);    /* 3 Baris */
    gap: 0.8rem;
    height: 100%;
}

/* History Container */
.history-container {
    display: flex; flex-direction: column;
    height: 100%; min-height: 220px;
}
.history-list { 
    list-style: none; padding: 0; margin: 0; 
    overflow-y: auto; font-size: 0.9rem; flex-grow: 1; 
}
.history-list li { 
    border-bottom: 1px solid #f1f5f9; padding: 0.8rem 0; 
    display: flex; justify-content: space-between; align-items: center;
}

/* === 5. SUPER ADMIN (KANBAN & DRAG DROP) === */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; align-items: start; }

.kanban-container { 
    display: grid; grid-template-columns: repeat(4, 1fr); 
    gap: 1rem; overflow-x: auto; padding-bottom: 1rem; 
}
.kanban-column { 
    background: rgba(255,255,255,0.7); border: 1px solid #e2e8f0; 
    border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; min-width: 250px; 
}
.kanban-header { 
    padding-bottom: 0.8rem; margin-bottom: 0.8rem; border-bottom: 2px solid var(--primary-color); 
    font-weight: 700; color: var(--primary-color); display: flex; justify-content: space-between; 
}
.kanban-list { list-style: none; padding: 0; margin: 0; flex-grow: 1; min-height: 50px; }

/* Job Item Style */
.job-item {
    background: white; padding: 0.8rem; margin-bottom: 0.6rem; border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); border: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between; cursor: grab;
    transition: transform 0.2s;
}
.job-item:hover { transform: translateY(-2px); border-color: var(--primary-color); }
.job-item.dragging { opacity: 0.5; border: 2px dashed var(--primary-color); background: #eff6ff; }
.job-text { flex-grow: 1; font-size: 0.85rem; margin: 0 0.5rem; word-break: break-word; }
.drag-handle { cursor: grab; color: #cbd5e1; }
.btn-mini { padding: 4px; border-radius: 4px; border: none; background: transparent; cursor: pointer; color: #94a3b8; }
.btn-mini:hover { background: #f1f5f9; color: var(--primary-color); }
.edit-input { width: 100%; padding: 0.4rem; font-size: 0.85rem; border: 1px solid #3B82F6; border-radius: 4px; }

/* Config List Style */
.config-row { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 0; border-bottom: 1px solid #f1f5f9; }
.config-item { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 0; border-bottom: 1px solid #f1f5f9; }

/* === 6. UTILITIES === */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #10B981; }
input:checked + .slider:before { transform: translateX(18px); }

.result-box { text-align: center; margin-top: 1rem; padding: 1.5rem; background: #fff; border: 2px dashed #3B82F6; border-radius: 12px; }
.nomor-besar { font-size: 3rem; font-weight: 800; color: var(--primary-color); margin: 0.5rem 0; letter-spacing: -1px; }
.disclaimer-box { margin-top: 2rem; padding: 0 1rem; text-align: center; }
.disclaimer-text { font-size: 0.7rem; color: #94a3b8; line-height: 1.4; max-width: 100%; display: block; }

/* === 7. RESPONSIVE (MEDIA QUERIES) === */

/* Tablet Portrait & Small Laptop */
@media (max-width: 1024px) {
    .control-grid { grid-template-columns: repeat(2, 1fr); }
    .kanban-container { grid-template-columns: repeat(2, 1fr); }
    
    /* Footer Stack ke bawah */
    .footer-area { grid-template-columns: 1fr; }
    .menu-grid { grid-template-columns: repeat(3, 1fr); /* Balik ke 3 kolom jika stack */ }
    
    .header-monitor { gap: 1rem; justify-content: center; }
}

/* Mobile Phone */
@media (max-width: 600px) {
    .admin-layout { padding: 1rem; }
    
    /* Semua Grid jadi 1 Kolom */
    .control-grid { grid-template-columns: 1fr; }
    .kanban-container { grid-template-columns: 1fr; }
    .menu-grid { grid-template-columns: repeat(2, 1fr); /* Di HP tetap 2 kolom */ }
    
    /* Header Stack */
    .header-monitor { flex-direction: column; align-items: stretch; gap: 1.5rem; text-align: center; }
    .monitor-title { justify-content: center; }
    .monitor-grid { justify-content: space-between; width: 100%; }
    .monitor-divider { display: none; }
    .monitor-number { font-size: 2rem; }
    
    /* Fix Halaman Mahasiswa */
    .container-center { width: 100%; padding: 0; }
    .card { padding: 1.2rem; }
    .logo { height: 50px; }
}