/* ============================================================
   MOON LIGHT - LUNAR PHASE SLIDER (ml- prefix)
   Append to the end of assets/css/style.css
============================================================ */
#moon-slider {
    background: #080d1b !important;
    border: 1px solid var(--border);
    padding: 4rem 0 4rem;
}

.ml-stars {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><circle cx='20' cy='30' r='1' fill='white' opacity='0.45'/><circle cx='95' cy='55' r='1' fill='white' opacity='0.3'/><circle cx='55' cy='110' r='1.2' fill='white' opacity='0.5'/><circle cx='120' cy='20' r='0.8' fill='white' opacity='0.35'/></svg>");
    background-size: 160px 160px;
    animation: ais-stars-twinkle 6s ease-in-out infinite alternate;
}

.ml-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 340px;
    background: radial-gradient(ellipse, rgba(40, 120, 255, 0.1) 0%, rgba(168, 199, 255, 0.18) 45%, transparent 75%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

#moon-slider .container {
    position: relative;
    z-index: 2;
}

/* Header */
.ml-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 3rem;
}

.ml-head .aig-section-title {
    max-width: 640px;
}

.ml-controls {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-bottom: 1.5rem;
}

.ml-arrow {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid #2878ff;
    color: #2878ff;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.ml-arrow:hover {
    background: #2878ff;
    color: #f8fafc;
    transform: scale(1.06);
    box-shadow: 0 0 20px rgba(40, 120, 255, 0.45);
}

.ml-arrow.swiper-button-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Slider */
.ml-swiper {
    overflow: hidden;
    padding: 1rem 0.25rem 1.5rem;
}

.ml-swiper .swiper-slide {
    height: auto;
    display: flex;
}

/* Card */
.ml-card {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.75rem 1.75rem;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(17, 29, 53, 0.98) 0%, rgba(8, 13, 27, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.ml-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 22%, rgba(40, 120, 255, 0.1) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.ml-card:hover {
    transform: translateY(-8px);
    border-color: rgba(40, 120, 255, 0.4);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5), 0 0 30px rgba(40, 120, 255, 0.08);
}

.ml-card:hover::before {
    opacity: 1;
}

.ml-card--peak {
    border-color: rgba(40, 120, 255, 0.35);
    box-shadow: 0 0 30px rgba(40, 120, 255, 0.08);
}

.ml-card-tag {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2878ff;
    background: rgba(40, 120, 255, 0.1);
    border: 1px solid rgba(168, 199, 255, 0.25);
    padding: 4px 10px;
    border-radius: 50px;
    position: relative;
    z-index: 2;
}

.ml-card-tag--peak {
    background: #2878ff;
    color: #f8fafc;
    border-color: #2878ff;
}

/* Moon graphic */
.ml-moon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 190px;
    margin: 0.5rem 0 1.25rem;
}

.ml-moon-wrap::before {
    content: '';
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    border: 1px dashed rgba(40, 120, 255, 0.28);
    animation: core-spin-plain 40s linear infinite;
}

@keyframes core-spin-plain {
    to {
        transform: rotate(360deg);
    }
}

