/* =====================================================
   ALAVANKA UX-ENHANCED STYLES v3.0
   Complete visual formatting + UX improvements
   AUDIT DATE: 2026-02-06
   PRIORITIES: P0 + P1 implemented
   ===================================================== */

/* ===== CRITICAL UX ENHANCEMENTS ===== */

/* P0-1: Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 72px;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--warm));
    z-index: 1001;
    transition: width 0.1s linear;
}

@media (min-width: 768px) {
    .scroll-progress { top: 80px; }
}

@media (min-width: 1024px) {
    .scroll-progress { top: 88px; }
}

/* P0-2: Mobile Sticky CTA (Optimized) */
.mobile-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 998;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none; /* Show only on mobile */
}

.mobile-sticky-cta.visible {
    transform: translateY(0);
}

.mobile-sticky-cta .btn-mobile-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px; /* P0-3: Touch target compliance */
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--warm), var(--warm-dark));
    color: white;
    border: none;
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(200, 150, 90, 0.35);
    transition: all 0.2s ease;
}

.mobile-sticky-cta .btn-mobile-primary:active {
    transform: scale(0.98);
}

@media (max-width: 767px) {
    .mobile-sticky-cta {
        display: block;
    }
    
    /* Hide WhatsApp when sticky CTA active */
    body.sticky-cta-active .whatsapp-float {
        transform: translateY(100px);
        opacity: 0;
        pointer-events: none;
    }
}

/* P0-3: Touch Target Enforcement (WCAG 2.1 AA) */
.sec-link {
    min-width: 44px;
    min-height: 44px;
    padding: 13px 16px !important; /* Increased from 8px 14px */
}

.lang-toggle-mobile {
    min-width: 44px;
    min-height: 44px;
    padding: 11px 16px !important; /* Increased from 6px 12px */
}

.faq-question .icon {
    width: 32px !important;
    height: 32px !important; /* Increased from 26px */
}

/* Ensure all clickable elements meet 44px */
a, button, input[type="submit"], .clickable {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* P1-1: Condensed Founder Trust Module */
.founder-trust-micro {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(27,58,92,0.04), rgba(27,58,92,0.01));
    border: 1px solid rgba(27,58,92,0.1);
    border-radius: var(--r-lg);
    margin-bottom: 24px;
}

.founder-avatar-sm {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--warm);
    box-shadow: 0 4px 12px rgba(200,150,90,0.2);
    flex-shrink: 0;
}

.founder-micro-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.founder-micro-text strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.founder-micro-text span {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.trust-badge-micro {
    padding: 6px 12px;
    background: var(--warm-bg);
    color: var(--warm-dark);
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* P1-2: Trust Strip Above Hero */
.hero-trust-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 700;
}

.trust-badge::before {
    content: '✓';
    color: var(--accent);
    font-weight: 900;
}

.logo-mini-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-mini-bar img {
    height: 24px;
    width: auto;
    object-fit: contain;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: all 0.2s;
}

.logo-mini-bar img:hover {
    opacity: 1;
    filter: grayscale(0%);
}

/* P1-3: Enhanced Value Proposition */
.hero-headline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.outcome-metric {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(28px, 7vw, 42px);
    font-weight: 700;
    color: var(--accent);
    line-height: 1.1;
}

.value-prop-main {
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
}

.urgency-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(239,68,68,0.02));
    border: 1px solid rgba(239,68,68,0.2);
    border-left: 3px solid var(--danger);
    border-radius: var(--r-md);
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
}

.urgency-indicator svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* P1-4: CTA Visual Hierarchy */
.cta-primary-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
}

.btn-hero-primary {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 56px; /* Touch target compliance */
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--warm), var(--warm-dark));
    color: white;
    border: none;
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 6px 24px rgba(200, 150, 90, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

/* P2: CTA Pulse Animation (on idle) */
@keyframes cta-pulse {
    0%, 100% { 
        box-shadow: 0 6px 24px rgba(200, 150, 90, 0.4);
        transform: translateY(0);
    }
    50% { 
        box-shadow: 0 8px 32px rgba(200, 150, 90, 0.6);
        transform: translateY(-2px);
    }
}

.btn-hero-primary.idle-pulse {
    animation: cta-pulse 3s ease-in-out infinite;
}

.btn-hero-primary:hover,
.btn-hero-primary:focus {
    animation: none;
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(200, 150, 90, 0.5);
}

.btn-hero-primary:active {
    transform: scale(0.98);
}

.cta-subtext {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 4px;
}

.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 48px; /* Touch target */
    padding: 12px 24px;
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-hero-secondary:hover {
    background: var(--accent-bg);
    border-color: var(--accent-dark);
}

/* P1-5: Trust Ticker Near CTAs */
.trust-ticker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--r-lg);
    margin-top: 24px;
    overflow: hidden;
    position: relative;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.ticker-item.active {
    opacity: 1;
}

