/* ============================================
   SEO CHECKER — Page Styles
   ============================================ */

/* ── App Container ── */
#seo-app {
    padding-top: calc(var(--header-height) + var(--space-12));
    padding-bottom: var(--space-16);
    min-height: 80vh;
}

/* ============================================
   STATE 1: INTRO
   ============================================ */

.seo-hero {
    text-align: center;
    padding: var(--space-16) 0 var(--space-12);
    max-width: 640px;
    margin: 0 auto;
}

.seo-hero h1 {
    font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
    margin-bottom: var(--space-4);
}

.seo-hero p {
    font-size: var(--text-lg);
    color: var(--gray-500);
    margin: 0 auto var(--space-8);
    max-width: 480px;
    line-height: 1.6;
}

.seo-input-group {
    display: flex;
    gap: var(--space-3);
    max-width: 520px;
    margin: 0 auto var(--space-4);
}

.seo-input {
    flex: 1;
    padding: var(--space-4) var(--space-5);
    font-family: var(--font-text);
    font-size: var(--text-base);
    color: var(--gray-900);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    outline: none;
    transition: border-color var(--duration-base) var(--ease-out);
}

.seo-input:focus {
    border-color: var(--accent);
}

.seo-input::placeholder {
    color: var(--gray-400);
}

.seo-hero .seo-trust {
    font-size: var(--text-sm);
    color: var(--gray-400);
    margin-top: var(--space-4);
}

.seo-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    max-width: 520px;
    margin: var(--space-8) auto 0;
}

.seo-feature {
    text-align: center;
    padding: var(--space-3);
}

.seo-feature-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-light);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin: 0 auto var(--space-2);
}

.seo-feature-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--gray-600);
}

/* ============================================
   STATE 2: LOADING
   ============================================ */

.seo-loading {
    text-align: center;
    padding: var(--space-20) 0;
    max-width: 480px;
    margin: 0 auto;
}

.seo-loading h2 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-6);
}

.seo-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: seoSpin 0.8s linear infinite;
    margin: 0 auto var(--space-6);
}

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

.seo-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--border-radius-full);
    overflow: hidden;
    margin-bottom: var(--space-4);
}

.seo-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--border-radius-full);
    transition: width 0.5s var(--ease-out);
    width: 0%;
}

.seo-loading-status {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.seo-loading-url {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--gray-400);
    margin-top: var(--space-2);
    word-break: break-all;
}

/* ============================================
   STATE 3: RESULTS
   ============================================ */

.seo-results {
    max-width: 880px;
    margin: 0 auto;
}

.seo-results-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.seo-results-header h1 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-2);
}

.seo-results-header p {
    color: var(--gray-500);
    margin: 0 auto;
}

.seo-results-url {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--gray-400);
    margin-top: var(--space-2);
    word-break: break-all;
}

/* ── Score Ring (reuses audit patterns) ── */
.seo-score-ring-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-10);
}

.seo-score-ring {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(
        var(--ring-color, var(--accent)) calc(var(--score-pct, 0) * 1%),
        var(--gray-200) calc(var(--score-pct, 0) * 1%)
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.seo-score-ring-inner {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--off-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.seo-score-ring-value {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.seo-score-ring-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

.seo-score-ring-grade {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    margin-top: var(--space-1);
}

/* ── Category Cards ── */
.seo-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-10);
}

.seo-category-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    transition: all var(--duration-base) var(--ease-out);
}

.seo-category-card:hover {
    box-shadow: var(--shadow-md);
}

.seo-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.seo-category-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray-900);
}

.seo-category-score {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 600;
}

.seo-category-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--border-radius-full);
    overflow: hidden;
    margin-bottom: var(--space-3);
}

.seo-category-bar-fill {
    height: 100%;
    border-radius: var(--border-radius-full);
    transition: width 0.8s var(--ease-out);
}

.seo-category-weight {
    font-size: var(--text-xs);
    color: var(--gray-400);
}

/* ── Detailed Checks ── */
.seo-checks-section {
    margin-bottom: var(--space-10);
}

.seo-checks-section h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--gray-200);
}

.seo-check-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.seo-check-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    transition: all var(--duration-base) var(--ease-out);
}

