/* Global Improvements CSS */
:root {
    --primary-purple: #6a4bc4;
    --primary-dark: #4b0082;
    --accent-gold: #ffd700;
    --accent-gold-dark: #d4af37;
    --bg-light: #f8f9fa;
    --text-dark: #1a1a1a;
    --text-muted: #4a5568;
    --border-radius-md: 8px;
    --spacing-md: 20px;

    /* Missing variables mapped to existing palette or standard colors */
    --purple-deep: var(--primary-dark);
    --indigo-deep: #283593;
    /* New deep indigo for technical headings */
    --primary-color: var(--primary-purple);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

/* Structural Components */
.statistical-proof-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--spacing-md);
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.statistical-proof-box h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: #fff;
}

.stat-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-gold);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.authority-notice {
    background-color: var(--bg-light);
    border-left: 4px solid var(--primary-purple);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.authority-notice h5 {
    color: var(--primary-purple);
    margin-top: 0;
}

.citation-box {
    margin-top: 10px;
    padding: 10px;
    background: rgba(106, 75, 196, 0.1);
    border-radius: 6px;
    font-size: 0.9em;
}

/* Learning Pages Components */
.featured-snippet-box {
    background: rgba(106, 75, 196, 0.1);
    padding: 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-purple);
}

.ai-definition {
    background: rgba(75, 196, 106, 0.1);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.comparison-table-wrapper {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.comparison-table th,
.comparison-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.comparison-table th {
    background: rgba(106, 75, 196, 0.2);
}

.comparison-table td {
    border-color: rgba(255, 255, 255, 0.1);
}

.comparison-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* FAQ Section Cleanup */
.faq-intro {
    background: var(--bg-light);
    padding: 15px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.tech-detail h4 {
    color: var(--primary-purple);
    margin-bottom: 8px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.practice-bridge {
    border-left: 4px solid var(--accent-gold-dark);
    margin: 25px 0;
    background: rgba(212, 175, 55, 0.05);
    padding: 20px;
    border-radius: var(--border-radius-md);
}

.citation-facts {
    background: rgba(255, 196, 75, 0.1);
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

.expert-quote {
    border-left: 4px solid var(--primary-purple);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
}

.research-citation {
    background: rgba(106, 196, 75, 0.1);
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

.technical-accuracy {
    background: rgba(196, 106, 75, 0.1);
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

.methodology-note {
    margin: 15px auto 0;
    font-size: 0.95rem;
    opacity: 1;
    /* Fix: Full opacity for clarity */
    color: white;
    /* Fix: Ensure white text on dark background */
    text-align: center;
    /* Fix: Explicit centering */
    max-width: 100%;
}

.final-cta-enhanced {
    background: linear-gradient(135deg, #4b0082 0%, #6b46c1 100%);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 12px;
    margin: 30px 0;
}

.action-button-gold {
    background-color: var(--accent-gold);
    color: var(--text-dark);
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    transition: transform 0.2s;
}

.action-button-gold:hover {
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text-dark);
}

.action-button-gold.large {
    font-size: 1.2rem;
    padding: 15px 30px;
}

/* Footer Components */
.footer-content {
    padding: 40px 0 20px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
    align-items: start;
    /* Fix: Vertical alignment top */
}

.footer-section h4 {
    color: var(--accent-gold);
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--bg-light);
    /* Use variable */
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-gold);
    text-decoration: underline;
}

.footer-cta {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 0 auto 20px;
    /* Fix: Center horizontally */
    max-width: 100%;
    /* Fix: Prevent overflow on small screens */
    box-sizing: border-box;
    /* Fix: Include padding in width calc */
}

@media (min-width: 769px) {
    .footer-cta {
        max-width: 600px;
        /* Fix: Constrain width on desktop for better visual centering */
    }
}

.footer-cta p {
    margin: 0;
    /* Remove default paragraph margin */
}

.footer-cta-link {
    color: var(--accent-gold);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 2px;
}

.footer-cta-link:hover {
    background-color: var(--accent-gold);
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 4px;
    border-bottom: none;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .footer-cta strong {
        display: block;
        /* Force new line for label on mobile */
        margin-bottom: 8px;
        color: var(--text-muted);
        /* Softer color for label */
    }

    .footer-cta-link {
        display: inline-block;
        /* Better control for padding/border */
        font-size: 1.1rem;
        /* Slightly larger touch target */
    }
}

.footer-copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Base Mobile Styles */
@media (max-width: 768px) {
    .footer-links {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
        /* Fix: Center alignment on mobile */
    }

    .footer-content {
        padding: 30px 0 15px;
    }
}

/* Mobile Sticky CTA */
@media (max-width: 768px) {
    .mobile-sticky-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 15px;
        background: linear-gradient(to top, #ffffff 80%, rgba(255, 255, 255, 0.8) 100%);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        text-align: center;
    }

    .mobile-sticky-cta .action-button-gold {
        min-height: 48px;
        width: 100%;
        max-width: 280px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        font-weight: 600;
        text-decoration: none;
        border-radius: 8px;
        padding: 12px 20px;
    }

    /* Add bottom padding to body when sticky CTA is present */
    body.has-sticky-cta {
        padding-bottom: 80px;
    }
}