/* ==========================================================================
   SEO Analyzer JS - Modern Stylesheet
   ========================================================================== */

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, #091e3a 0%, #1e3a8a 50%, #0f172a 100%);
    color: #ffffff;
    padding: 3.5rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #ffffff 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.js-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2.2rem;
}

.js-feature-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-align: left;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.js-feature-badge:hover {
    transform: translateY(-2px);
    border-color: rgba(147, 197, 253, 0.4);
}

.js-feature-badge i {
    font-size: 1.5rem;
    color: #60a5fa;
    flex-shrink: 0;
}

.js-feature-badge h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f8fafc;
    margin: 0 0 0.2rem;
}

.js-feature-badge p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.3;
}

/* --- Form Container --- */
.analyzer-form-box {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.6rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    max-width: 760px;
    margin: 0 auto;
}

.analyzer-input-group {
    display: flex;
    gap: 0.5rem;
}

.analyzer-input-group input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #ffffff;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.analyzer-input-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.analyzer-input-group .btn-primary {
    padding: 1rem 1.8rem;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.analyzer-input-group .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

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

/* Validation Tooltip */
.validation-tooltip {
    position: absolute;
    bottom: -30px;
    left: 10px;
    background: #ef4444;
    color: #ffffff;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 10;
}

/* --- Loading & Error States --- */
.loading-state, .error-state {
    max-width: 600px;
    margin: 2rem auto 0;
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 1px solid #e2e8f0;
}

.loading-spinner {
    font-size: 2.5rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.loading-state p {
    font-size: 1.1rem;
    color: #334155;
    font-weight: 600;
}

.error-state {
    border-top: 4px solid #ef4444;
}

.error-icon {
    font-size: 2.5rem;
    color: #ef4444;
    margin-bottom: 0.8rem;
}

.error-state h4 {
    font-size: 1.3rem;
    color: #b91c1c;
    margin-bottom: 0.5rem;
}

.error-state p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* --- Results Section --- */
.seo-results-section {
    padding: 3.5rem 0;
    background: #f8fafc;
}

.results-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.results-header h3 {
    font-size: 1.9rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.results-header p {
    font-size: 1.05rem;
    color: #64748b;
}

/* Score Overview */
.seo-score-dashboard {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2.5rem;
    align-items: center;
    margin-bottom: 2.5rem;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.score-circle {
    width: 125px;
    height: 125px;
    border-radius: 50%;
    border: 8px solid #3b82f6;
    background: #eff6ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #1d4ed8;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.score-circle.good {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #15803d;
}

.score-circle.warning {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #b45309;
}

.score-circle.error {
    border-color: #ef4444;
    background: #fef2f2;
    color: #b91c1c;
}

.score-number {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

.score-max {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

.score-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
}

.score-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
}

.score-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

/* Analysis Field Cards */
.seo-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.seo-field {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.seo-field.full-width {
    grid-column: 1 / -1;
}

.seo-field label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.seo-field label i {
    color: #3b82f6;
}

.field-container {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.field-container textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #1e293b;
    font-family: inherit;
    resize: vertical;
    outline: none;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s ease;
}

.field-container textarea:focus {
    border-color: #3b82f6;
    background: #ffffff;
}

.field-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.char-count, .word-count {
    color: #64748b;
    font-weight: 600;
    background: #f1f5f9;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.advice {
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.8rem;
    background: #eff6ff;
    color: #1d4ed8;
}

.advice.good {
    background: #dcfce7;
    color: #15803d;
}

.advice.warning {
    background: #fef3c7;
    color: #b45309;
}

.advice.error {
    background: #fee2e2;
    color: #b91c1c;
}

/* Recommendations & Keywords Cards */
.seo-card-section {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.seo-card-section h4, .seo-card-section h5 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.seo-card-section h4 i, .seo-card-section h5 i {
    color: #3b82f6;
}

.recommendations-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recommendations-list li {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    padding: 0.85rem 1.1rem;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.5;
}

/* Keyword Cloud & Matching */
.frequency-analysis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.most-frequent h6, .keyword-matching h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.85rem;
}

.word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.word-tag {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.word-tag.high-frequency {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    font-weight: 700;
}

.word-tag.medium-frequency {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
}

.word-tag.low-frequency {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

/* Keyword Match Item */
.keyword-match-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-match-word strong {
    color: #0f172a;
    font-size: 0.95rem;
}

.keyword-match-word .frequency {
    color: #64748b;
    font-size: 0.8rem;
    margin-left: 0.3rem;
}

.keyword-match-presence {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.presence-indicator {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.presence-indicator.present {
    background: #dcfce7;
    color: #15803d;
}

.presence-indicator.absent {
    background: #fee2e2;
    color: #b91c1c;
    opacity: 0.6;
}

.coverage-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    margin-left: 0.4rem;
}

.coverage-status.good {
    background: #22c55e;
    color: #ffffff;
}

.coverage-status.partial {
    background: #f59e0b;
    color: #ffffff;
}

.coverage-status.poor {
    background: #ef4444;
    color: #ffffff;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.tip-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
}

.tip-card h5 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.tip-card p {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

/* --- Educational Guide Sections --- */
.guide-section {
    padding: 4rem 0;
    background: #ffffff;
}

.guide-section.alt-bg {
    background: #f8fafc;
}

.section-header {
    text-align: center;
    max-width: 750px;
    margin: 0 auto 3rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.section-header p {
    font-size: 1.05rem;
    color: #64748b;
    line-height: 1.6;
}

.steps-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.timeline-step {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.step-number {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.timeline-step h3 {
    font-size: 1.15rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.timeline-step p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* CTA */
.cta-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #ffffff;
    text-align: center;
    padding: 4.5rem 0;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #ffffff;
}

.cta-content p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
}

.cta-content .btn-primary {
    font-size: 1.1rem;
    padding: 1rem 2.2rem;
    border-radius: 10px;
    background: #ffffff;
    color: #1e3a8a;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
}

.cta-content .btn-primary:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 1.75rem;
    }
    .analyzer-input-group {
        flex-direction: column;
    }
    .seo-score-dashboard {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .score-display {
        justify-content: center;
    }
    .score-breakdown {
        grid-template-columns: 1fr;
    }
}
