:root {
    --bg-color: #0f0f13;
    --text-color: #e0e0e0;
    --primary-color: #64ffda;
    --danger-color: #ff5252;
    --glass-bg: rgba(20, 20, 30, 0.65);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Glass Header - Removed/Hidden */
.glass-header {
    display: none;
}

/* Sidebar - Hidden/Removed Logic */
.sidebar {
    display: none;
}

/* Responsive Logic */
@media (max-width: 1100px) {
    .control-group {
        display: none; 
    }
}

/* Click to Play Overlay */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 200;
    backdrop-filter: blur(2px);
}

.play-overlay.show {
    display: flex;
}

.big-play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(100, 255, 218, 0.9);
    border: none;
    color: #0f0f13;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.4);
}

.big-play-btn svg {
    width: 32px;
    height: 32px;
    margin-left: 4px; /* Optical center adjustment */
}

.big-play-btn:hover {
    transform: scale(1.15);
    background: #64ffda;
    box-shadow: 0 0 50px rgba(100, 255, 218, 0.6);
}

/* Video Controls */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.video-wrapper:hover .video-controls {
    opacity: 1;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.control-btn svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 5px;
    transition: width 0.3s ease;
}

.vol-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
    opacity: 0;
}

.volume-container:hover .vol-slider,
.vol-slider:hover, 
.vol-slider:active {
    width: 100px;
    opacity: 1;
}

.speed-stat {
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-right: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Adjust Video Wrapper */
.video-wrapper {
    padding: 0; /* Full screen */
    background: #000;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    background: #000;
    object-fit: contain; /* Ensures full video is visible */
    border-radius: 0; /* Remove radius for full immersion */
    box-shadow: none;
}

/* Hide old controls styles */
.input-wrapper, .checkbox-wrapper, .btn-group, .stats-display {
    display: none;
}

/* Log Overlay */
.log-overlay {
    position: absolute;
    top: 20px;      /* Move to Top */
    left: 20px;     /* Move to Left */
    width: 320px;   /* Smaller width */
    max-height: 40vh; /* Limit height */
    background: rgba(0, 0, 0, 0.6); /* More transparent */
    backdrop-filter: blur(4px);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    z-index: 900;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.log-overlay.show {
    display: flex;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    border-bottom: 1px solid var(--glass-border);
}

.log-header button {
    padding: 2px 6px;
    font-size: 0.7rem;
    background: transparent;
    color: #888;
    border: 1px solid #444;
}

#logOutput {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    color: #ccc;
}

.log-entry {
    margin-bottom: 4px;
    line-height: 1.4;
    word-break: break-all;
}

.log-time {
    color: #666;
    margin-right: 8px;
}

.log-error {
    color: #ff5252;
}

.log-info {
    color: #64ffda;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Retry Toast */
.retry-toast {
    position: absolute;
    top: 20px;      /* Top */
    right: 20px;    /* Right */
    bottom: auto;   /* Reset bottom */
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.3s ease-out;
}

.retry-toast.show {
    display: flex;
}

/* Utility for Toggling */
.hidden-btn {
    display: none !important;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(100, 255, 218, 0.3);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Range Input Reset */
input[type=range] {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: transform 0.2s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
