/* ======================
   SEO Analyzer Pro - Frontend Styles
   ====================== */

:root {
    --seo-primary: #4F46E5;
    --seo-primary-dark: #4338CA;
    --seo-success: #10B981;
    --seo-warning: #F59E0B;
    --seo-error: #EF4444;
    --seo-gray-50: #F9FAFB;
    --seo-gray-100: #F3F4F6;
    --seo-gray-200: #E5E7EB;
    --seo-gray-300: #D1D5DB;
    --seo-gray-400: #9CA3AF;
    --seo-gray-500: #6B7280;
    --seo-gray-700: #374151;
    --seo-gray-900: #111827;
    --seo-radius: 12px;
    --seo-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --seo-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

/* Wrapper */
.seo-analyzer-wrapper {
    max-width: 680px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--seo-gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.seo-analyzer-wrapper * {
    box-sizing: border-box;
}

/* Steps */
.seo-step {
    animation: seoFadeIn 0.4s ease;
}

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

/* Header */
.seo-header {
    text-align: center;
    margin-bottom: 32px;
}

.seo-icon-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--seo-primary), #7C3AED);
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.seo-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--seo-gray-900);
}

.seo-subtitle {
    font-size: 16px;
    color: var(--seo-gray-500);
    margin: 0;
}

/* Input Group */
.seo-input-group {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.seo-input-wrapper {
    flex: 1;
    position: relative;
}

.seo-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    z-index: 1;
}

.seo-input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    font-size: 16px;
    border: 2px solid var(--seo-gray-200);
    border-radius: var(--seo-radius);
    outline: none;
    transition: all 0.2s ease;
    background: #fff;
    color: var(--seo-gray-900);
    font-family: inherit;
}

.seo-input:focus {
    border-color: var(--seo-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.seo-form-group .seo-input {
    padding-left: 16px;
}

/* Buttons */
.seo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--seo-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.seo-btn-primary {
    background: linear-gradient(135deg, var(--seo-primary), #7C3AED);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.seo-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

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

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

.seo-btn-outline {
    background: #fff;
    color: var(--seo-primary);
    border: 2px solid var(--seo-primary);
}

.seo-btn-outline:hover {
    background: var(--seo-gray-50);
}

.seo-btn-full {
    width: 100%;
}

/* Spinner */
.seo-spinner {
    animation: seoSpin 0.8s linear infinite;
}

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

/* Error */
.seo-error {
    color: var(--seo-error);
    font-size: 14px;
    margin: 10px 0 0;
    text-align: center;
}

/* === Loading Step === */
.seo-loading-container {
    text-align: center;
    padding: 40px 0;
}

.seo-progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.seo-progress-ring svg {
    width: 100%;
    height: 100%;
}

.seo-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
    color: var(--seo-primary);
}

.seo-loading-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
}

.seo-loading-status {
    color: var(--seo-gray-500);
    font-size: 14px;
    margin: 0;
    transition: opacity 0.3s;
}

/* === Score Section === */
.seo-score-section {
    text-align: center;
    padding: 30px 0;
}

.seo-score-ring {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 16px;
}

.seo-score-ring svg {
    width: 100%;
    height: 100%;
}

.seo-score-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.seo-score-value {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
}

.seo-score-label {
    font-size: 16px;
    color: var(--seo-gray-400);
}

.seo-grade-badge {
    display: inline-block;
    padding: 6px 20px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 30px;
    margin-bottom: 8px;
}

.seo-score-message {
    color: var(--seo-gray-500);
    font-size: 15px;
    margin: 0;
}

/* Summary Cards */
.seo-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

.seo-summary-card {
    text-align: center;
    padding: 16px;
    border-radius: var(--seo-radius);
}

.seo-summary-card.success { background: #ECFDF5; }
.seo-summary-card.warning { background: #FFFBEB; }
.seo-summary-card.error { background: #FEF2F2; }

.seo-summary-count {
    display: block;
    font-size: 28px;
    font-weight: 800;
}

.seo-summary-card.success .seo-summary-count { color: #065F46; }
.seo-summary-card.warning .seo-summary-count { color: #92400E; }
.seo-summary-card.error .seo-summary-count { color: #991B1B; }

.seo-summary-label {
    font-size: 13px;
    color: var(--seo-gray-500);
}

/* Results Preview with blur */
.seo-results-preview {
    position: relative;
}

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

.seo-check-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border-radius: var(--seo-radius);
    border: 1px solid var(--seo-gray-200);
    transition: box-shadow 0.2s;
}

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

.seo-check-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.seo-check-icon.success { background: #ECFDF5; }
.seo-check-icon.warning { background: #FFFBEB; }
.seo-check-icon.error { background: #FEF2F2; }
.seo-check-icon.info { background: #EFF6FF; }

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

.seo-check-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.seo-check-message {
    font-size: 14px;
    color: var(--seo-gray-500);
    margin: 0;
}

/* Blur Overlay */
.seo-blur-overlay {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 15%, rgba(255,255,255,0.95) 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10;
}

.seo-unlock-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--seo-shadow-lg);
    border: 1px solid var(--seo-gray-200);
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.seo-unlock-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.seo-unlock-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
}

.seo-unlock-card p {
    color: var(--seo-gray-500);
    font-size: 14px;
    margin: 0 0 20px;
}

.seo-form-group {
    margin-bottom: 12px;
}

.seo-privacy-note {
    font-size: 12px !important;
    color: var(--seo-gray-400) !important;
    margin: 12px 0 0 !important;
}

/* === Success Step === */
.seo-success-container {
    text-align: center;
    padding: 40px 0 30px;
}

.seo-success-icon {
    font-size: 60px;
    margin-bottom: 16px;
    animation: seoBounce 0.5s ease;
}

@keyframes seoBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.seo-success-container h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
}

.seo-success-container p {
    color: var(--seo-gray-500);
    margin: 0 0 24px;
}

.seo-full-results {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--seo-gray-200);
}

/* Category header in results */
.seo-category-header {
    font-size: 16px;
    font-weight: 700;
    color: var(--seo-gray-700);
    margin: 20px 0 8px;
    padding-left: 4px;
}

.seo-category-header:first-child {
    margin-top: 0;
}

/* === Responsive === */
@media (max-width: 640px) {
    .seo-analyzer-wrapper {
        margin: 20px 16px;
    }

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

    .seo-title {
        font-size: 22px;
    }

    .seo-summary-cards {
        gap: 8px;
    }

    .seo-summary-count {
        font-size: 22px;
    }

    .seo-unlock-card {
        padding: 24px 20px;
    }
}
