/* === Base === */
:root {
    --bg-dark: #0B0714;
    --bg-card: #141418;
    --bg-card-hover: #1a1a22;
    --purple: #8B5CF6;
    --purple-light: #a78bfa;
    --purple-glow: rgba(139, 92, 246, 0.3);
    --pink: #d946ef;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --text: #ffffffee;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === Screens === */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
}

.screen.active {
    display: block;
}

.bg-glow {
    position: fixed;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--purple-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* === Logo === */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.5px;
}

/* === Landing === */
.landing-header {
    padding: 32px 0;
}

.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1.5px;
}

.hero-line {
    display: block;
}

.gradient-text {
    background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 48px;
}

/* === Form === */
.url-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 560px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 4px;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-glow);
}

.input-icon {
    padding: 0 12px;
    font-size: 20px;
    opacity: 0.6;
}

#url-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1.1rem;
    font-family: var(--font-body);
    padding: 16px 16px 16px 4px;
}

#url-input::placeholder {
    color: var(--text-dim);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
    color: white;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--purple-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--bg-card);
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.disclaimer {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* === Loading Screen === */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    position: relative;
    z-index: 1;
}

.loading-icon {
    font-size: 64px;
    margin-bottom: 24px;
    animation: pulse-fire 1.5s ease-in-out infinite;
}

.loading-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 32px;
}

.progress-bar-wrapper {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 32px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--pink));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.progress-step {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
}

.progress-step.active {
    color: var(--text);
}

.progress-step .step-check {
    color: var(--green);
}

.loading-tip {
    margin-top: 40px;
    font-size: 0.85rem;
    color: var(--text-dim);
    font-style: italic;
}

/* === Results Screen === */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
}

.results-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

#share-btn {
    position: relative;
}

.copied-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--green);
    color: #000;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    animation: tooltip-fade 1.5s ease forwards;
}

.copied-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--green);
}

@keyframes tooltip-fade {
    0% { opacity: 0; transform: translateX(-50%) translateY(4px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

.results-hero {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 48px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.score-ring-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: var(--bg-card);
    stroke-width: 12;
}

.score-ring-fill {
    fill: none;
    stroke: var(--purple);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 1.5s ease, stroke 0.3s;
}

.score-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-number {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.results-url {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    word-break: break-all;
}

.wp-badge {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    margin-left: 10px;
    background: rgba(0, 115, 170, 0.15);
    color: #21759b;
    border: 1px solid rgba(0, 115, 170, 0.3);
    border-radius: 20px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

.overall-verdict {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: 8px;
    max-width: 400px;
}

/* === Screenshot === */
.screenshot-section {
    margin-bottom: 48px;
    text-align: center;
}

.screenshot-section h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.screenshot-wrapper {
    display: inline-block;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 320px;
}

.screenshot-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

/* === Category Cards === */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    padding-bottom: 48px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 28px;
    opacity: 0;
    transform: translateY(20px);
    overflow: hidden;
    min-width: 0;
}

.finding-desc {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-category {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    font-size: 24px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
}

.card-score {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
}

.card-score.score-good { color: var(--green); }
.card-score.score-ok { color: var(--yellow); }
.card-score.score-bad { color: var(--red); }

.card-gauge {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}

.card-gauge-fill {
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width 1s ease;
}

.card-gauge-fill.score-good { background: var(--green); }
.card-gauge-fill.score-ok { background: var(--yellow); }
.card-gauge-fill.score-bad { background: var(--red); }

.card-roast {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid var(--purple);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.findings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.finding {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.finding:last-child {
    border-bottom: none;
}

.finding-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.finding-icon.severity-good::after { content: "✅"; }
.finding-icon.severity-warning::after { content: "⚠️"; }
.finding-icon.severity-critical::after { content: "❌"; }

.finding-content {
    flex: 1;
}

.finding-title {
    font-weight: 500;
    color: var(--text);
}

.finding-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2px;
}

/* === Tabs === */
.results-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 32px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 24px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background 0.2s;
}

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

.tab-btn.active {
    color: var(--purple-light);
}

.tab-btn.active::after {
    background: var(--purple);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* === Innsikt Cards === */
.innsikt-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
}

.innsikt-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.innsikt-icon {
    font-size: 24px;
}

.innsikt-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
}

.innsikt-headline {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

.innsikt-note {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 16px;
}

/* === Tech Stack Badges === */
.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
}

.tech-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tech-badge.tech-current {
    border-color: rgba(34, 197, 94, 0.4);
}
.tech-badge.tech-current .tech-dot {
    background: var(--green);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.tech-badge.tech-outdated {
    border-color: rgba(234, 179, 8, 0.4);
}
.tech-badge.tech-outdated .tech-dot {
    background: var(--yellow);
    box-shadow: 0 0 6px rgba(234, 179, 8, 0.5);
}

.tech-badge.tech-ancient {
    border-color: rgba(239, 68, 68, 0.4);
}
.tech-badge.tech-ancient .tech-dot {
    background: var(--red);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.tech-badge.tech-unknown {
    border-color: rgba(156, 163, 175, 0.3);
}
.tech-badge.tech-unknown .tech-dot {
    background: var(--text-dim);
}

.tech-name {
    color: var(--text);
}

.tech-year {
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* === Font Showcase === */
.font-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.font-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 20px;
    overflow: hidden;
}

.font-card-name {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--purple-light);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.font-card-specimen {
    margin-bottom: 12px;
}

.specimen-large {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 6px;
}

.specimen-full {
    display: block;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.font-card-source {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* === Color Palette === */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.color-swatch {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: default;
    transition: transform 0.15s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.swatch-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.color-swatch:hover .swatch-label {
    opacity: 1;
}

/* === Contrast Pairs === */
.contrast-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.contrast-heading {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--red);
}

.contrast-pairs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.contrast-pair {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
}

.contrast-preview {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    line-height: 1;
}

.contrast-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contrast-ratio {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--red);
}

.contrast-required {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* === CTA === */
.cta-section {
    padding: 48px 0 80px;
}

.cta-card {
    text-align: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(217, 70, 239, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
}

.cta-card h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.cta-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 28px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.btn-cta {
    font-size: 1.15rem;
    padding: 18px 40px;
}

/* === Error Overlay === */
.error-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 7, 20, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.error-card {
    background: var(--bg-card);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    max-width: 400px;
}

.error-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.error-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.error-card p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* === Responsive === */
@media (max-width: 600px) {
    .category-cards {
        grid-template-columns: 1fr;
    }

    .results-hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .url-form {
        padding: 0 8px;
    }

    .results-tabs {
        margin-bottom: 20px;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .tech-badges {
        gap: 8px;
    }

    .tech-badge {
        font-size: 0.82rem;
        padding: 6px 12px;
    }

    .color-swatch {
        width: 44px;
        height: 44px;
    }

    .contrast-pairs {
        flex-direction: column;
    }

    .font-cards {
        grid-template-columns: 1fr;
    }

    .innsikt-card {
        padding: 20px;
    }
}

/* === Animations === */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-fire {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
