/* ========================================
   CSS VARIABLES
======================================== */
:root {
    --size-main: 25vw;
    --size-center: 15vw;
    --z-bg: 1;
    --z-big-box: 2;
    --z-box-tls: 3;
    --z-yinyang: 4;
    --z-star: 5;
}

@keyframes xoayvong {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   LAYOUT
======================================== */
.fls_container {
    width: 100%;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 70px;
    position: relative;
}

.fls_site {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28vw;
    height: 28vw;
    margin-bottom: 30px;
}

/* ========================================
   BACKGROUND RING
======================================== */
.bg1 {
    position: absolute;
    inset: 0;
    z-index: var(--z-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    transform: rotate(79deg);
}

.bg1 img {
    width: 120%;
    max-width: none;
    transform: rotate(326deg);
    animation: rotateCircle 150s linear infinite;
}

/* ========================================
   BIG BOX
======================================== */
.big_box {
    position: relative;
    z-index: var(--z-big-box);
    width: 100%;
    height: 100%;
}

/* ========================================
   ROTATE WRAPPER + PARENT CIRCLE
======================================== */
.rotate-wrapper {
    position: absolute;
    inset: 0;
    animation: rotateCircle 150s linear infinite;
    transform-origin: 50% 50%;
}

#parent-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) rotate(78deg);
    z-index: 99999999;
}

/* ========================================
   CIRCLES (THE CONTAINERS)
======================================== */
#parent-circle .circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 21%;
    height: 21%;
    margin: -10.5%;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

@keyframes counterRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

.circle-icon {
    animation: counterRotate 150s linear infinite;
}


/* OPTIMIZED POSITIONING WITH VARIABLES */
#parent-circle .circle {
    /* Base Distance (Desktop) */
    --dist: 13vw;
    /* Dynamic Transform */
    transform: rotate(var(--angle)) translate(var(--dist)) rotate(var(--counter));
}

/* DEFINE ANGLES & BASE COUNTERS (Desktop) */
#parent-circle .circle.wood {
    --angle: 20deg;
    --counter: -101deg;
}

#parent-circle .circle.fire {
    --angle: 88deg;
    --counter: -167deg;
}

#parent-circle .circle.earth {
    --angle: 163deg;
    --counter: 117deg;
}

#parent-circle .circle.metal {
    --angle: 238deg;
    --counter: 43deg;
}

#parent-circle .circle.water {
    --angle: 310deg;
    --counter: -28deg;
}


/* ========================================
   ICON INSIDE EACH CIRCLE
======================================== */
.circle-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90px;
    height: 90px;
    transform: translate(-50%, -50%);
}

.circle-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    transition: .25s ease;
}

.circle {
    transition: box-shadow .3s ease;
}


/* ========================================
   CENTER (YIN YANG + STAR)
======================================== */
#box_tls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(42deg);
    width: 21vw;
    height: 21vw;
    z-index: var(--z-box-tls);
}

#yinyang,
#star_bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#yinyang {
    width: 75%;
    height: 75%;
    z-index: var(--z-yinyang);
}

#star_bg {
    width: 69%;
    height: 69%;
    z-index: var(--z-star);
}

#yinyang img,
#star_bg img {
    width: 100%;
    display: block;
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes rotateCircle {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   PRODUCT GRID
======================================== */
#five-elements-results ul.products,
#zodiac-elements-results ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 30px auto 0;
    max-width: 1350px;
}

#five-elements-results ul.products>.product-small,
#zodiac-elements-results ul.products>.product-small {
    width: calc(25% - 20px);
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

/* Responsive (optional) */
@media (max-width: 768px) {

    #five-elements-results ul.products>.product-small,
    #zodiac-elements-results ul.products>.product-small {
        width: calc(50% - 20px);
    }
}

@media (max-width: 480px) {

    #five-elements-results ul.products>.product-small,
    #zodiac-elements-results ul.products>.product-small {
        width: calc(50% - 20px);
    }

    .circle-label {
        top: 30%;
        left: 9%;
        font-size: 9px;
        font-weight: 500;
    }
}


.fls_container {
    background: #000;
}


#five-elements-results,
#zodiac-elements-results {
    width: 100%;
    margin-top: 40px;
    padding-bottom: 80px;
}




/* ==========================
   LABEL HIỂN THỊ GIỮA ICON
   ========================== */
/* TEXT GIỮA ICON, KHÔNG XOAY, KHÔNG LỆCH */
.circle-label {
    position: absolute;
    top: 32%;
    left: 27%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 1);
    z-index: 5;
    animation: counterRotate 150s linear infinite;
}

.circle-icon {
    filter: brightness(0.65) contrast(1);
}