.seo-check-item:hover {
    box-shadow: var(--shadow-sm);
}

.seo-check-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.seo-check-status--pass {
    background: var(--success-light);
    color: var(--success);
}

.seo-check-status--warn {
    background: rgba(245, 166, 35, 0.1);
    color: #F5A623;
}

.seo-check-status--fail {
    background: rgba(255, 59, 48, 0.08);
    color: var(--danger);
}

.seo-check-status svg {
    width: 14px;
    height: 14px;
}

.seo-check-content {
    flex: 1;
    min-width: 0;
}

.seo-check-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.seo-check-value {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: var(--space-1);
    word-break: break-all;
}

.seo-check-recommendation {
    font-size: var(--text-xs);
    color: var(--gray-400);
    line-height: 1.5;
}

/* ── Action Buttons ── */
.seo-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-10);
}

/* ── Email Form ── */
.seo-email-form {
    max-width: 480px;
    margin: 0 auto var(--space-10);
    padding: var(--space-6);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    display: none;
}

.seo-email-form.visible {
    display: block;
}

.seo-email-form h4 {
    font-size: var(--text-base);
    margin-bottom: var(--space-4);
    text-align: center;
}

.seo-form-group {
    margin-bottom: var(--space-3);
}

.seo-form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: var(--space-1);
}

.seo-form-group input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    color: var(--gray-900);
    background: var(--off-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    outline: none;
    transition: border-color var(--duration-base) var(--ease-out);
}

.seo-form-group input:focus {
    border-color: var(--accent);
}

.seo-form-actions {
    display: flex;
    justify-content: center;
    margin-top: var(--space-4);
}

.seo-email-success {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--success);
    margin-top: var(--space-3);
    display: none;
}

.seo-email-error {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--danger);
    margin-top: var(--space-3);
    display: none;
}

/* ── Results CTA ── */
.seo-results-cta {
    background: var(--gray-900);
    border-radius: var(--border-radius-lg);
    padding: var(--space-10) var(--space-8);
    text-align: center;
}

.seo-results-cta h3 {
    color: var(--white);
    font-size: var(--text-2xl);
    margin-bottom: var(--space-3);
}

.seo-results-cta p {
    color: var(--gray-400);
    max-width: 480px;
    margin: 0 auto var(--space-6);
    font-size: var(--text-base);
}

.seo-results-cta .btn-primary {
    background: var(--white);
    color: var(--gray-900);
}

.seo-results-cta .btn-primary:hover {
    background: var(--gray-200);
}

/* ============================================
   STATE 4: ERROR
   ============================================ */

.seo-error {
    text-align: center;
    padding: var(--space-20) 0;
    max-width: 480px;
    margin: 0 auto;
}

.seo-error-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 59, 48, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    margin: 0 auto var(--space-6);
}

.seo-error-icon svg {
    width: 32px;
    height: 32px;
}

.seo-error h2 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-3);
}

.seo-error p {
    color: var(--gray-500);
    margin: 0 auto var(--space-6);
    max-width: 400px;
}

/* ============================================
   ANIMATIONS
   ============================================ */

.seo-fade-in {
    animation: seoFadeIn 0.5s var(--ease-out) forwards;
}

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

.seo-fade-in:nth-child(2) { animation-delay: 0.05s; }
.seo-fade-in:nth-child(3) { animation-delay: 0.1s; }
.seo-fade-in:nth-child(4) { animation-delay: 0.15s; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    #seo-app {
        padding-top: calc(var(--header-height) + var(--space-8));
    }

    .seo-hero {
        padding: var(--space-10) 0 var(--space-8);
    }

    .seo-input-group {
        flex-direction: column;
    }

    .seo-features {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .seo-categories {
        grid-template-columns: 1fr;
    }

    .seo-score-ring {
        width: 160px;
        height: 160px;
    }

    .seo-score-ring-inner {
        width: 124px;
        height: 124px;
    }

    .seo-score-ring-value {
        font-size: var(--text-3xl);
    }

    .seo-results-cta {
        padding: var(--space-8) var(--space-6);
    }

    .seo-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .seo-categories {
        grid-template-columns: 1fr;
    }
}
