@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto+Mono:wght@400;500&display=swap');

:root {
    /* Color Palette */
    --bg-main: #0a0a0c;
    --bg-card: rgba(20, 20, 25, 0.7);
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    
    /* Effects */
    --glass-blur: blur(12px);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    background: rgba(15, 15, 20, 0.95);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.brand i {
    font-size: 1.5rem;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.nav-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    border-left: 3px solid var(--accent);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
}

/* Main Content Area */
.main-view {
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.url-input-container {
    display: flex;
    gap: 0.75rem;
    background: var(--bg-card);
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    backdrop-filter: var(--glass-blur);
    width: 100%;
    max-width: 600px;
}

input[type="text"] {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    flex: 1;
    font-size: 0.9rem;
}

.process-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.process-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Video Monitor Container */
.monitor-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* AI Overlay Layer */
.ai-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.detection-box {
    position: absolute;
    border: 2px solid var(--accent);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    transition: all 0.5s ease;
}

@keyframes statusPulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.detection-label {
    position: absolute;
    top: -22px;
    left: -2px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    font-family: 'Roboto Mono', monospace;
    white-space: nowrap;
    animation: statusPulse 1.5s ease-in-out infinite;
    text-transform: uppercase;
    font-weight: 600;
}

/* Status Panel */
.status-panel {
    background: rgba(15, 15, 20, 0.95);
    border-left: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-header {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
}

.stat-value.active { color: var(--accent); }
.stat-value.safe { color: var(--success); }
.stat-value.warn { color: var(--warning); }
.stat-value.danger { color: var(--danger); }

/* Alert Log */
.alert-log {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.alert-item {
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid transparent;
    font-size: 0.8rem;
}

.alert-item.critical { border-left-color: var(--danger); }
.alert-item.warning { border-left-color: var(--warning); }
.alert-item.info { border-left-color: var(--accent); }

.alert-time {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
}

/* Animations */
@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: scanline 4s linear infinite;
    opacity: 0.5;
    z-index: 10;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
