/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --accent-orange: #f59e0b;
    --accent-cyan: #06b6d4;
}

body.theme-light {
    --bg-color: #f1f5f9;
    --text-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    overflow: hidden; /* Hide scrollbars for TV */
    transition: background 0.5s ease;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 3fr 2fr;
    grid-template-rows: 100vh;
    width: 100vw;
    height: 100vh;
}

/* LEFT SIDE: Info & Counters */
.info-section {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.1), transparent 50%);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
}

.header-title h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--accent-blue), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-time {
    text-align: right;
}

.header-time h2 {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.header-time p {
    margin: 0;
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 15px; /* Reduced from 30px */
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.stat-card.blue { border-top: 5px solid var(--accent-blue); }
.stat-card.cyan { border-top: 5px solid var(--accent-cyan); }
.stat-card.orange { border-top: 5px solid var(--accent-orange); }
.stat-card.green { border-top: 5px solid var(--accent-green); }

.stat-title {
    font-size: 1rem; /* Reduced from 1.2rem */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px; /* Reduced from 15px */
    opacity: 0.8;
}

.stat-value {
    font-size: 2.5rem; /* Reduced from 4rem */
    font-weight: 700;
    margin: 0;
}

.stat-card.blue .stat-value { color: var(--accent-blue); }
.stat-card.cyan .stat-value { color: var(--accent-cyan); }
.stat-card.orange .stat-value { color: var(--accent-orange); }
.stat-card.green .stat-value { color: var(--accent-green); }

/* Lists Area */
.lists-area {
    display: flex;
    gap: 30px;
    flex: 1;
    overflow: hidden;
}

.list-container {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.list-header {
    padding: 20px;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color);
}

.list-container.queue .list-header { color: var(--accent-black); }
.list-container.processing .list-header { color: var(--accent-black); }
.list-container.completed .list-header { color: var(--accent-black); }

.list-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto; /* Allow scrolling */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.list-content::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.wo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    border-left: 4px solid var(--accent-blue);
    animation: fadeIn 0.5s ease-in;
}

.wo-item.queue { border-left-color: var(--accent-cyan); }
.wo-item.processing { border-left-color: var(--accent-orange); }
.wo-item.completed { border-left-color: var(--accent-green); }

.wo-flex {
    display: flex;
    align-items: center;
}

.wo-queue-num {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.15);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--accent-cyan);
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.wo-detail strong {
    font-size: 1.15rem;
    display: block;
    line-height: 1.25;
}
.wo-detail span {
    font-size: 0.85rem;
    opacity: 0.7;
}

.wo-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}
.wo-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    opacity: 0.85;
}
.wo-meta-label {
    opacity: 0.6;
}
.wo-meta-val {
    font-weight: 600;
}
.wo-meta-val.queue {
    color: var(--accent-cyan);
}
.wo-meta-val.work {
    color: var(--accent-orange);
}
.wo-meta-val.completed {
    color: var(--accent-green);
}

.wo-plat {
    font-size: 0.6rem;
    font-weight: 700;
    background: rgba(0,0,0,0.3);
    padding: 3px 8px;
    border-radius: 8px;
    letter-spacing: 1px;
    flex-shrink: 0;
    margin-left: 10px;
}

/* RIGHT SIDE: Promo Slider */
.slider-section {
    grid-column: 2;
    height: 100vh;
    padding: 40px;
    padding-left: 0;
    box-sizing: border-box;
    overflow: hidden; /* Mencegah gambar 'meledak' keluar */
}

#promo-slider {
    width: 100%;
    height: 100%;
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover; /* Background pengisi */
    background-position: center;
}

/* Layer transparan untuk memperkuat efek blur di background */
.slide::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(20px);
    z-index: 1;
}

.slide.active { opacity: 1; }

.slide video, 
.slide-img-placeholder {
    max-width: 90%;
    max-height: 90%;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: block;
    z-index: 2; /* Di atas lapisan blur */
    position: relative;
}

/* For background images (fallbacks or non-videos) */
.slide-bg {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
}

/* Tidy up Lists & Cards */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 25px;
    text-align: center;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.wo-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    opacity: 0.4;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================
   MOBILE RESPONSIVE & PREMIUM OVERLAY
   ========================================== */
