/* Enhanced CTA Section Styles - Production Ready */
/* Implements accessibility improvements and performance optimizations */

:root {
    /* CTA-specific color variables */
    --cta-urgent-color: #ff4757;
    --cta-urgent-color-dark: #ff3742;
    --cta-success-color: #10b981;
    --cta-success-color-dark: #059669;
    --cta-success-color-darker: #047857;
    --cta-backdrop-fallback: rgba(50, 50, 50, 0.5);
    --cta-backdrop-overlay: rgba(255, 255, 255, 0.05);
    --cta-backdrop-border: rgba(255, 255, 255, 0.1);
    --cta-backdrop-border-light: rgba(255, 255, 255, 0.2);
    --cta-text-secondary: rgba(255, 255, 255, 0.95);
    --cta-text-muted: rgba(255, 255, 255, 0.98);
}

/* Enhanced CTA Section Base Styles */
.cta-section {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 50%, #2d3748 100%);
    color: white;
    padding: var(--spacing-xxl, 6rem) 0;
    position: relative;
    overflow: hidden;
    border-top: 3px solid var(--primary-color, #0f172a);
    border-bottom: 3px solid var(--primary-color, #0f172a);
}

.cta-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(
            circle at 30% 20%,
            rgba(16, 185, 129, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 70% 80%,
            rgba(59, 130, 246, 0.1) 0%,
            transparent 50%
        );
    pointer-events: none;
}

.cta-section::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

/* Urgency Badge Styles */
.urgency-badge {
    background: linear-gradient(
        135deg,
        var(--cta-urgent-color),
        var(--cta-urgent-color-dark)
    );
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
    animation: urgency-pulse 2s infinite;
}

.urgency-icon {
    flex-shrink: 0;
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .urgency-badge {
        animation: none;
    }

    .cta-pulse {
        animation: none !important;
    }
}

@keyframes urgency-pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* CTA Section Typography */
.cta-section h2 {
    color: white;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    text-align: center;
    margin-bottom: var(--spacing-xl, 3rem);
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.headline-icon {
    color: var(--cta-success-color);
    flex-shrink: 0;
}

.cta-subtitle {
    color: #ffffff;
    font-size: 1.2rem;
    text-align: center !important;
    max-width: 900px;
    margin: 0 auto var(--spacing-xl, 3rem);
    line-height: 1.7;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Social Proof Bar */
.social-proof-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.social-proof-item {
    text-align: center;
    background: var(--cta-backdrop-fallback);
    background: var(--cta-backdrop-overlay);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--cta-backdrop-border-light);
    backdrop-filter: blur(10px);
    min-width: 140px;
}

.proof-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--cta-success-color);
    line-height: 1;
}

.proof-label {
    display: block;
    font-size: 0.85rem;
    color: #ffffff;
    margin-top: 0.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

/* Value Propositions */
.cta-value-props {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: var(--spacing-xl, 3rem);
    margin: var(--spacing-xl, 3rem) auto;
    max-width: 1000px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.value-props-title {
    color: #ffffff;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.enhanced-benefits {
    display: grid;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
    list-style: none;
    padding: 0;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--cta-backdrop-overlay);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--cta-success-color);
}

.benefit-icon {
    color: var(--cta-success-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.benefit-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.benefit-content strong {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.benefit-content span {
    color: #ffffff;
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

/* Scarcity Element */
.cta-scarcity {
    background: rgba(255, 71, 87, 0.2);
    border: 2px solid var(--cta-urgent-color);
    border-radius: var(--radius-lg, 12px);
    padding: var(--spacing-lg, 2rem);
    margin: var(--spacing-xl, 3rem) 0;
    text-align: center;
    animation: scarcity-glow 3s infinite;
}

.cta-scarcity p {
    margin: 0;
    font-size: 1rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    font-weight: 600;
    text-align: center !important;
}

.scarcity-icon {
    color: var(--cta-urgent-color);
    flex-shrink: 0;
}

@keyframes scarcity-glow {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 71, 87, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 71, 87, 0.5);
    }
}

/* Disable scarcity glow animation for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cta-scarcity {
        animation: none;
        box-shadow: 0 0 20px rgba(255, 71, 87, 0.3);
    }
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg, 2rem);
    margin: var(--spacing-xl, 3rem) 0;
    flex-wrap: wrap;
}

.cta-section .btn-primary {
    background: linear-gradient(
        135deg,
        var(--cta-success-color),
        var(--cta-success-color-dark)
    );
    border: none;
    padding: var(--spacing-md, 1rem) var(--spacing-xl, 3rem);
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
    text-transform: none;
    min-width: 280px;
    color: white;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.cta-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.5);
    background: linear-gradient(
        135deg,
        var(--cta-success-color-dark),
        var(--cta-success-color-darker)
    );
}

.cta-section .btn-secondary {
    background: transparent;
    border: 2px solid var(--cta-backdrop-border-light);
    color: white;
    padding: var(--spacing-md, 1rem) var(--spacing-xl, 3rem);
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 280px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.cta-section .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Button Focus States for Accessibility */
.cta-section .btn-primary:focus,
.cta-section .btn-secondary:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.cta-section .btn-primary:focus {
    box-shadow:
        0 8px 24px rgba(16, 185, 129, 0.4),
        0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* Enhanced Guarantee */
.enhanced-guarantee {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--cta-success-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 800px;
    text-align: center;
}

.guarantee-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.shield-icon {
    color: var(--cta-success-color);
    flex-shrink: 0;
}

.guarantee-badge strong {
    color: var(--cta-success-color);
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.enhanced-guarantee p {
    color: #ffffff;
    margin: 0;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

/* Trust Indicators */
.trust-indicators {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

.trust-icon {
    color: var(--cta-success-color);
    font-weight: bold;
    flex-shrink: 0;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .cta-section {
        padding: var(--spacing-xxl, 4rem) 0;
    }

    .cta-value-props {
        padding: var(--spacing-lg, 2rem);
    }

    .social-proof-bar {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .cta-section h2 {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        flex-direction: column;
        gap: 0.5rem;
    }

    .cta-subtitle {
        font-size: 1.1rem;
        padding: 0 1rem;
    }

    .social-proof-item {
        padding: 0.75rem 1rem;
        min-width: 120px;
    }

    .proof-number {
        font-size: 1.5rem;
    }

    .trust-indicators {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }

    .benefit-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .benefit-icon {
        align-self: center;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-section .btn-primary,
    .cta-section .btn-secondary {
        width: 100%;
        max-width: 320px;
    }

    .cta-scarcity {
        padding: 1rem;
    }

    .cta-scarcity p {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .cta-section {
        padding: var(--spacing-xl, 3rem) 0;
    }

    .social-proof-bar {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .social-proof-item {
        width: 100%;
        max-width: 200px;
    }

    .enhanced-guarantee {
        margin: 1.5rem auto;
        padding: 1rem;
    }
}

/* Hero Section Text Alignment and Readability Fixes */
.hero-content p[data-i18n="home.hero.subtitle"] {
    text-align: center !important;
    color: var(--medium-text);
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-lg, 2rem);
}

.social-proof-mini p[data-i18n="home.hero.socialProof"] {
    text-align: center !important;
    color: var(--medium-text);
    font-weight: 500;
    font-size: 1.1rem;
    margin-top: var(--spacing-lg, 2rem);
}

/* Ensure center alignment overrides on all screen sizes */
@media (min-width: 768px) {
    .hero-content p[data-i18n="home.hero.subtitle"] {
        text-align: center !important;
    }

    .social-proof-mini p[data-i18n="home.hero.socialProof"] {
        text-align: center !important;
    }
}

@media (min-width: 1024px) {
    .hero-content p[data-i18n="home.hero.subtitle"] {
        text-align: center !important;
    }

    .social-proof-mini p[data-i18n="home.hero.socialProof"] {
        text-align: center !important;
    }
}

/* Enhanced text readability */
.benefit-content span {
    color: rgba(255, 255, 255, 0.96);
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.enhanced-guarantee p {
    color: rgba(255, 255, 255, 0.98);
    margin: 0;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cta-section {
        border-top-width: 5px;
        border-bottom-width: 5px;
        background: linear-gradient(
            135deg,
            #1a1a1a 0%,
            #333333 50%,
            #1a1a1a 100%
        );
    }

    .urgency-badge,
    .cta-scarcity {
        border-width: 3px;
        background: #ff4757 !important;
        color: white !important;
    }

    .social-proof-item,
    .cta-value-props,
    .enhanced-guarantee {
        border-width: 2px;
        background: rgba(255, 255, 255, 0.25) !important;
    }

    /* Force higher contrast text in high contrast mode */
    .cta-subtitle,
    .benefit-content span,
    .enhanced-guarantee p,
    .proof-label,
    .trust-item {
        color: white !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
        font-weight: 600 !important;
    }

    .benefit-content strong,
    .value-props-title {
        color: white !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
        font-weight: 800 !important;
    }
}

/* Additional readability improvements */
.value-props-title {
    color: white;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Ensure urgency badge text is always readable */
.urgency-badge {
    background: linear-gradient(
        135deg,
        var(--cta-urgent-color),
        var(--cta-urgent-color-dark)
    );
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
    animation: urgency-pulse 2s infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Improve scarcity text readability */
.cta-scarcity p strong {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Enhanced readability for all screen conditions */
.cta-section {
    /* Add subtle texture overlay for better text contrast */
}

.cta-section::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(
            45deg,
            rgba(0, 0, 0, 0.02) 25%,
            transparent 25%,
            transparent 75%,
            rgba(0, 0, 0, 0.02) 75%
        ),
        linear-gradient(
            -45deg,
            rgba(0, 0, 0, 0.02) 25%,
            transparent 25%,
            transparent 75%,
            rgba(0, 0, 0, 0.02) 75%
        );
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* Ensure all content appears above texture */
.cta-section > * {
    position: relative;
    z-index: 1;
}

/* Additional text shadow for better readability */
.social-proof-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.proof-number {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Improved button contrast */
.cta-section .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
}

.cta-section .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}
