:root {
    /* Color Palette */
    --bg-dark: #0a0e17;
    --bg-panel: rgba(18, 24, 38, 0.6);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    
    /* Accents */
    --accent-primary: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    
    /* Semantic Colors */
    --safe: #10b981;
    --safe-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.2);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    
    /* Base Glassmorphism */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Background Effects */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    pointer-events: none;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}

#orb-1 {
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
}

#orb-2 {
    bottom: -150px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: var(--danger);
    opacity: 0.15;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(10, 14, 23, 0.7);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shield-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--glass-border);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary .btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.btn-primary:hover .btn-glow {
    opacity: 1;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 1.5rem;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.hero {
    text-align: center;
    max-width: 600px;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    color: var(--accent-primary);
    position: relative;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-glow);
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Scanner Input */
.scanner-container {
    width: 100%;
    max-width: 800px;
}

#scan-form .glass-panel {
    padding: 0.5rem;
}

.input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.link-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    margin: 0 1rem;
}

#url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    padding: 0.5rem;
    outline: none;
    font-family: 'JetBrains Mono', monospace;
}

#url-input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* Loader */
#loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.results-container {
    width: 100%;
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-panel {
    padding: 2rem;
}

.risk-header {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.risk-score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    background: rgba(0,0,0,0.2);
    border: 4px solid var(--safe);
    box-shadow: 0 0 20px var(--safe-glow);
    transition: all 0.3s ease;
}

.risk-score-circle .percent {
    font-size: 1rem;
    margin-top: 0.5rem;
    margin-left: 2px;
}

.risk-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.status-safe { color: var(--safe); text-shadow: 0 0 10px var(--safe-glow); }
.status-warning { color: var(--warning); text-shadow: 0 0 10px var(--warning-glow); }
.status-danger { color: var(--danger); text-shadow: 0 0 10px var(--danger-glow); }

.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 2rem 0;
}

.findings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.finding-col h4 {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.threat-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.threat-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.threat-list li svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.li-safe border-left { border-left: 3px solid var(--safe); }
.li-warning { border-left: 3px solid var(--warning) !important; }
.li-danger { border-left: 3px solid var(--danger) !important; }
.li-info { border-left: 3px solid var(--accent-primary) !important; }

/* API Status Box */
.api-status-box {
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    margin-bottom: 1rem;
}

/* API Source Sections */
.api-source {
    margin-bottom: 1.25rem;
}

.api-source-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.api-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: white;
}

.api-badge.vt {
    background: linear-gradient(135deg, #394eff, #6c63ff);
}

.api-badge.gsb {
    background: linear-gradient(135deg, #34a853, #0d652d);
}

.optional-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.vt-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.vt-stat {
    text-align: center;
    padding: 0.6rem 0.4rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
}

.vt-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    display: block;
}

.vt-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.vt-stat.malicious .vt-stat-value { color: var(--danger); }
.vt-stat.suspicious .vt-stat-value { color: var(--warning); }
.vt-stat.clean .vt-stat-value { color: var(--safe); }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 450px;
    padding: 2rem;
    z-index: 51;
    animation: popIn 0.3s ease forwards;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
}

.close-modal:hover {
    color: white;
}

.modal-content h2 {
    margin-bottom: 0.5rem;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: monospace;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.form-group small a {
    color: var(--accent-primary);
    text-decoration: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1rem 1.5rem;
    }
    
    .findings-grid {
        grid-template-columns: 1fr;
    }
    
    .risk-header {
        flex-direction: column;
        text-align: center;
    }
}