@media (max-width: 768px) {
    body {
        overflow-y: auto !important; /* Mengizinkan scroll di mobile */
        overflow-x: hidden !important;
    }

    .dashboard-container {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        height: auto !important;
        width: 100vw !important;
    }

    .info-section {
        padding: 20px !important;
        gap: 20px !important;
        background: radial-gradient(circle at top, rgba(59, 130, 246, 0.1), transparent 70%) !important;
        min-height: 100vh !important;
        box-sizing: border-box !important;
    }

    .header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 15px !important;
        padding-bottom: 15px !important;
    }

    .header-time {
        text-align: center !important;
    }

    .header-time h2 {
        font-size: 2.5rem !important;
    }

    .brand-logo {
        height: 70px !important; /* Menyesuaikan logo di mobile */
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .stat-card {
        padding: 15px !important;
        border-radius: 16px !important;
    }

    .stat-title {
        font-size: 0.85rem !important;
        margin-bottom: 4px !important;
    }

    .stat-value {
        font-size: 1.8rem !important;
    }

    .lists-area {
        flex-direction: column !important;
        gap: 20px !important;
        overflow: visible !important;
    }

    .list-container {
        max-height: 420px !important;
        border-radius: 16px !important;
    }

    /* Slider Section as full-screen Glassmorphic Modal */
    .slider-section {
        grid-column: 1 / span 1 !important;
        height: 100vh !important;
        width: 100vw !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 1000 !important;
        padding: 20px !important;
        box-sizing: border-box !important;
        background: rgba(15, 23, 42, 0.96) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
        transform: scale(0.95);
    }

    .slider-section.show {
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: scale(1) !important;
    }

    #promo-slider {
        border-radius: 16px !important;
        height: 80vh !important;
        width: 100% !important;
    }

    /* Tombol Close Slider */
    .slider-close-btn {
        display: flex !important; /* Tampilkan di mobile */
    }

    /* Floating Notice Styles */
    .mobile-slider-notice {
        display: flex !important;
        position: fixed !important;
        bottom: 24px !important;
        left: 50% !important;
        transform: translateX(-50%) translateY(120px);
        width: calc(100% - 40px) !important;
        max-width: 450px !important;
        background: rgba(30, 41, 59, 0.85) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 20px !important;
        padding: 12px 18px !important;
        box-sizing: border-box !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        z-index: 999 !important;
        backdrop-filter: blur(12px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5) !important;
        animation: slideUpNotice 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
        animation-delay: 1s !important;
        cursor: pointer;
        transition: background 0.3s ease, border-color 0.3s ease;
    }

    .mobile-slider-notice:hover {
        background: rgba(30, 41, 59, 0.95) !important;
        border-color: rgba(255, 255, 255, 0.25) !important;
    }

    .notice-pulse {
        position: absolute;
        top: -4px;
        right: -4px;
        width: 12px;
        height: 12px;
        background: var(--accent-orange);
        border-radius: 50%;
        border: 2px solid var(--bg-color);
        box-shadow: 0 0 10px var(--accent-orange);
        animation: pulseEffect 2s infinite !important;
    }

    .notice-content {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .notice-icon {
        font-size: 1.5rem !important;
    }

    .notice-text {
        display: flex !important;
        flex-direction: column !important;
        text-align: left !important;
    }

    .notice-text strong {
        font-size: 0.9rem !important;
        color: #fff !important;
        font-weight: 600;
    }

    .notice-text span {
        font-size: 0.75rem !important;
        opacity: 0.85 !important;
        color: #e2e8f0;
    }

    .notice-btn {
        background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue)) !important;
        border: none !important;
        color: #fff !important;
        padding: 8px 16px !important;
        border-radius: 12px !important;
        font-weight: 600 !important;
        font-size: 0.85rem !important;
        cursor: pointer !important;
        box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3) !important;
        transition: transform 0.2s ease !important;
        white-space: nowrap !important;
    }

    .notice-btn:active {
        transform: scale(0.95) !important;
    }
}

/* Base styles for new components (Desktop safe, default hidden/off) */
.slider-close-btn {
    display: none; /* Sembunyikan secara default di desktop */
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1010;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.slider-close-btn:hover {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 1);
    transform: scale(1.05);
}

.slider-close-btn:active {
    transform: scale(0.95);
}

.mobile-slider-notice {
    display: none; /* Sembunyikan secara default di desktop */
}

@keyframes slideUpNotice {
    to {
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes pulseEffect {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}