/* TABLET (max-width: 1024px) */
@media (max-width: 1024px) {
    .fls_site {
        width: 60vw;
        height: 60vw;
    }

    .icon-wrap {
        width: 100px;
        height: 100px;
    }

    .circle-label {
        font-size: 20px;
        top: 50%;
        left: 50%;
    }

    /* Update Distance Only */
    #parent-circle .circle {
        --dist: 28vw;
    }

    #box_tls {
        width: 30vw;
        height: 30vw;
    }
}


/* MOBILE LANDSCAPE (max-width: 768px) */
@media (max-width: 768px) {
    #box_tls {
    width: 38vw;
    height: 38vw;
}
#parent-circle .circle.wood {
    --angle: 22deg;
}
    #parent-circle .circle.earth {
    --angle: 162deg;
}

    #parent-circle .circle.fire {
    --angle: 91deg;
}
    #parent-circle .circle {
        --dist: 25vw;
    }

    .circle-label {
    top: 27%;
    left: 29%;
    font-size: 27px;
}
}


@media (max-width: 640px) {
    .icon-wrap {
        width: 75px;
        height: 75px;
    }

    .circle-label {
        top: 50%;
        left: 50%;
    }
}

/* MOBILE PORTRAIT (max-width: 440px) */
@media (max-width: 440px) {
    .fls_site {
        width: 85vw;
        height: 85vw;
    }
    
    #parent-circle .circle {
        --dist: 38.5vw;
        --counter: -239deg;
    }

    .icon-wrap {
        width: 84px;
        height: 84px;
    }

    #box_tls {
        width: 59vw;
        height: 59vw;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(42deg);
    }

    .circle-label {
    top: 31%;
    left: 29%;
    font-size: 22px;
}
}

#five-elements-results .box-text,
#zodiac-elements-results .box-text {
    background-color: #fff;
}


.fls_container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 48, 0.45);
    z-index: 1;
}

.fls_container>* {
    position: relative;
    z-index: 2;
}



/* Desktop */
#five-elements-results ul.products>.product-small,
#zodiac-elements-results ul.products>.product-small {
    width: calc(25% - 20px);
}

/* Tablet + Mobile: 2 sản phẩm */
@media (max-width: 768px) {

    #five-elements-results ul.products>.product-small,
    #zodiac-elements-results ul.products>.product-small {
        width: calc(50% - 12px);
    }
}

:root {
    --wheel-diameter: 800px;
    --center-size: 229px;
    --c-dark-blue: #0f172a;
    --c-mid-blue: #1e3a8a;
    --c-light-blue: #60a5fa;
    --c-accent: #93c5fd;
    --c-text-glow: #e0f2fe;
}

.page-wrapper.zodiac-wrapper {
    padding-bottom: 0;
    padding-top: 70px;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* MAIN WHEEL COMPONENT */
.zodiac-full-component {
    position: relative;
    width: var(--wheel-diameter);
    height: var(--wheel-diameter);
    /* No distinct border here, relying on internal rings */
}

/* 1. STATIC CENTER */
.center-fixed {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 153px;
    height: 151px;
    z-index: 100;
}

.sun-moon-placeholder {
    font-weight: bold;
    color: var(--c-text-glow);
    text-align: center;
    line-height: 1.2;
}

/* 2. ROTATING SPINNER */
.zodiac-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
    /* Slower, smooth execution */
}

.zodiac-spinner.manual-transition {
    transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Background Rings (Decorative) */
.wheel-bg-rings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-sizing: border-box;
    background-size: 110%;
    pointer-events: none;
}


.zodiac-slice {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform: rotate(calc(var(--i) * 30deg));
}

.ring-text,
.ring-animal,
.ring-symbol {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    white-space: nowrap;
}

.ring-text {
    color: white;
    font-size: 20px;
    top: -13%;
    font-weight: bold;
}


.ring-animal {
    top: calc(var(--wheel-diameter) / -2 + 95px);
    width: 160px;
    height: 160px;
    margin-top: 40px;
    cursor: pointer;
    transition: transform 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.zodiac-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(96, 165, 250, 0.5));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.ring-animal:hover .zodiac-icon {
    filter: drop-shadow(0 0 15px rgba(96, 165, 250, 0.8)) brightness(1.2);
    transform: scale(1.1);
}

.ring-symbol {
    /* Kept for reference or future use, though not used in current HTML */
    top: calc(var(--wheel-diameter) / -2 + 190px);
    font-size: 24px;
    color: var(--c-accent);
    margin-top: 12px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}


.top-indicator {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--c-light-blue);
    font-size: 20px;
    display: none;
}


/* Active State */
.zodiac-slice.active .zodiac-icon {
    filter: drop-shadow(0 0 20px rgba(96, 165, 250, 1)) brightness(1.3);
    transform: scale(1.2);
}

