/* --- MODERN DARK THEME --- */
:root {
    --bg-color: #0f1015;
    --panel-bg: #1a1b23;
    --border-color: #2a2b36;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #3b82f6; 
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --radar-green: #00ff41;
}

body { 
    margin: 0; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden;
    
    /* Anti-Copy Protection */
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* --- HEADER --- */
.app-header { 
    padding: 15px 25px; 
    background: var(--panel-bg); 
    border-bottom: 1px solid var(--border-color); 
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* LOGO LINK RESET - Makes the logo link look clean */
.logo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}
.logo-link:focus { outline: none; }

.brand-logo {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cinematic pulsing dot - Added for better movies-suitable feel */
.brand-logo::before {
    content: '';
    width: 10px;
    height: 10px;
    background-color: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
    animation: branding-pulse 2s infinite ease-in-out;
}

/* Styling for the .site part - Made it a small badge */
.brand-logo span { 
    color: var(--panel-bg); 
    background: var(--text-main);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: -2px;
    vertical-align: top;
    text-transform: uppercase;
}

.search-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search-bar input[type="text"], .search-bar select {
    padding: 10px 14px; background: var(--bg-color); color: var(--text-main);
    border: 1px solid var(--border-color); border-radius: 6px; font-family: inherit;
    font-size: 14px; outline: none; transition: border-color 0.2s;
}
.search-bar input[type="text"]:focus, .search-bar select:focus { border-color: var(--accent); }
.search-bar input[type="text"] { width: 280px; }

.btn {
    padding: 10px 18px; font-family: inherit; font-weight: 600; font-size: 14px;
    border-radius: 6px; cursor: pointer; border: none; transition: background-color 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--border-color); color: var(--text-main); }
.btn-secondary:hover { background: #374151; }

.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-muted); cursor: pointer; }

/* --- SYSTEM TRAY --- */
.system-tray {
    display: none; padding: 10px 25px; background: #15161d;
    border-bottom: 1px solid var(--border-color); gap: 10px; align-items: center;
}
.system-tray.active { display: flex; }
.tray-btn {
    background: var(--panel-bg); color: var(--text-main); border: 1px solid var(--border-color);
    padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.tray-btn:hover { border-color: var(--accent); color: var(--accent); }

/* --- GRID --- */
.grid-container { flex: 1; display: grid; gap: 15px; padding: 15px; background-color: var(--bg-color); }
.grid-container.has-maximized { display: flex; }
.grid-container.has-maximized .iframe-wrapper:not(.maximized) { display: none !important; }

.iframe-wrapper {
    position: relative; background: var(--panel-bg); border: 1px solid var(--border-color);
    border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; transition: all 0.2s;
}
.iframe-wrapper.minimized { display: none !important; }
.iframe-wrapper.maximized { flex: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.iframe-header {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--panel-bg); border-bottom: 1px solid var(--border-color); padding: 8px 15px; z-index: 10;
}
.site-label { color: var(--text-main); font-size: 13px; font-weight: 600; }

.window-controls button {
    background: transparent; color: var(--text-muted); border: none; font-size: 16px;
    cursor: pointer; width: 28px; height: 28px; border-radius: 4px; display: inline-flex; justify-content: center; align-items: center;
}
.window-controls button:hover { background: var(--border-color); color: #fff; }

/* --- IFRAME SCALER --- */
.iframe-scaler { flex: 1; position: relative; overflow: hidden; background: #000; }
iframe { 
    position: absolute; top: 0; left: 0; width: 125%; height: 125%;  
    transform: scale(0.8); transform-origin: 0 0; border: none; 
}

/* =========================================
   --- ADVANCED RADAR ANIMATION ---
   ========================================= */
.radar-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 16, 21, 0.95);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 5; display: none;
}

.advanced-radar {
    position: relative; width: 160px; height: 160px; border-radius: 50%;
    border: 2px solid rgba(0, 255, 65, 0.4);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.1), inset 0 0 30px rgba(0, 255, 65, 0.1);
    background: 
        linear-gradient(rgba(0, 255, 65, 0.3) 1px, transparent 1px) 50% 50% / 100% 1px no-repeat,
        linear-gradient(90deg, rgba(0, 255, 65, 0.3) 1px, transparent 1px) 50% 50% / 1px 100% no-repeat,
        radial-gradient(circle, transparent 33%, rgba(0, 255, 65, 0.3) 34%, transparent 35%),
        radial-gradient(circle, transparent 66%, rgba(0, 255, 65, 0.3) 67%, transparent 68%);
    overflow: hidden;
}

.radar-beam {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(0,255,65,0) 70%, rgba(0,255,65,0.1) 90%, rgba(0,255,65,0.8) 100%);
    animation: radar-scan 2s linear infinite;
}

.radar-blip {
    position: absolute; width: 6px; height: 6px; background-color: #fff; border-radius: 50%;
    box-shadow: 0 0 15px 3px var(--radar-green), 0 0 5px 1px #fff; opacity: 0;
}

.blip-1 { top: 25%; left: 70%; animation: blip-flash 2s infinite 0.25s; }
.blip-2 { top: 75%; left: 70%; animation: blip-flash 2s infinite 0.75s; }
.blip-3 { top: 65%; left: 25%; animation: blip-flash 2s infinite 1.25s; }

.radar-text {
    margin-top: 25px; color: var(--radar-green); font-family: 'Courier New', Courier, monospace;
    font-size: 13px; font-weight: bold; letter-spacing: 3px; text-shadow: 0 0 8px var(--radar-green);
}
.radar-text::after { content: "SCANNING MOVIES..."; animation: text-glitch 1s infinite alternate; }

/* BRANDING ANIMATION - Subtle breathing effect */
@keyframes branding-pulse {
    0% { transform: scale(1); box-shadow: 0 0 8px var(--accent); }
    50% { transform: scale(1.1); box-shadow: 0 0 14px var(--accent); }
    100% { transform: scale(1); box-shadow: 0 0 8px var(--accent); }
}

@keyframes radar-scan { 100% { transform: rotate(360deg); } }
@keyframes blip-flash {
    0% { opacity: 0; transform: scale(0.5); }
    5% { opacity: 1; transform: scale(1.5); }
    10% { opacity: 0.8; transform: scale(1); }
    30% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes text-glitch { 0% { opacity: 0.6; } 100% { opacity: 1; } }

/* --- FOOTER --- */
.app-footer {
    background: var(--panel-bg); border-top: 1px solid var(--border-color);
    padding: 10px 20px; text-align: center; font-size: 12px; color: var(--text-muted); z-index: 100;
}