        :root {
            --primary: #DD0B51;
            --primary-glow: rgba(221, 11, 81, 0.5);
            --bg-dark: #0d0f12;
            --glass-bg: #161320;
            --glass-border: rgba(255, 255, 255, 0.1);
            --text-main: #ffffff;
            --radius: 12px;
            --thumb-size: 110px;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        
        body {
            background-color: var(--bg-dark);
            background-image: radial-gradient(circle at 50% 0%, #2c0e1b 0%, var(--bg-dark) 60%);
            color: var(--text-main);
            font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            height: 100vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        header {
            height: 65px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            backdrop-filter: blur(10px);
            background: var(--glass-bg);
            border-bottom: 1px solid var(--glass-border);
            z-index: 50;
            gap: 15px;
        }
        
        #logo-container img { height: 30px; display: block; }

        .header-search-container {
            flex: 1;
            max-width: 400px;
            position: relative;
        }
        
        .header-search-input {
            width: 100%;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid var(--glass-border);
            border-radius: 8px;
            padding: 10px 35px 10px 50px; 
            color: white;
            font-size: 14px;
            transition: all 0.2s ease;
        }
        .header-search-input:focus {
            background: rgba(0,0,0,0.3);
            border-color: var(--primary);
            outline: none;
            box-shadow: 0 0 10px rgba(221, 11, 81, 0.2);
        }

        .search-icon {
            position: absolute; 
            right: 15px; 
            top: 50%; 
            transform: translateY(-50%);
            color: #aaa; 
            font-size: 14px; 
            pointer-events: none;
        }

        .search-clear-btn {
            position: absolute; 
            right: 35px; 
            top: 50%; 
            transform: translateY(-50%);
            color: #aaa; 
            font-size: 14px; 
            cursor: pointer; 
            display: none;
            padding: 5px;
        }
        .search-clear-btn:hover { color: white; }

        main {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            padding-bottom: 100px; 
            scrollbar-width: thin;
        }

        .control-panel {
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius);
            padding: 20px;
            margin-bottom: 30px;
            backdrop-filter: blur(10px);
        }

        .tab-container {
            display: flex;
            background: rgba(0,0,0,0.3);
            border-radius: 10px;
            padding: 4px;
            margin-bottom: 15px;
        }

        .tab-btn {
            flex: 1;
            padding: 10px;
            border: none;
            background: transparent;
            color: #888;
            font-weight: 600;
            cursor: pointer;
            border-radius: 8px;
            transition: all 0.3s ease;
            border: 1px dashed #ffffff0f;
        }
        .tab-btn.active {
            background: var(--primary);
            color: white;
            box-shadow: 0 4px 15px var(--primary-glow);
            border-style: solid;
        }

        .input-group { display: none; gap: 10px; flex-direction: column; }
        .input-group.active { display: flex; animation: slideDown 0.3s ease; }
        @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

        input[type="text"], textarea {
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid var(--glass-border);
            color: white;
            padding: 12px;
            border-radius: 8px;
            width: 100%;
        }
        input:focus, textarea:focus { outline: none; border-color: var(--primary); }

        input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; margin: 15px 0; }
        input[type=range]:focus { outline: none; }
        input[type=range]::-webkit-slider-runnable-track {
            width: 100%; height: 8px; cursor: pointer;
            background: rgba(255, 255, 255, 0.1); border-radius: 4px; border: 1px solid var(--glass-border);
        }
        input[type=range]::-webkit-slider-thumb {
            height: 24px; width: 24px; border-radius: 50%; background: var(--primary);
            cursor: pointer; -webkit-appearance: none; margin-top: -9px;
            box-shadow: 0 0 10px rgba(221, 11, 81, 0.6); transition: transform 0.1s;
        }
        input[type=range]::-webkit-slider-thumb:active { transform: scale(1.1); }

        .drm-settings {
            display: none;
            gap: 10px;
            padding: 10px;
            background: rgba(221, 11, 81, 0.05);
            border-radius: 8px;
            border: 1px dashed var(--glass-border);
        }
        .drm-settings.show { display: flex; flex-direction: column; }

        .action-btn {
            background: linear-gradient(45deg, var(--primary), #a0063a);
            color: white;
            border: none;
            padding: 12px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            margin-top: 10px;
        }

        .grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(var(--thumb-size), 1fr));
            gap: 15px;
        }

        .card {
            background: rgba(255, 255, 255, 0.03);
            border-radius: 12px;
            overflow: hidden;
            aspect-ratio: 1;
            position: relative;
            cursor: pointer;
            border: 1px solid transparent;
            transition: all 0.2s ease;
        }
        .card:hover {
            transform: translateY(-5px);
            border-color: var(--primary);
            box-shadow: 0 5px 20px rgba(0,0,0,0.5);
        }
        .card img {
            width: 100%; height: 100%; 
            object-fit: contain; 
            background-color: var(--glass-bg);
            padding: 5px;
        }
        .card-title {
            position: absolute; bottom: 0; left: 0; right: 0;
            padding: 30px 5px 5px;
            background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
            font-size: 0.8rem;
            text-align: center;
            opacity: 0;
            transition: opacity 0.2s;
            pointer-events: none;
        }
        .card:hover .card-title, body.show-titles .card-title { opacity: 1; }

        .dock-container {
            position: fixed; bottom: 20px; left: 50%;
            transform: translateX(-50%); z-index: 100;
            width: auto;
        }
        .dock {
            display: flex; gap: 15px;
            background: rgba(20, 20, 20, 0.85);
            backdrop-filter: blur(15px);
            padding: 10px 25px;
            border-radius: 50px;
            border: 1px solid var(--glass-border);
            box-shadow: 0 10px 40px rgba(0,0,0,0.4);
        }
        .dock-item {
            background: none; border: none;
            color: #888; font-size: 1.2rem;
            cursor: pointer;
            width: 40px; height: 40px;
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            transition: all 0.2s;
            position: relative;
        }
        .dock-item:hover { color: white; background: rgba(255,255,255,0.1); }
        .dock-item.active { color: var(--primary); background: rgba(221, 11, 81, 0.15); }
        
        .dock-item::after {
            content: attr(data-label);
            position: absolute; top: -35px;
            background: black; color: white;
            font-size: 10px; padding: 4px 8px; border-radius: 4px;
            opacity: 0; pointer-events: none; transition: opacity 0.2s; white-space: nowrap;
        }
        .dock-item:hover::after { opacity: 1; }

        .modal-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.85);
            backdrop-filter: blur(5px);
            z-index: 1000;
            display: flex; justify-content: center; align-items: center;
            opacity: 0; pointer-events: none;
            transition: opacity 0.3s ease;
        }
        .modal-overlay.open { opacity: 1; pointer-events: auto; }

        .video-container {
            width: 90%; 
            max-width: 800px;
            aspect-ratio: 16/9;
            background: black;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 0 50px rgba(0,0,0,0.8);
            position: relative;
            border: 1px solid var(--primary);
        }
        video, iframe { width: 100%; height: 100%; border: none; }

        .player-info-btn {
            position: absolute; top: 15px; right: 15px;
            z-index: 20; color: white; background: rgba(0,0,0,0.5);
            border: none; border-radius: 50%; width: 30px; height: 30px;
            cursor: pointer;
        }
        .player-metadata {
            position: absolute; top: 50px; right: 15px;
            background: rgba(0,0,0,0.9); color: #ccc;
            padding: 15px; border-radius: 8px; font-size: 12px;
            max-width: 250px; display: none; z-index: 19; border: 1px solid #333;
            overflow-wrap: break-word;
        }
        .player-metadata.show { display: block; }

        /* Draggable Log Panel Styling (Preserved) */
        #floating-log-panel {
            position: fixed;
            top: 60px; right: 20px;
            width: 400px; height: 300px;
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.8);
            z-index: 2500;
            display: none;
            flex-direction: column;
            resize: both;
            overflow: hidden;
            min-width: 250px; min-height: 150px;
            backdrop-filter: blur(10px);
        }
        #floating-log-panel.active { display: flex; }
        
        .panel-header {
            padding: 10px 15px;
            background: rgba(255,255,255,0.05);
            border-bottom: 1px solid var(--glass-border);
            display: flex; justify-content: space-between; align-items: center;
            cursor: move; user-select: none;
        }
        .panel-title { font-weight: bold; font-size: 13px; color: var(--primary); }
        .panel-controls button {
            background: none; border: none; color: #aaa; cursor: pointer; font-size: 14px; margin-left: 10px;
        }
        .panel-controls button:hover { color: white; }
        
        #log-output {
            flex: 1; background: #0a0a0a; color: #ff4444; padding: 10px;
            overflow-y: auto; font-family: monospace; font-size: 11px; white-space: pre-wrap;
        }

        .modal-box {
            background: var(--glass-bg); border: 1px solid var(--glass-border);
            width: 90%; max-width: 450px;
            border-radius: 16px; padding: 25px;
            transform: scale(0.9); transition: transform 0.3s;
        }
        .modal-overlay.open .modal-box { transform: scale(1); }
        .modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 10px;}
        .close-modal { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }

        #toast {
            position: fixed; bottom: 100px; left: 50%;
            transform: translateX(-50%);
            background: rgba(30, 30, 30, 0.95);
            color: var(--primary);
            border: 1px solid var(--primary);
            padding: 10px 25px;
            border-radius: 30px;
            font-size: 14px;
            font-weight: bold;
            opacity: 0; pointer-events: none;
            transition: opacity 0.3s;
            z-index: 2000;
            box-shadow: 0 5px 15px rgba(0,0,0,0.5);
        }
        #toast.show { opacity: 1; }

        .spinner {
            display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
            width: 50px; height: 50px; border: 4px solid rgba(255,255,255,0.1);
            border-top-color: var(--primary); border-radius: 50%;
            animation: spin 1s linear infinite; z-index: 2000;
        }
        @keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

        @media (max-width: 600px) {
            header { padding: 0 15px; }
            .dock { padding: 8px 15px; gap: 10px; }
            .header-search-container { max-width: 200px; }
            #floating-log-panel { width: 90%; right: 5%; top: 70px; }
        }