/* --- CSGVideoStreamer: Premium CSS Stylesheet --- */

:root {
    --bg-dark: #070913;
    --glass-bg: rgba(13, 17, 34, 0.45);
    --glass-bg-hover: rgba(22, 28, 54, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.35);
    
    --primary-color: #6366f1;       /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary-color: #a855f7;     /* Purple */
    --secondary-glow: rgba(168, 85, 247, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --success-color: #10b981;       /* Emerald */
    --success-glow: rgba(16, 185, 129, 0.4);
    --danger-color: #ef4444;        /* Red */
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Space Grotesk', monospace;
    
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- BASE & UTILITIES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    font-family: var(--font-sans);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Custom modern scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* --- GLOWING BACKGROUND ORBS --- */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.25;
    pointer-events: none;
    animation: float 25s infinite alternate ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 80%);
    top: -100px;
    left: -100px;
    animation-duration: 20s;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--secondary-color) 0%, transparent 80%);
    bottom: -150px;
    right: -100px;
    animation-duration: 28s;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #06b6d4 0%, transparent 80%); /* Cyan */
    top: 40%;
    left: 30%;
    animation-duration: 35s;
    animation-delay: -12s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(80px, 60px) scale(1.15); }
    100% { transform: translate(-40px, -80px) scale(0.9); }
}

/* --- APPS LAYOUT & STRUCTURE --- */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-height: 100vh;
}

/* Glassmorphism Generic Card */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--glass-shadow);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* --- HEADER STYLING --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* LIVE Dot Pulsing */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.live-dot.active {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px var(--danger-color);
    animation: pulse 1.5s infinite alternate;
}

.live-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.live-dot.active + .live-text {
    color: var(--text-primary);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.3); opacity: 1; }
}

.system-stats {
    display: flex;
    gap: 15px;
}

.stat-badge {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

/* --- MAIN DASHBOARD GRID --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 25px;
}

.primary-col {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.secondary-col {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* --- PLAYER CONTAINER --- */
.player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background-color: #000;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#videoPlayer {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Custom Overlays */
.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.player-container:hover .player-overlay {
    opacity: 1;
}

.stream-badge {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.overlay-center {
    align-self: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: var(--transition-smooth);
}

.overlay-center:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
}

.play-icon {
    width: 35px;
    height: 35px;
    color: #fff;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 12px;
    width: fit-content;
}

.ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.ctrl-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.ctrl-icon {
    width: 20px;
    height: 20px;
}

/* Volume Slider styling */
.volume-slider-container {
    display: flex;
    align-items: center;
    width: 80px;
}

.vol-slider {
    width: 100%;
    height: 4px;
    appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    outline: none;
}

.vol-slider::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.vol-slider::-webkit-slider-thumb:hover {
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
}

/* --- THEATER MODE CLASS --- */
.theater-mode {
    grid-template-columns: 1fr !important;
}

.theater-mode .secondary-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* --- METADATA CONTAINER --- */
.metadata-container {
    padding: 25px 30px;
}

.meta-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
}

.meta-labels {
    flex: 1;
}

.meta-category {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 6px;
}

.track-title {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

/* Skip Button */
.skip-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: var(--transition-smooth);
}

.skip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.skip-btn:active {
    transform: translateY(0);
}

.skip-icon {
    width: 18px;
    height: 18px;
}

/* Timeline/Countdown */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.time-readout {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
}

.time-curr {
    color: var(--primary-color);
}

.time-duration {
    color: var(--text-secondary);
}

.progress-track {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.02);
    height: 6px;
    border-radius: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 10px var(--primary-glow);
    border-radius: 30px;
    width: 0%;
    transition: width 1s linear;
}

.meta-footer {
    display: flex;
    gap: 30px;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-stat .lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-stat .val {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* --- CONTROL CARD PANEL --- */
.control-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    border-left: 3px solid var(--secondary-color);
    padding-left: 12px;
    line-height: 1.2;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.text-input {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 14px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.text-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px var(--secondary-glow);
}

.submit-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.submit-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.panel-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.action-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.85rem;
    width: 100%;
    transition: var(--transition-smooth);
}

.action-btn:hover {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fff;
}

.action-icon {
    width: 16px;
    height: 16px;
}

/* --- UP NEXT QUEUE --- */
.queue-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    min-height: 320px;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 4px;
}

.queue-item {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-smooth);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item:hover {
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.28);
}

.queue-item::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    flex-shrink: 0;
}

.queue-item.placeholder {
    justify-content: center;
    border-style: dashed;
    color: var(--text-muted);
}

/* --- HISTORY TABLE --- */
.dashboard-footer {
    padding: 25px 30px;
    margin-top: 10px;
}

.table-wrapper {
    margin-top: 15px;
    max-height: 250px;
    overflow-y: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.history-table th {
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.history-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.history-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.history-table td:nth-child(2),
.history-table td:nth-child(3) {
    font-family: var(--font-mono);
}

.placeholder-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-style: italic;
}

/* --- TOAST SYSTEM --- */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(13, 17, 34, 0.9);
    border: 1px solid var(--primary-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--primary-glow);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

.toast-container.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .main-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    .system-stats {
        width: 100%;
        justify-content: space-between;
    }
    .meta-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .skip-btn {
        width: 100%;
        justify-content: center;
    }
    .config-inputs {
        grid-template-columns: 1fr;
    }
}
