:root {
    --bg-color: #0A1A12;
    --card-bg: rgba(16, 185, 129, 0.05);
    --card-border: rgba(16, 185, 129, 0.15);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --primary-color: #10B981;
    --primary-hover: #059669;
    --secondary-color: #6EE7B7;
    --accent-color: #F59E0B;
    
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --success: #10B981;
    
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding: 2rem;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.08), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.05), transparent 40%);
}

.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.header-icon {
    width: 60px;
    height: 60px;
    background: var(--card-bg);
    border: 1px solid var(--primary-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.2);
}

.header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #fff;
}

.header p {
    color: var(--secondary-color);
    font-size: 1.1rem;
    max-width: 600px;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* Layout */
.split-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
    align-items: start;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.column-sticky {
    position: sticky;
    top: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn.sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-success:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.full-width {
    width: 100%;
}

/* Editor Panel */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panel-header h2 {
    font-size: 1.125rem;
    color: var(--secondary-color);
    font-weight: 600;
}

#htmlInput {
    width: 100%;
    height: 500px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
    line-height: 1.5;
}

#htmlInput:focus {
    border-color: var(--primary-color);
}

/* Stats Panel */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.25rem;
    font-family: var(--font-mono);
}

.stat-value.high-risk { color: var(--danger); text-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
.stat-value.med-risk { color: var(--accent-color); }
.stat-value.safe { color: var(--success); }

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Detections List */
.detections-panel {
    max-height: 600px;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    transition: color 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.detections-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
}

/* Custom Scrollbar for list */
.detections-list::-webkit-scrollbar {
    width: 6px;
}
.detections-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}
.detections-list::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem 0;
}

.detection-item {
    background: rgba(0,0,0,0.25);
    border-left: 3px solid var(--danger);
    border-radius: 0 6px 6px 0;
    padding: 0.75rem;
}

.detection-item.pixel { border-left-color: var(--danger); }
.detection-item.script { border-left-color: var(--warning); }
.detection-item.link { border-left-color: var(--info); }

.det-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
}
.badge.pixel { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.badge.script { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.badge.link { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }

.det-company {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.det-url {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-all;
    margin-bottom: 0.5rem;
    background: rgba(0,0,0,0.3);
    padding: 0.4rem;
    border-radius: 4px;
}

.det-reason {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

/* Educational Panel */
.edu-panel {
    margin-top: 1rem;
}

.edu-panel h3 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    text-align: center;
}

.edu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.edu-card {
    background: rgba(0,0,0,0.15);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--card-border);
}

.edu-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 8px;
}

.pixel-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.script-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.link-icon { background: rgba(59, 130, 246, 0.1); color: var(--info); }

.edu-card h4 {
    margin-bottom: 0.5rem;
    color: #fff;
}

.edu-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .split-layout {
        grid-template-columns: 1fr;
    }
    .column-sticky {
        position: static;
    }
    .edu-grid {
        grid-template-columns: 1fr;
    }
}