.ticker-item::before {
    content: '✓';
    color: var(--accent);
    font-weight: 900;
    font-size: 14px;
}

/* P1-6: Reduced Cognitive Load - Progressive Disclosure */
.pain-grid-extended,
.consequence-grid-extended {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pain-grid-extended.expanded,
.consequence-grid-extended.expanded {
    display: grid;
    opacity: 1;
}

.expand-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-accent);
    border-radius: var(--r-md);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expand-trigger:hover {
    background: var(--accent-bg);
    border-color: var(--accent);
}

.expand-trigger.expanded::after {
    content: ' ↑';
}

.expand-trigger:not(.expanded)::after {
    content: ' →';
}

/* ===== FOCUS STATES (ACCESSIBILITY) ===== */
.btn-hero-primary:focus-visible,
.btn-hero-secondary:focus-visible,
.btn-mobile-primary:focus-visible,
.expand-trigger:focus-visible {
    outline: 3px solid var(--warm);
    outline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== MICRO-INTERACTIONS ===== */

/* Hover lift on cards */
.pain-card,
.comp-card,
.fit-card,
.consequence-card,
.credential-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease;
}

.pain-card:hover,
.comp-card:hover,
.fit-card:hover {
    transform: translateY(-6px);
}

.consequence-card:hover,
.credential-card:hover {
    transform: translateY(-4px);
}

/* Smooth reveal animations for scroll */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for sequential reveals */
[data-reveal]:nth-child(1) { transition-delay: 0.1s; }
[data-reveal]:nth-child(2) { transition-delay: 0.2s; }
[data-reveal]:nth-child(3) { transition-delay: 0.3s; }
[data-reveal]:nth-child(4) { transition-delay: 0.4s; }

/* ===== AUDIENCE GATE IMPROVEMENTS ===== */

.audience-gate {
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 42, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.audience-gate.visible {
    opacity: 1;
    visibility: visible;
}

/* Anti-flash protection */
html.gate-skip .audience-gate {
    display: none !important;
}

.gate-content {
    background: white;
    border-radius: var(--r-xl);
    padding: 40px 32px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
}

.gate-skip-link {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    transition: all 0.2s ease;
}

.gate-skip-link:hover {
    background: var(--bg-secondary);
    color: var(--accent);
}

/* ===== MOBILE OPTIMIZATIONS ===== */

@media (max-width: 767px) {
    /* Reduce hero height for faster first impression */
    .hero-section {
        min-height: auto;
        padding: 32px 20px;
    }
    
    /* Condensed trust module on mobile */
    .founder-trust-micro {
        padding: 12px 16px;
        gap: 10px;
    }
    
    .founder-avatar-sm {
        width: 48px;
        height: 48px;
    }
    
    .founder-micro-text strong {
        font-size: 14px;
    }
    
    .founder-micro-text span {
        font-size: 11px;
    }
    
    .trust-badge-micro {
        display: none; /* Too cramped on mobile */
    }
    
    /* Simplified trust strip */
    .hero-trust-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .logo-mini-bar {
        gap: 12px;
    }
    
    .logo-mini-bar img {
        height: 20px;
    }
    
    /* Thumb-zone CTA positioning */
    .cta-primary-container {
        margin-top: 24px;
    }
    
    .btn-hero-primary {
        width: 100%;
        padding: 18px 24px;
    }
    
    .btn-hero-secondary {
        width: 100%;
    }
    
    /* Trust ticker simplified */
    .trust-ticker {
        padding: 12px 16px;
        gap: 16px;
    }
    
    .ticker-item {
        font-size: 12px;
    }
}

/* ===== TABLET OPTIMIZATIONS ===== */

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-trust-strip {
        justify-content: center;
    }
    
    .cta-primary-container {
        flex-direction: row;
        justify-content: center;
        gap: 16px;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        flex: 0 1 auto;
    }
}

/* ===== DESKTOP OPTIMIZATIONS ===== */

@media (min-width: 1024px) {
    .mobile-sticky-cta {
        display: none !important; /* Desktop uses in-content CTAs */
    }
    
    .founder-trust-micro {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .cta-primary-container {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        flex: 0 1 auto;
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    .mobile-sticky-cta,
    .whatsapp-float,
    .scroll-progress,
    .audience-gate,
    .trust-ticker {
        display: none !important;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        border: 1px solid #000;
        color: #000;
        background: #fff;
    }
}

/* ===== HIGH CONTRAST MODE ===== */

@media (prefers-contrast: high) {
    .btn-hero-primary {
        border: 2px solid currentColor;
    }
    
    .trust-badge,
    .urgency-indicator {
        border-width: 2px;
    }
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .btn-hero-primary {
        animation: none !important;
    }
    
    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
