/* HERO CAROUSEL STYLES */
/* Auto-rotating product visuals showcasing Pillar Scores, Trade-Off Ledger, Moat Map, Industry Insights */

/* =====================================================
   CAROUSEL CONTAINER
   ===================================================== */

.hero-visuals-carousel {
    position: relative;
    width: 100%;
    height: 520px;
    perspective: 1200px;
    padding-bottom: 60px;
}

/* =====================================================
   VISUAL SLIDES
   ===================================================== */

.hero-visual {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px; /* matches carousel padding-bottom — keeps slides clear of dots/caption */
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.hero-visual.active {
    position: absolute;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    z-index: 2;
}

/* Ensure placeholder-frame inside carousel has proper sizing */
.hero-visual .placeholder-frame {
    transform: rotateY(-2deg) rotateX(1deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    max-height: 100%;
    overflow: hidden;
}

[data-bs-theme="dark"] .hero-visual .placeholder-frame {
    background: rgba(31, 41, 55, 0.95);
}

.hero-visuals-carousel:hover .hero-visual.active .placeholder-frame {
    transform: rotateY(0) rotateX(0) scale(1.02);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(var(--landing-gradient-primary-rgb), 0.1);
}

/* =====================================================
   CAROUSEL INDICATORS (Navigation Dots)
   ===================================================== */

.carousel-indicators {
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 12px 0;
    z-index: 10;
}

/* The button itself is a 24x24 transparent hit area (WCAG 2.5.8 target size);
   the visible 10px dot is drawn with ::before so the control still looks small. */
.carousel-indicators button {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.carousel-indicators button::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(var(--landing-gradient-primary-rgb), 0.2);
    border: 2px solid rgba(var(--landing-gradient-primary-rgb), 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.carousel-indicators button:hover::before {
    background: rgba(var(--landing-gradient-secondary-rgb), 0.6);
    border-color: rgba(var(--landing-gradient-secondary-rgb), 0.8);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(var(--landing-gradient-secondary-rgb), 0.4);
}

.carousel-indicators button.active::before {
    background: var(--sa-primary-600);
    border-color: var(--sa-primary-600);
    transform: scale(1.4);
    box-shadow: 0 0 12px rgba(var(--landing-gradient-primary-rgb), 0.6);
}

.carousel-indicators button.active::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(var(--landing-gradient-primary-rgb), 0.3);
    border-radius: 50%;
    animation: indicatorPulse 2s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.5); opacity: 0; }
}

.carousel-indicators button:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* =====================================================
   VISUAL CAPTION
   ===================================================== */

.visual-caption {
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--sa-secondary-600);
    min-height: 28px;
    transition: opacity 0.4s ease;
    z-index: 10;
}

.visual-caption .caption-text {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(var(--landing-gradient-secondary-rgb), 0.1) 0%, rgba(var(--landing-gradient-primary-rgb), 0.08) 100%);
    border-radius: 16px;
    font-weight: 600;
    box-shadow: var(--shadow-xs);
    border: 1px solid rgba(var(--landing-gradient-secondary-rgb), 0.2);
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .visual-caption .caption-text {
    background: linear-gradient(135deg, rgba(var(--landing-gradient-secondary-rgb), 0.15) 0%, rgba(var(--landing-gradient-primary-rgb), 0.12) 100%);
    border-color: rgba(var(--landing-gradient-secondary-rgb), 0.3);
}

/* =====================================================
   PILLAR DIALS GRID (Visual #1)
   ===================================================== */

.pillar-dials-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 24px 16px;
}

.mini-dial {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Staggered entrance animation */
.hero-visual.active .mini-dial {
    opacity: 1;
    transform: translateY(0);
}

.hero-visual.active .mini-dial:nth-child(1) {
    transition-delay: 0ms;
}

.hero-visual.active .mini-dial:nth-child(2) {
    transition-delay: 100ms;
}

.hero-visual.active .mini-dial:nth-child(3) {
    transition-delay: 200ms;
}

.hero-visual.active .mini-dial:nth-child(4) {
    transition-delay: 300ms;
}

.hero-visual.active .mini-dial:nth-child(5) {
    transition-delay: 400ms;
}

/* Score Ring (Conic Gradient Dial) */
.score-ring {
    --deg: 0deg;
    --ring-color: var(--bs-primary);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(var(--ring-color) var(--deg), rgba(var(--landing-gradient-primary-rgb), 0.1) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    position: relative;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.score-ring:hover {
    transform: scale(1.05);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.score-ring::before {
    content: '';
    position: absolute;
    inset: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.9) 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .score-ring::before {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(17, 24, 39, 0.9) 100%);
}

.score-value {
    position: relative;
    z-index: 1;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bs-body-color);
    font-variant-numeric: tabular-nums;
}

/* Score semantic colors */
.score-ring.score-excellent {
    --ring-color: var(--bs-success);
}

.score-ring.score-good {
    --ring-color: var(--bs-secondary);
}

.score-ring.score-fair {
    --ring-color: var(--bs-warning);
}

.score-ring.score-weak {
    --ring-color: var(--bs-danger);
}

.pillar-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--bs-body-color);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.mini-dial .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-xs);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* =====================================================
   TERNARY TRIANGLE (Visual #2 - Trade-Off Ledger)
   ===================================================== */

.ternary-container {
    padding: 24px;
    text-align: center;
}

.ternary-triangle {
    max-width: 320px;
    width: 100%;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.ternary-triangle:hover {
    transform: scale(1.02);
}

.vertex-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    fill: var(--bs-body-color);
}

.company-marker {
    fill: var(--sa-primary-600);
    filter: drop-shadow(0 0 12px rgba(var(--landing-gradient-primary-rgb), 0.6));
    animation: markerPulse 2.5s ease-in-out infinite;
    cursor: pointer;
    transition: r 0.3s ease;
}

@keyframes markerPulse {
    0%,
    100% {
        filter: drop-shadow(0 0 12px rgba(var(--landing-gradient-primary-rgb), 0.6));
        opacity: 1;
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(var(--landing-gradient-primary-rgb), 0.8));
        opacity: 0.9;
    }
}

