/* Custom Premium Styles for AEO Visibility Web App */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #070a13;
    --bg-secondary: #0c1020;
    --bg-card: rgba(15, 22, 42, 0.65);
    --bg-card-hover: rgba(22, 32, 60, 0.8);
    
    --border-color: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(99, 102, 241, 0.55);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #6366f1; /* Indigo */
    --accent-primary-glow: rgba(99, 102, 241, 0.25);
    --accent-secondary: #06b6d4; /* Cyan */
    --accent-secondary-glow: rgba(6, 182, 212, 0.2);
    
    --accent-success: #10b981; /* Emerald */
    --accent-success-glow: rgba(16, 185, 129, 0.15);
    --accent-danger: #ef4444; /* Red */
    --accent-danger-glow: rgba(239, 68, 68, 0.15);
    
    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-glow: 0 0 40px -10px rgba(99, 102, 241, 0.25);
    --glass-blur: blur(16px);
}

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

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

/* Background Gradients */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.glow-circle {
    position: absolute;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    filter: blur(180px);
    opacity: 0.18;
}

.glow-1 {
    background: var(--accent-primary);
    top: -250px;
    right: -100px;
}

.glow-2 {
    background: var(--accent-secondary);
    bottom: -250px;
    left: -100px;
}

/* Header */
header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Main Container */
main {
    flex-grow: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3.5rem;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.04em;
    margin-bottom: 1.25rem;
    background: linear-gradient(to bottom right, #ffffff 30%, #a5b4fc, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
}

/* Glassmorphic Container Card */
.card-container {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-glow);
    transition: var(--transition-smooth);
}

.hidden {
    display: none !important;
}

/* 1. Form View */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.input-field {
    width: 100%;
    background-color: rgba(9, 13, 24, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.1rem 1.25rem 1.1rem 3rem;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.input-field:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
    background-color: rgba(9, 13, 24, 0.9);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 14px;
    padding: 1.2rem;
    color: white;
    font-family: var(--font-family);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    transition: var(--transition-smooth);
    margin-top: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.45);
}

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

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 2. Loader View */
.loader-view {
    text-align: center;
    padding: 2rem 0;
}

.spinner-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem auto;
}

.spinner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top: 4px solid var(--accent-primary);
    border-right: 4px solid var(--accent-secondary);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.spinner-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loader-status {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.progress-steps {
    max-width: 320px;
    margin: 0 auto;
    text-align: left;
    list-style: none;
}

.step {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-smooth);
}

.step.active {
    color: var(--accent-secondary);
    font-weight: 500;
}

.step.completed {
    color: var(--accent-success);
}

.step-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
    transition: var(--transition-smooth);
}

.step.active .step-bullet {
    background-color: var(--accent-secondary);
    box-shadow: 0 0 10px var(--accent-secondary);
    transform: scale(1.3);
}

.step.completed .step-bullet {
    background-color: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

/* 3. Results Dashboard View */
.results-header {
    text-align: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(6, 182, 212, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 18px;
    margin-bottom: 2.5rem;
}

.results-header h3 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.results-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.results-meta span strong {
    color: var(--text-primary);
}

/* KPI Blocks */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.kpi-card {
    background-color: rgba(9, 13, 24, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.75rem 1.25rem;
    text-align: center;
    transition: var(--transition-smooth);
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.12);
}

.kpi-val {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.kpi-val-primary {
    color: var(--accent-secondary);
}

.kpi-val-indigo {
    color: #a5b4fc;
}

.kpi-val-cyan {
    color: #22d3ee;
}

.kpi-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Market Comparison Table */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 3rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background-color: rgba(9, 13, 24, 0.4);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background-color: rgba(15, 22, 42, 0.8);
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1.1rem 1.25rem;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

/* Badge classes */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-success {
    background-color: var(--accent-success-glow);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-danger {
    background-color: var(--accent-danger-glow);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-category {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Toggle Accordion Content */
.btn-toggle {
    background: none;
    border: none;
    color: var(--accent-secondary);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.btn-toggle:hover {
    background-color: rgba(6, 182, 212, 0.1);
}

.details-row {
    background-color: rgba(9, 13, 24, 0.6);
}

.details-row td {
    padding: 0 1.25rem;
}

.details-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.details-content-inner {
    padding: 1.25rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
}

.details-content-inner strong {
    color: var(--text-primary);
}

.details-snippet {
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-top: 0.5rem;
    border-left: 3px solid var(--accent-primary);
    font-style: italic;
    line-height: 1.5;
}

/* CTA Lead Magnet Banner */
.cta-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 18px;
    padding: 2.25rem;
    text-align: center;
    margin-top: 1rem;
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.2);
}

.cta-banner h4 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.cta-banner p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn-cta {
    display: inline-block;
    background-color: var(--text-primary);
    color: var(--bg-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.8rem 1.75rem;
    border-radius: 10px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
    background-color: #ffffff;
}

.btn-secondary {
    display: block;
    width: 100%;
    max-width: 250px;
    margin: 2rem auto 0 auto;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2.25rem;
    }
    
    .card-container {
        padding: 2rem 1.5rem;
    }
    
    .kpis-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .results-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    td, th {
        padding: 0.8rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Modal Overlay styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: rgba(6, 8, 14, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: auto;
    background-color: rgba(15, 22, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 2.25rem 2rem 2rem;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), var(--shadow-glow);
    text-align: center;
    animation: modalFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    padding-right: 1.5rem;
}

.modal-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 1.5rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 20;
    touch-action: manipulation;
}

.modal-close:hover,
.modal-close:active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.18);
    transform: scale(1.05);
}

.btn-skip {
    display: inline-block;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: var(--transition-smooth);
    padding: 0.5rem 1rem;
    touch-action: manipulation;
}

.btn-skip:hover,
.btn-skip:active {
    color: var(--text-primary);
}

.modal-input {
    background-color: rgba(9, 13, 24, 0.85) !important;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 576px) {
    .modal-overlay {
        padding: 0.75rem 0.5rem;
        align-items: flex-start;
    }

    .modal-card {
        padding: 1.5rem 1.15rem 1.25rem;
        border-radius: 18px;
        max-height: 94dvh;
        max-height: 94vh;
        margin-top: auto;
        margin-bottom: auto;
    }

    .modal-card h3 {
        font-size: 1.2rem;
        margin-top: 0.25rem;
        padding-right: 2rem;
        text-align: left;
    }

    .modal-desc {
        font-size: 0.82rem;
        margin-bottom: 1rem;
        text-align: left;
        line-height: 1.4;
    }

    .modal-card .form-group {
        margin-bottom: 0.65rem;
        text-align: left;
    }

    .modal-card .form-group label {
        font-size: 0.78rem;
        margin-bottom: 0.25rem;
    }

    .modal-card .input-wrapper {
        padding: 0.6rem 0.75rem;
    }

    .modal-card .input-field {
        font-size: 16px;
    }

    .modal-card .btn-primary {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        margin-top: 0.5rem !important;
    }

    .btn-skip {
        margin-top: 0.75rem;
        font-size: 0.8rem;
    }

    .modal-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
}

/* Honeypot field for bot protection */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
