:root {
    --bg-dark: #050505;
    --card-bg: #0a0a0a;
    --border: #333;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    
    /* Signal Colors */
    --neon-green: #ccff00;
    --neon-red: #ff0055;
    --neon-blue: #00f0ff;
    --neon-yellow: #ffff00;
    --neon-orange: #ff5500;
    
    /* Typography */
    --font-head: 'Unbounded', cursive;
    --font-mono: 'Space Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-mono);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Background Effects */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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: 40px 40px;
    z-index: -1;
    pointer-events: none;
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 240, 255, 0.02) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 100;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

/* Typography & Header */
header {
    text-align: center;
    margin-bottom: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.logo i {
    font-size: 2rem;
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(204, 255, 0, 0.5);
}

h1 {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.subtitle {
    color: var(--text-secondary);
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Search Box */
.search-box {
    display: flex;
    gap: 0;
    margin-bottom: 4rem;
    border: 1px solid var(--border);
    background: var(--card-bg);
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 1rem;
    border-right: 1px solid var(--border);
}

.prefix {
    color: var(--text-secondary);
    margin-right: 0.5rem;
    user-select: none;
}

input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--neon-blue);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    outline: none;
}

input::placeholder {
    color: #333;
}

button {
    padding: 0 2rem;
    background: var(--text-primary);
    color: var(--bg-dark);
    border: none;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

button:hover {
    background: var(--neon-green);
    box-shadow: 0 0 20px rgba(204, 255, 0, 0.4);
}

@media (max-width: 600px) {
    .container {
        padding: 2rem 1rem;
    }
    h1 {
        font-size: 1.6rem;
    }
    .search-box {
        flex-direction: column;
    }
    .input-wrapper {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    button {
        width: 100%;
        padding: 0.9rem 1rem;
    }
}

/* Loading State */
#loading {
    text-align: center;
    padding: 4rem;
}

.loader-glitch {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 800;
    position: relative;
    color: var(--text-primary);
}

.loader-glitch::before,
.loader-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.loader-glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--neon-red);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.loader-glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--neon-blue);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(11px, 9999px, 46px, 0); }
    20% { clip: rect(104px, 9999px, 13px, 0); }
    40% { clip: rect(48px, 9999px, 86px, 0); }
    60% { clip: rect(2px, 9999px, 144px, 0); }
    80% { clip: rect(74px, 9999px, 14px, 0); }
    100% { clip: rect(89px, 9999px, 63px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    20% { clip: rect(3px, 9999px, 2px, 0); }
    40% { clip: rect(26px, 9999px, 64px, 0); }
    60% { clip: rect(116px, 9999px, 58px, 0); }
    80% { clip: rect(144px, 9999px, 14px, 0); }
    100% { clip: rect(54px, 9999px, 78px, 0); }
}

/* Results & Cards */
.score-card {
    border: 1px solid var(--border);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    padding: 3rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.score-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
}

.score-header h2 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.badge-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px dashed var(--border);
    border-radius: 50%;
    animation: spin 10s linear infinite;
}

.badge {
    font-family: var(--font-head);
    font-size: 5rem;
    font-weight: 800;
    z-index: 2;
}

.score-desc {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
}

@media (max-width: 600px) {
    .badge-container {
        width: 110px;
        height: 110px;
    }
    .badge {
        font-size: 3.5rem;
    }
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 4rem;
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    border: 1px solid var(--border);
    padding: 1.5rem;
    background: var(--card-bg);
    transition: transform 0.2s;
}

.metric-card:hover {
    transform: translateY(-5px);
    border-color: var(--text-secondary);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.metric-header h3 {
    font-size: 0.9rem;
    font-weight: 400;
}

.metric-value {
    font-family: var(--font-head);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.progress-bar {
    height: 4px;
    background: #222;
    width: 100%;
}

.fill {
    height: 100%;
    background: var(--text-primary);
}

/* Overlay Demo */
.overlay-demo {
    border: 1px solid var(--border);
    padding: 2rem;
    background: var(--card-bg);
}

.mock-browser {
    max-width: 100%;
    width: 100%;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.status-indicator {
    font-size: 0.7rem;
    background: rgba(204, 255, 0, 0.1);
    color: var(--neon-green);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--neon-green);
}

.mock-browser {
    border: 1px solid var(--border);
    background: #fff;
    height: 400px;
    display: flex;
    flex-direction: column;
}

.mock-address-bar {
    background: #f0f0f0;
    padding: 0.8rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    margin-right: 4px;
}

#mockUrl {
    color: #666;
    font-size: 0.9rem;
}

.mock-content {
    flex: 1;
    position: relative;
    background: #f8f9fa;
    padding: 2rem;
    overflow: hidden;
}

.mock-hero {
    height: 200px;
    background: #e9ecef;
    margin-bottom: 2rem;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.mock-text {
    height: 15px;
    background: #e9ecef;
    margin-bottom: 1rem;
    width: 100%;
}

.mock-text.short {
    width: 60%;
}

/* The Injected Overlay */
.ux-overlay {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(5, 5, 5, 0.9);
    border: 1px solid var(--neon-green);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10;
    transform: translateX(100px);
    opacity: 0;
    animation: slideIn 0.5s forwards 0.5s;
}

@media (max-width: 600px) {
    .ux-overlay {
        top: 1rem;
        right: 1rem;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    .overlay-badge {
        font-size: 1.2rem;
        width: 34px;
        height: 34px;
    }
}

@keyframes slideIn {
    to { transform: translateX(0); opacity: 1; }
}

.overlay-scanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--neon-green);
    animation: scan 2s infinite linear;
    opacity: 0.5;
}

@keyframes scan {
    0% { top: 0; opacity: 0; }
    50% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.overlay-badge {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--neon-green);
    border: 2px solid var(--neon-green);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.overlay-details {
    display: flex;
    flex-direction: column;
}

.overlay-details strong {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
}

.overlay-details span {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--neon-green);
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

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

/* Dynamic Classes */
.text-a { color: var(--neon-green); }
.text-f { color: var(--neon-red); }
.text-c { color: var(--neon-yellow); }

.bg-a { background: var(--neon-green); }
.bg-f { background: var(--neon-red); }
.bg-c { background: var(--neon-yellow); }

.border-a { border-color: var(--neon-green); }
.border-f { border-color: var(--neon-red); }
.border-c { border-color: var(--neon-yellow); }

.glow-a { box-shadow: 0 0 20px rgba(204, 255, 0, 0.3); }
.glow-f { box-shadow: 0 0 20px rgba(255, 0, 85, 0.3); }

.hidden { display: none; }