.peer-dot {
    fill: var(--sa-secondary-600);
    opacity: 0.7;
    transition: opacity 0.3s ease, r 0.3s ease;
}

.peer-dot:hover {
    opacity: 1;
    r: 5.5;
}

.company-label {
    font-weight: 700;
    font-size: 12px;
    fill: var(--bs-body-color);
}

.delta-caption {
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--sa-secondary-600);
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(var(--landing-gradient-secondary-rgb), 0.08) 0%, rgba(var(--landing-gradient-primary-rgb), 0.06) 100%);
    border-radius: var(--radius-m);
    display: inline-block;
    font-weight: 500;
    box-shadow: var(--shadow-xs);
    border: 1px solid rgba(var(--landing-gradient-secondary-rgb), 0.15);
}

/* =====================================================
   MOAT RADAR (Visual #3)
   ===================================================== */

.moat-radar-container {
    min-height: 320px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(var(--landing-gradient-primary-rgb), 0.02) 0%, rgba(var(--landing-gradient-secondary-rgb), 0.02) 100%);
    border-radius: var(--radius-m);
}

/* ApexCharts will render here - ensure theme compatibility */
.moat-radar-container .apexcharts-canvas {
    margin: 0 auto;
}

.moat-radar-container .apexcharts-legend {
    padding: 8px 0 !important;
}

.moat-radar-container .apexcharts-legend-text {
    font-size: 12px !important;
    font-weight: 500 !important;
}

/* =====================================================
   INDUSTRY INSIGHTS (Visual #4)
   ===================================================== */

/* Staggered row entrance for comparison table */
.hero-visual.active .comparison-row {
    animation: rowFadeIn 0.4s ease forwards;
    opacity: 0;
}

.hero-visual.active .comparison-row:nth-child(2) {
    animation-delay: 100ms;
}

.hero-visual.active .comparison-row:nth-child(3) {
    animation-delay: 200ms;
}

.hero-visual.active .comparison-row:nth-child(4) {
    animation-delay: 300ms;
}

@keyframes rowFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Badge scale animation on visual entry */
.hero-visual.active .comparison-row .badge {
    animation: badgeScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: inherit;
    transform: scale(0);
}

@keyframes badgeScale {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Enhanced badge styling for all hero visuals */
.placeholder-row .badge,
.mini-dial .badge {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.placeholder-row:hover .badge {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* =====================================================
   RESPONSIVE STYLES
   ===================================================== */

@media (max-width: 992px) {
    .hero-visuals-carousel {
        height: 420px;
        margin-top: 32px;
    }

    .pillar-dials-grid {
        gap: 10px;
        padding: 16px 12px;
    }

    .score-ring {
        width: 64px;
        height: 64px;
    }

    .score-value {
        font-size: 1.15rem;
    }

    .pillar-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .hero-visuals-carousel {
        height: 460px;
        padding-bottom: 55px;
    }

    .hero-visual {
        bottom: 55px;
    }

    .pillar-dials-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px 8px;
        padding: 16px 8px;
    }

    /* Move last two dials to second row, centered */
    .mini-dial:nth-child(4),
    .mini-dial:nth-child(5) {
        grid-column: span 1;
    }

    .score-ring {
        width: 56px;
        height: 56px;
    }

    .score-ring::before {
        inset: 6px;
    }

    .score-value {
        font-size: 1rem;
    }

    .pillar-label {
        font-size: 0.65rem;
    }

    .mini-dial .badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }

    .ternary-triangle {
        max-width: 240px;
    }

    .delta-caption {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .moat-radar-container {
        min-height: 260px;
    }

    .carousel-indicators {
        gap: 8px;
    }

    .carousel-indicators button {
        width: 24px;
        height: 24px;
    }

    .carousel-indicators button::before {
        width: 10px;
        height: 10px;
        border: 1px solid var(--bs-primary);
    }

    .visual-caption {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .hero-visuals-carousel {
        height: 440px;
        padding-bottom: 50px;
    }

    .hero-visual {
        bottom: 50px;
    }

    .pillar-dials-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 12px 4px;
    }

    .score-ring {
        width: 48px;
        height: 48px;
    }

    .score-ring::before {
        inset: 5px;
    }

    .score-value {
        font-size: 0.9rem;
    }

    .pillar-label {
        font-size: 0.6rem;
    }

    .placeholder-table {
        font-size: 0.7rem;
    }

    .placeholder-row {
        grid-template-columns: 60px repeat(3, 1fr);
        gap: 0.25rem;
        padding: 0.4rem 0.5rem;
    }
}

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

@media (prefers-reduced-motion: reduce) {

    .hero-visual,
    .mini-dial,
    .company-marker,
    .comparison-row,
    .badge {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .company-marker {
        animation: none !important;
    }

    /* Disable auto-rotation via data attribute check in JS */
}

/* =====================================================
   DARK THEME ADJUSTMENTS
   ===================================================== */

[data-bs-theme="dark"] .score-ring {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .score-ring::before {
    background: var(--surface-1);
}

[data-bs-theme="dark"] .ternary-triangle polygon {
    stroke: var(--surface-2);
}

[data-bs-theme="dark"] .delta-caption,
[data-bs-theme="dark"] .visual-caption .caption-text {
    background: var(--surface-2);
}

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

@media print {
    .hero-visuals-carousel {
        display: none;
    }
}