/* PRODUCT DISPLAY */
.product-display {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    min-width: 300px;
    border: 1px solid var(--c-mid-blue);
}

/* RESPONSIVE */

.page-wrapper.zodiac-wrapper {
    position: relative;
    z-index: 1;
}

.page-wrapper.zodiac-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/wp-content/uploads/2025/12/nrao18cb5_artistimpression-scaled.jpg") no-repeat center center / cover;
    /* background: url("http://nguhanh.test/wp-content/uploads/2025/12/nrao18cb5_artistimpression-scaled.jpg") no-repeat center center / cover; */
    z-index: -1;
}

.zodiac-full-component {
    min-height: 800px;
}

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

/* TABLET (max-width: 1024px) */
@media (max-width: 1024px) {
    :root {
        --wheel-diameter: 60vw;
        /* Scale down for tablet */
        --center-size: 100px;
    }

    .zodiac-full-component {
        width: var(--wheel-diameter);
        height: var(--wheel-diameter);
        min-height: auto;
        /* Allow height to adjust */
        margin: 0 auto;
    }

    .fls_site {
        width: 52vw;
        height: 52vw;
    }

    /* Removed duplicate transform rules to allow variable-based system to work */


    .ring-animal {
        top: calc(var(--wheel-diameter) / -2 + 70px);
        width: 110px;
        height: 110px;
        margin-top: 30px;
    }

    .ring-text {
        font-size: 14px;
        top: -15px;
    }
}

/* MOBILE LANDSCAPE / SMALL TABLET (max-width: 768px) */
@media (max-width: 768px) {
    :root {
        --wheel-diameter: 80vw;
        --center-size: 123px;
    }

    .center-fixed {
    width: var(--center-size);
    height: var(--center-size);
    }


    /* Adjust product grid to 2 columns */
    #five-elements-results ul.products>.product-small,
    #zodiac-elements-results ul.products>.product-small {
        width: calc(50% - 10px);
    }

    .ring-animal {
        top: calc(var(--wheel-diameter) / -2 + 60px);
        width: 100px;
        height: 100px;
    }
}

/* MOBILE PORTRAIT (max-width: 600px) */
@media (max-width: 600px) {
    :root {
        --wheel-diameter: 90vw;
        --center-size: 80px;
    }

    .ring-animal {
        top: calc(var(--wheel-diameter) / -2 + 50px);
        width: 80px;
        height: 80px;
    }

    .ring-text {
        font-size: 12px;
        top: -10px;
    }
}

/* SMALL MOBILE (max-width: 480px) */
@media (max-width: 480px) {
    :root {
        --wheel-diameter: 95vw;
        
    }

    .center-fixed {
        width: 78px;
        height: 78px;
    }

    .zodiac-full-component {
        width: 95vw;
        height: 95vw;
        min-height: 95vw;
        /* Ensure container matches wheel */
    }

    .eastern-animal {
        top: calc(var(--wheel-diameter) / -2 + 20px);
        width: 56px;
        height: 56px;
    }

    .ring-text {
        top: -24%;
        font-size: 10px;
        color: white;
        font-weight: bold;
    }

    /* Ensure old circle logic doesn't break layout */
    .fls_site {
        width: 85vw;
        height: 85vw;
    }

    #box_tls {
        width: 59vw;
        height: 59vw;
    }
}

/* ========================================
   EASTERN ZODIAC (RED THEME) - INDEPENDENT CSS
======================================== */

/* WRAPPER & CONTAINER */
.eastern-wrapper {
    padding-bottom: 0;
    padding-top: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.eastern-full-component {
    position: relative;
    width: var(--wheel-diameter);
    height: var(--wheel-diameter);
    min-height: 800px;
}

/* CENTER FIXED (YINYANG) */
.eastern-center-fixed {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 229px;
    height: 229px;
    z-index: 100;
    border-radius: 50%;

    /* RED THEME STYLE */
    border: 2px solid #ef4444;
    background: radial-gradient(circle, #fca5a5 0%, #b91c1c 100%);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);

    display: flex;
    justify-content: center;
    align-items: center;
}

.eastern-center-fixed img {
    animation: xoayvong 30s linear infinite;
}

/* SPINNER & RINGS */
.eastern-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.eastern-spinner.manual-transition {
    transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.eastern-bg-rings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-sizing: border-box;
    background-size: 110%;
    pointer-events: none;
}

/* SLICES & ANIMALS */
.eastern-slice {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform: rotate(calc(var(--i) * 30deg));
}

.eastern-animal {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    top: calc(var(--wheel-diameter) / -2 + 54px);
    width: 100px;
    height: 100px;
    margin-top: 40px;
    cursor: pointer;
    transition: transform 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* TEXT STYLES */
.eastern-text-vn {
    position: absolute;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    color: #ef4444;
    font-size: 35px;
    font-weight: 800;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    z-index: 10;

}

.eastern-text-en {
    position: absolute;
    top: 113px;
    left: 55%;
    transform: translateX(-50%);
    white-space: nowrap;
    color: white;
    font-size: 20px;
    font-weight: 900;
    -webkit-text-stroke: 1px #ef4444;
    text-shadow: -1px -1px 0 #ef4444,
        1px -1px 0 #ef4444,
        -1px 1px 0 #ef4444,
        1px 1px 0 #ef4444;
    z-index: 10;
}


/* IMAGE STYLING */
.eastern-animal .zodiac-icon,
.eastern-animal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.5)); */
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* HOVER & ACTIVE */
.eastern-animal:hover img {
    filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.8)) brightness(1.2);
    transform: scale(1.1);
}

