/* =========================================
   CYCLES ÉCONOMIQUES — CLEAN PROFESSIONAL
   Tabs + Lottie + Sector Grid
   ========================================= */

/* === Section === */
.cy2 {
    position: relative;
}

/* === Header === */
.cy2-header {
    text-align: center;
    margin-bottom: 36px;
}

.cy2-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    font-weight: 800;
    color: #03045e;
    line-height: 1.15;
    margin: 0 0 10px;
    letter-spacing: -0.03em;
}

.cy2-grad {
    background: linear-gradient(135deg, #0077b6, #00b4d8, #48cae4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cy2-header p {
    font-size: 1.05rem;
    color: #6b8a9e;
    margin: 0;
    font-weight: 500;
}

/* === Tabs === */
.cy2-tabs {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    position: relative;
}

.cy2-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border: 1.5px solid rgba(0, 40, 80, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #4a6b80;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.cy2-tab i,
.cy2-tab svg {
    width: 16px;
    height: 16px;
    transition: transform 0.4s ease;
}

.cy2-tab:hover {
    border-color: rgba(0, 119, 182, 0.2);
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

/* Active tab colors */
.cy2-tab.active {
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.cy2-tab.active[data-phase="expansion"] {
    background: linear-gradient(135deg, #0077b6, #00b4d8);
    box-shadow: 0 4px 18px rgba(0, 119, 182, 0.3);
}

.cy2-tab.active[data-phase="surchauffe"] {
    background: linear-gradient(135deg, #c2410c, #ea580c);
    box-shadow: 0 4px 18px rgba(194, 65, 12, 0.3);
}

.cy2-tab.active[data-phase="recession"] {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    box-shadow: 0 4px 18px rgba(109, 40, 217, 0.3);
}

.cy2-tab.active[data-phase="reprise"] {
    background: linear-gradient(135deg, #047857, #059669);
    box-shadow: 0 4px 18px rgba(4, 120, 87, 0.3);
}

.cy2-tab.active i,
.cy2-tab.active svg {
    transform: scale(1.1);
}

/* Progress bar */
.cy2-tab-progress {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: rgba(0, 119, 182, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.cy2-tab-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0077b6, #00b4d8);
    border-radius: 3px;
    will-change: width;
}

/* === Content Layout === */
.cy2-content {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 48px;
    align-items: center;
}

/* === Left: Lottie === */
.cy2-left {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Soft glow behind Lottie — changes color via JS */
.cy2-left::before {
    content: '';
    position: absolute;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: var(--cy2-glow, rgba(0, 180, 216, 0.08));
    filter: blur(40px);
    transition: background 0.8s ease;
    pointer-events: none;
}

/* Lottie wrapper — holds two slots for crossfade */
.cy2-lottie-wrap {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1;
    z-index: 1;
    animation: lottieFloat 6s ease-in-out infinite;
}

@keyframes lottieFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

.cy2-lottie {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cy2-lottie.lottie-in {
    opacity: 1;
    transform: scale(1);
}

.cy2-lottie.lottie-out {
    opacity: 0;
    transform: scale(0.92);
}

.cy2-lottie svg {
    width: 100% !important;
    height: 100% !important;
}

/* === Right: Info === */
.cy2-right {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.cy2-right > * {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.cy2-right.switching > * {
    opacity: 0;
    transform: translateY(8px);
}

/* Cycle name */
.cy2-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.02em;
    transition: color 0.5s ease;
}

.cy2-name.color-expansion  { color: #0077b6; }
.cy2-name.color-surchauffe { color: #c2410c; }
.cy2-name.color-recession  { color: #7c3aed; }
.cy2-name.color-reprise    { color: #047857; }

/* Description */
.cy2-desc {
    font-size: 1.02rem;
    color: #4a6b80;
    line-height: 1.7;
    margin: 0;
}

/* === Sector Grid === */
.cy2-sectors-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cy2-sectors-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

/* Legend */
.cy2-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 2px;
}

.cy2-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
}

.cy2-legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.cy2-legend-dot.dot-green  { background: #10b981; }
.cy2-legend-dot.dot-yellow { background: #f59e0b; }
.cy2-legend-dot.dot-red    { background: #ef4444; }

.cy2-sector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}

/* Stagger entrance */
@keyframes sectorSlideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.cy2-sector-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.25s ease, box-shadow 0.25s ease;
    animation: sectorSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(var(--i, 0) * 70ms);
}

.cy2-sector-item:hover {
    background: rgba(0, 119, 182, 0.05);
}

.cy2-sector-item.active {
    background: rgba(0, 119, 182, 0.07);
    box-shadow: inset 3px 0 0 #0077b6;
}

/* Badge dot */
.cy2-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.5s ease, box-shadow 0.5s ease;
}

.cy2-dot.dot-green  { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.35); }
.cy2-dot.dot-yellow { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.35); }
.cy2-dot.dot-red    { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.35); }

/* Sector icon */
.cy2-sicon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.cy2-sicon i,
.cy2-sicon svg {
    width: 14px;
    height: 14px;
    transition: color 0.3s ease;
}

/* Signal-colored icons */
.cy2-sicon.sicon-green  { background: rgba(16, 185, 129, 0.08); }
.cy2-sicon.sicon-yellow { background: rgba(245, 158, 11, 0.08); }
.cy2-sicon.sicon-red    { background: rgba(239, 68, 68, 0.08); }

.cy2-sicon.sicon-green i,
.cy2-sicon.sicon-green svg  { color: #059669; }
.cy2-sicon.sicon-yellow i,
.cy2-sicon.sicon-yellow svg { color: #d97706; }
.cy2-sicon.sicon-red i,
.cy2-sicon.sicon-red svg    { color: #dc2626; }

.cy2-sector-item:hover .cy2-sicon.sicon-green  { background: rgba(16, 185, 129, 0.14); }
.cy2-sector-item:hover .cy2-sicon.sicon-yellow { background: rgba(245, 158, 11, 0.14); }
.cy2-sector-item:hover .cy2-sicon.sicon-red    { background: rgba(239, 68, 68, 0.14); }

/* Sector name in list */
.cy2-sname {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a3a52;
}

/* Sector signal label */
.cy2-slabel {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: color 0.5s ease;
    flex-shrink: 0;
}

.cy2-slabel.lbl-green  { color: #059669; }
.cy2-slabel.lbl-yellow { color: #d97706; }
.cy2-slabel.lbl-red    { color: #dc2626; }

/* === Tip Panel === */
.cy2-tip {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s cubic-bezier(0.16, 1, 0.3, 1), margin 0.35s ease;
    margin-top: 0;
}

.cy2-tip.visible {
    grid-template-rows: 1fr;
    margin-top: 12px;
}

.cy2-tip-inner {
    overflow: hidden;
}

.cy2-tip-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(0, 119, 182, 0.04), rgba(0, 180, 216, 0.02));
    border: 1px solid rgba(0, 119, 182, 0.08);
    border-radius: 12px;
}

.cy2-tip-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 119, 182, 0.07);
    flex-shrink: 0;
}

.cy2-tip-icon-wrap i,
.cy2-tip-icon-wrap svg {
    width: 18px;
    height: 18px;
    color: #0077b6;
}

.cy2-tip-body {
    flex: 1;
    min-width: 0;
}

.cy2-tip-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0a2540;
    margin: 0 0 4px;
}

.cy2-tip-text {
    font-size: 0.88rem;
    color: #4a6b80;
    line-height: 1.6;
    margin: 0;
}

/* === Disclaimer === */
.cy2-disc {
    font-size: 0.7rem;
    color: #b0c0cc;
    font-style: italic;
    margin: 28px 0 0;
    text-align: center;
}

/* === Section overrides === */
#cycle-economique .container {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 28px !important;
    padding: 48px 44px !important;
    position: relative !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    box-shadow:
        0 20px 60px rgba(0, 40, 80, 0.06),
        0 4px 16px rgba(0, 40, 80, 0.03),
        0 0 30px var(--cy2-card-glow, transparent) !important;
    transform: none !important;
    transition: box-shadow 0.5s ease !important;
}

#cycle-economique .container::before {
    display: none !important;
}

#cycle-economique .container::after {
    display: none !important;
}

#cycle-economique .container:hover {
    transform: none !important;
}

#cycle-economique .container > * {
    position: relative;
    z-index: 1;
}

.cycle-header {
    display: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cy2-lottie-wrap { animation: none; }
    .cy2-lottie { transition: none; }
    .cy2-sector-item { animation: none; }
}

/* === Responsive === */
@media (max-width: 768px) {
    .cy2 {
        padding: 60px 0 36px;
    }

    .cy2-header h2 {
        font-size: 1.6rem;
    }

    .cy2-tabs {
        gap: 5px;
        margin-bottom: 24px;
    }

    .cy2-tab {
        padding: 8px 14px;
        font-size: 0.78rem;
        gap: 5px;
        border-radius: 10px;
    }

    .cy2-tab i,
    .cy2-tab svg {
        width: 14px;
        height: 14px;
    }

    .cy2-tab span {
        display: none;
    }

    .cy2-tab-progress {
        width: 80px;
    }

    .cy2-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .cy2-lottie-wrap {
        max-width: 200px;
        margin: 0 auto;
    }

    .cy2-name {
        font-size: 1.6rem;
        text-align: center;
    }

    .cy2-desc {
        font-size: 0.95rem;
        text-align: center;
    }

    .cy2-sector-grid {
        grid-template-columns: 1fr;
    }

    .cy2-sector-item {
        padding: 7px 10px;
    }
}

@media (max-width: 420px) {
    .cy2-content {
        gap: 18px;
    }

    .cy2-lottie-wrap {
        max-width: 170px;
    }

    .cy2-name {
        font-size: 1.4rem;
    }
}