.ml-moon {
    --lit: radial-gradient(circle at 35% 30%, #fbffe6 0%, #e6f7b0 38%, #b9cf7a 100%);
    --dark: #0a1417;
    position: relative;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: var(--lit);
    box-shadow: 0 0 40px rgba(40, 120, 255, 0.28), 0 0 90px rgba(40, 120, 255, 0.1);
    overflow: hidden;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.ml-moon::before {
    /* craters */
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 38%, rgba(168, 199, 255, 0.2) 0 9px, transparent 10px),
        radial-gradient(circle at 62% 58%, rgba(168, 199, 255, 0.18) 0 13px, transparent 14px),
        radial-gradient(circle at 48% 22%, rgba(168, 199, 255, 0.14) 0 6px, transparent 7px),
        radial-gradient(circle at 72% 30%, rgba(168, 199, 255, 0.12) 0 5px, transparent 6px);
    z-index: 1;
}

.ml-moon::after {
    /* phase shadow */
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    z-index: 2;
}

.ml-card:hover .ml-moon {
    transform: scale(1.07);
    box-shadow: 0 0 55px rgba(40, 120, 255, 0.45), 0 0 110px rgba(40, 120, 255, 0.16);
}

.ml-moon--new {
    box-shadow: 0 0 20px rgba(40, 120, 255, 0.1);
}

.ml-moon--new::after {
    box-shadow: inset 0 0 0 200px var(--dark);
}

.ml-moon--waxing-crescent::after {
    box-shadow: inset 86px 0 0 0 var(--dark);
}

.ml-moon--first-quarter::after {
    background: linear-gradient(90deg, var(--dark) 50%, transparent 50%);
}

.ml-moon--waxing-gibbous::after {
    box-shadow: inset 30px 0 0 0 var(--dark);
}

.ml-moon--full::after {
    display: none;
}

.ml-moon--waning-gibbous::after {
    box-shadow: inset -30px 0 0 0 var(--dark);
}

.ml-moon--last-quarter::after {
    background: linear-gradient(90deg, transparent 50%, var(--dark) 50%);
}

/* Text */
.ml-card-title {
    position: relative;
    z-index: 2;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.01em;
    margin-bottom: 0.6rem;
    transition: color 0.35s ease;
}

.ml-card:hover .ml-card-title {
    color: #2878ff;
}

.ml-card-desc {
    position: relative;
    z-index: 2;
    font-size: 14.5px;
    line-height: 1.7;
    color: #c7d2e5;
    margin-bottom: 1.35rem;
    min-height: 74px;
}

.ml-stats {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 1rem 0;
    margin: auto 0 1rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.ml-stats li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ml-stats span {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(199, 210, 229, 0.65);
}

.ml-stats strong {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: #f8fafc;
}

.ml-stats li:nth-child(2) strong {
    color: #2878ff;
}

/* Energy meter */
.ml-meter {
    position: relative;
    z-index: 2;
    height: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.ml-meter span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #111d35, #2878ff);
    box-shadow: 0 0 10px rgba(40, 120, 255, 0.4);
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.swiper-slide-visible .ml-meter span,
.swiper-slide-active .ml-meter span {
    width: var(--w);
}

/* Footer: progress + dots + CTA */
.ml-foot {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.ml-progress {
    flex: 1;
    height: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.ml-progress-bar {
    display: block;
    height: 100%;
    width: 14%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2878ff, #a8c7ff);
    transition: width 0.45s ease;
}

.ml-pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ml-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
    margin: 0 !important;
    transition: width 0.3s ease, background 0.3s ease;
}

.ml-pagination .swiper-pagination-bullet-active {
    width: 26px;
    background: #2878ff;
}

/* Responsive */
@media (max-width: 991px) {
    .ml-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .ml-controls {
        margin-bottom: 0;
    }
}

@media (max-width: 575px) {
    #moon-slider {
        padding: 4rem 0 3.5rem;
    }

    .ml-foot {
        flex-wrap: wrap;
        gap: 1.25rem;
    }

    .ml-progress {
        flex-basis: 100%;
        order: 3;
    }
}

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

    .ml-stars,
    .ml-moon-wrap::before {
        animation: none;
    }
}

/* ---- Lunar phases text update: 3 stats with names, note line ---- */
.ml-stats {
    grid-template-columns: 1.15fr 0.85fr 1fr;
    gap: 0.75rem;
}

.ml-stats strong {
    font-size: 0.95rem;
    line-height: 1.3;
}

.ml-stats span {
    white-space: nowrap;
}

.ml-card-tag {
    text-transform: none;
    letter-spacing: 0.03em;
}

.ml-note {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0.5rem 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(199, 210, 229, 0.7);
}

.ml-note i {
    margin-top: 0.2rem;
    color: #a8c7ff;
}