.eastern-slice.active img {
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 1)) brightness(1.3);
    transform: scale(1.2);
}

.eastern-indicator {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: #ef4444;
    /* Red indicator */
    font-size: 20px;
    display: none;
}



/* TABLET (max-width: 1024px) */
@media (max-width: 1024px) {
    .eastern-center-fixed {
    width: 171px;
    height: 171px;
}
    .eastern-full-component {
        width: var(--wheel-diameter);
        height: var(--wheel-diameter);
        min-height: auto;
        margin: 0 auto;
    }

    .eastern-animal {
    top: calc(var(--wheel-diameter) / -2 + 17px);
    width: 80px;
    height: 80px;
    /* margin-top: 12px; */
}

  .eastern-text-vn {
    font-size: 24px;
    bottom: -103px;
}

    .eastern-text-en {
    font-size: 20px;
    top: 98px;
    left: 55%;
}
}

/* MOBILE LANDSCAPE / SMALL TABLET (max-width: 768px) */
@media (max-width: 768px) {
    .eastern-animal {
        top: calc(var(--wheel-diameter) / -2 + 48px);
        width: 70px;
        height: 70px;
    }

    .eastern-text-vn {
        font-size: 24px;
        bottom: -84px;
    }

    .eastern-text-en {
        font-size: 14px;
        top: 80px;
        left: 55%;
    }
    .eastern-center-fixed {
    width: 176px;
    height: 176px;
}
}

/* MOBILE PORTRAIT (max-width: 600px) */
@media (max-width: 600px) {
    .eastern-animal {
        top: calc(var(--wheel-diameter) / -2 + 35px);
        width: 60px;
        height: 60px;
    }

    .eastern-text-vn {
        font-size: 20px;
        bottom: -72px;
    }

    .eastern-text-en {
        font-size: 12px;
        top: 68px;
        left: 55%;
    }
}

/* SMALL MOBILE (max-width: 480px) */
@media (max-width: 480px) {
    :root {
        --center-size: 119px;
    }
    .eastern-full-component {
        width: 95vw;
        height: 95vw;
        min-height: 95vw;
    }

    .eastern-animal {
    top: calc(var(--wheel-diameter) / -2 + 17px);
    width: 50px;
    height: 50px;
    margin-top: 25px;
}

    .eastern-text-vn {
    bottom: -45px;
    font-size: 13px;
}
    .eastern-text-en {
        top: 50px;
        font-size: 10px;
        left: 55%;
    }

    /* Ensure center size matches if variables change */
    .eastern-center-fixed {
        width: var(--center-size);
        height: var(--center-size);
    }
    .eastern-slice.active img {
    transform: scale(1);
}
}
@media (max-width: 430px) {
.eastern-text-en {
    top: 62px;
    font-size: 10px;
    left: 55%;
}
.eastern-text-vn {
    bottom: -64px;
    font-size: 13px;
}
}
@media (max-width: 414px) {
    .eastern-text-en {
    top: 57px;
    font-size: 12px;
    left: 55%;
}
.eastern-text-vn {
    bottom: -58px;
    font-size: 15px;
}

}

@media (max-width: 390px) {
    .eastern-text-en {
    top: 54px;
}
}
/* ========================================
   EASTERN ZODIAC - PRODUCT GRID (INDEPENDENT)
======================================== */

#eastern-elements-results {
    width: 100%;
    margin-top: 40px;
}

#eastern-elements-results .box-text {
    background-color: #fff;
}

#eastern-elements-results ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 30px auto 0;
    max-width: 1350px;
}

/* Base Desktop: 4 Columns */
#eastern-elements-results ul.products>.product-small {
    width: calc(25% - 20px);
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

/* Tablet + Mobile: 2 Columns */
@media (max-width: 768px) {
    #eastern-elements-results ul.products>.product-small {
        width: calc(50% - 12px);
    }
}

@media (max-width: 480px) {
    #eastern-elements-results ul.products>.product-small {
        width: calc(50% - 20px);
    }
}
