/* Progress Bar Styles - Matching Original Design */
#progress-container {
    position: relative;
    border: 1px solid #eee;
    padding: 12px;
    padding-bottom: 12px;
    border-radius: 15px;
    /* overflow: hidden; */
    background: #fff; /* Light gray instead of pure white so hexagons show */
    /* border-color: #9EB1FF; */

}

/* Rotating glow border effect */
#progress-container::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 15px;
    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        transparent 30deg,
        rgba(102, 126, 234, 0.8) 60deg,
        rgba(118, 75, 162, 1) 90deg,
        rgba(102, 126, 234, 0.8) 120deg,
        transparent 150deg,
        transparent 360deg
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 5px;
    animation: rotating-glow 3s linear infinite;
    pointer-events: none;
    z-index: 1;
    filter: blur(6px);
}

@keyframes rotating-glow {
    0% {
        --angle: 0deg;
    }
    100% {
        --angle: 360deg;
    }
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Hexagon background wrapper - separate element */
.hexagon-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: 15px;
    opacity: 0.2;
    display: none;

    /* Hexagon pattern variables - defined here */
    --s: 18px; /* shape size - adjustable! */
    --m: 0.5px;  /* line thickness - thicker to see better */

    /* Simple visible hexagon pattern - NO blend mode */
    background:
        conic-gradient(at var(--m) calc(var(--s)*0.5777), transparent 270deg, #000 0deg),
        conic-gradient(at calc(100% - var(--m)) calc(var(--s)*0.5777), #000 90deg, transparent 0deg),
        conic-gradient(from -60deg at 50% calc(var(--s)*0.8662), #fff 119.5deg, transparent 120.5deg),
        conic-gradient(from -60deg at 50% calc(var(--s)*0.8662 + 2*var(--m)), #000 119.5deg, transparent 120.5deg),
        conic-gradient(from 120deg at 50% calc(var(--s)*1.4435 + 3*var(--m)), #fff 119.5deg, transparent 120.5deg),
        conic-gradient(from 120deg at 50% calc(var(--s)*1.4435 + var(--m)), #000 119.5deg, transparent 120.5deg),
        linear-gradient(90deg, #fff calc(50% - var(--m)), #000 0 calc(50% + var(--m)), #fff 0);
    background-size: calc(var(--s) + 2*var(--m)) calc(var(--s)*1.732 + 3*var(--m));
    background-color: #fff;
}

/* Animated gradient overlay with blend mode */
.hexagon-background::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, white 40%, #3E63DD 50%, white 60%) left/400% 100%;
    animation: hexagon-shimmer 15s infinite alternate linear;
    mix-blend-mode: lighten;
}

@keyframes hexagon-shimmer {
    100% {
        background-position: right;
    }
}





#progress-container .progress-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    position: relative;
    z-index: 2;
}

#progress-container h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
}

#progress-message {
    margin: 0;
    font-size: 12px;
    text-align: left;
    margin-top: 4px;
    line-height: 1;
    padding-bottom: 12px;
    position: relative;
    z-index: 2;
}

#progress-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 0;
    margin-top: 24px;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
}

#progress-bar {
    position: relative;
    flex-grow: 1;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: visible;
    margin: 0;
}

#progress {
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.5s ease-in-out;
    border-radius: 10px;
}

#progress-container .node {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    font-weight: bold;
    color: #333;
}

#progress-container .node.filled {
    background-color: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

#progress-container .node .threshold-amount {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    /* font-size: 12px; */
    font-weight: 600;
    color: #333;
}

/* #progress-container .node:last-of-type .threshold-amount{
    left: unset;
    right: -16px;
} */

#progress-container .node .threshold-name {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 10px;
    color: #666;
}

#progress-container .node:last-of-type .threshold-amount,
#progress-container .node:last-of-type .threshold-name {
    left: unset;
    margin-right: -20px;
    
}

/* #progress-container .node:last-of-type .threshold-amount {
    right: -16px;
}

#progress-container .node:last-of-type .threshold-name {
    transform: none;
} */

#progress-container .node.filled .threshold-amount,
#progress-container .node.filled .threshold-name {
    color: #333;
}

#progress-container .node .checkmark {
    display: none;
}

#progress-container .node.filled .checkmark {
    display: block;
    font-size: 1.7em;
}

/* Terms link styling */
span.mystery-items-open-terms {
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

/* Checkout positioning */
.cart_totals #progress-container {
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 24px;
}

.woocommerce-cart-form #progress-container {
    margin-bottom: 24px;
    padding-bottom: 12px;
}

.checkout-content #progress-container {
    border-bottom: 0;
    padding-bottom: 0;
    border-top: 1px solid #eee;
    padding-top: 12px;
}

/* Modal Styles */
#mystery-items-details-modal .modal-panel {
    max-width: 750px;
    width: unset;
}

#mystery-items-details-modal .modal-content {
    padding-bottom: 0;
}

#mystery-items-details-modal h3 {
    margin-top: 30px;
    font-weight: 600;
}

#mystery-items-details-modal h4 {
    font-weight: 600;
    color: rgba(0,0,0,0.5);
}

#mystery-items-details-modal ul,
#mystery-items-details-modal ol {
    padding-left: 20px;
    margin-bottom: 24px;
}

#mystery-items-details-modal li {
    margin: 3px 0;
}

#mystery-items-details-modal .threshold-tier {
    background-color: #f0f0f0;
    border-left: 4px solid #4CAF50;
    padding: 10px;
    margin-bottom: 10px;
    overflow: auto;
    min-height: 100px;
}

#mystery-items-details-modal .threshold-tier h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 600;
    color: #333;
}

#mystery-items-details-modal .threshold-tier ul {
    margin-bottom: 0;
}

#mystery-items-details-modal .threshold-tier img {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid #fff;
}

.color-probability {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Cart Item Styles */
.mystery-cart-item {
    /* background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); */
    /* border-left: 4px solid #667eea; */
}

.mystery-cart-item .product-thumbnail {
    position: relative;
}

/* Mystery item image cycling wrapper */
.mystery-item-thumbnail-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

/* Rotating glow border effect */
.mystery-item-thumbnail-wrapper::before {
    content: '';
    position: absolute;
    inset: 0px;
    /* border-radius: 15px; */
    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        transparent 30deg,
        rgba(102, 126, 234, 0.8) 60deg,
        rgba(118, 75, 162, 1) 90deg,
        rgba(102, 126, 234, 0.8) 120deg,
        transparent 150deg,
        transparent 360deg
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 5px;
    animation: rotating-glow 3s linear infinite;
    pointer-events: none;
    z-index: 1000;
    filter: blur(6px);
}

.mystery-item-thumbnail-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

.cart-item-thumbnail-question-mark .material-symbols-outlined,
.mystery-cart-item .material-symbols-outlined {
    opacity: 0.6;
    color: #000;
}

.cart-item-thumbnail-question-mark .material-symbols-outlined,
.mystery-cart-item .material-symbols-outlined {
  font-size: 40px;
}

@media (min-width: 400px) {
    .cart-item-thumbnail-question-mark .material-symbols-outlined,
  .mystery-cart-item .material-symbols-outlined {
    font-size: 100px;
  }
}

/* @media (min-width: 768px) {
  .mystery-cart-item .material-symbols-outlined {
    font-size: 36px;
  }
}

@media (min-width: 1200px) {
  .mystery-cart-item .material-symbols-outlined {
    font-size: 48px;
  }
} */




/* Mystery Item Variation Meta Display (in mini-cart, checkout, etc.) */
.variation-Gender,
.variation-Size,
.variation-Color {
    /* display: inline-block; */
    /* margin-right: 8px;
    margin-bottom: 4px; */
    margin: 0;
}

dt.variation-Gender,
dt.variation-Size,
dt.variation-Color {
    float: left;
}

#side-cart .product-name .variation {
    margin-top: 0;
}

.variation-Gender::after,
.variation-Size::after {
    content: " ";
    white-space: pre;
}

.variation-Gender p,
.variation-Size p,
.variation-Color p {
    display: inline;
    margin: 0;
    padding: 0;
}

/* Checkout-specific layout for mystery items */
.woocommerce-checkout .mystery-cart-item .product-name {
    display: flex !important;
    flex-wrap: wrap;
    /* gap: 0 12px; */
    align-items: flex-start;
}

.woocommerce-checkout .mystery-cart-item .cart-item-thumbnail {
    flex: 0 0 auto;
    align-self: flex-start;
}

.woocommerce-checkout .mystery-cart-item .cart-item-info {
    flex: 1 1 0;
    min-width: 0;
}

.woocommerce-checkout .mystery-cart-item .variation {
    flex: 1 1 100%;
    padding-left: calc(75px + 12px); /* Offset for thumbnail width + gap */
}

.woocommerce-checkout .mystery-cart-item .cart-item-title {
    /* margin-bottom: 4px; */
}

.mystery-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mystery-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.mystery-item-details {
    padding-left: 0;
    /* margin-bottom: 12px; */
}

/* .mystery-color {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(255,215,0,0.2);
    border-radius: 6px;
    display: inline-block;
} */

.mystery-label {
    /* font-weight: 600; */
    /* margin-right: 5px; */
    color: #555;
    width: 70px;
    display: inline-block;
}

.mystery-value {
    /* color: #667eea; */
    font-weight: bold;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1;
    display: inline-block;
}

.mystery-selectors {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-direction: column;
    margin-bottom: 4px;
}

.mystery-selector {
    display: flex;
    /* flex-direction: column; */
    gap: 5px;
    align-items: center;
}

.mystery-selector label {
    /* font-size: 12px; */
    /* font-weight: 600; */
    color: #555;
    /* text-transform: uppercase; */
    /* letter-spacing: 0.5px; */
    width: 70px;
    /* margin-right: 5px; */
}

.mystery-size-select,
.mystery-gender-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    text-transform: capitalize;
}

.mystery-size-select:hover,
.mystery-gender-select:hover,
.mystery-size-select:focus,
.mystery-gender-select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* Skeleton loader for mystery selectors */
.mystery-selector.loading select {
    opacity: 0;
    pointer-events: none;
}

.mystery-selector.loading {
    position: relative;
}

.mystery-selector.loading::after {
    content: '';
    position: absolute;
    left: 75px; /* Label width (70px) + margin (5px) */
    top: 0;
    height: 100%;
    width: 100px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.mystery-locked {
    color: #999;
    cursor: not-allowed;
    font-size: 18px;
}

/* Reveal Animation Styles */
.mystery-reveal-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 40px;
    margin: 30px 0;
    color: white;
}

.mystery-reveal-container h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 30px;
    color: white;
}

.mystery-reveal-item {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    display: flex;
    gap: 30px;
    align-items: center;
    color: #333;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.mystery-reveal-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

.mystery-reveal-animation {
    flex-shrink: 0;
}

.mystery-box {
    position: relative;
    width: 150px;
    height: 150px;
}

.mystery-box-lid {
    font-size: 100px;
    text-align: center;
    transition: all 0.8s ease;
    animation: gift-bounce 2s infinite;
}

.mystery-reveal-item.revealed .mystery-box-lid {
    transform: translateY(-150px) rotate(20deg);
    opacity: 0;
}

@keyframes gift-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.mystery-box-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.6s ease 0.4s;
}

.mystery-reveal-item.revealed .mystery-box-content {
    opacity: 1;
    transform: scale(1);
}

.mystery-box-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.mystery-reveal-details {
    flex-grow: 1;
}

.mystery-reveal-details h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #667eea;
}

.mystery-reveal-specs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reveal-spec {
    display: flex;
    gap: 10px;
    font-size: 16px;
}

.spec-label {
    font-weight: 600;
    color: #555;
}

.spec-value {
    color: #333;
}

.mystery-color-reveal .spec-value {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    animation: color-glow 1.5s ease infinite;
}

@keyframes color-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.mystery-reveal-message {
    text-align: center;
    margin-top: 30px;
    font-size: 18px;
    animation: message-fade-in 1s ease 2s both;
}

@keyframes message-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .mystery-selectors {
        flex-direction: column;
    }

    .mystery-reveal-item {
        flex-direction: column;
        text-align: center;
    }

    .mystery-milestone-details {
        top: 60px;
    }
}

/* ========================================
   MYSTERY REVEAL OVERLAY - Full Screen
   ======================================== */

/* Full-Screen Mystery Reveal Overlay */
#mystery-reveal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999999;
    display: none; /* Hidden by default, shown by JS */
    overflow-y: auto;
}

/* Centered Content Container */
.mystery-reveal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 900px;
    width: 90%;
    padding: 40px;
}

/* Header */
.mystery-reveal-header {
    text-align: center;
    color: white;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Items Grid */
.mystery-reveal-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}

/* Individual Item Card */
.mystery-reveal-item-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Rotating glow border effect */
.mystery-reveal-item-card::before {
    content: '';
    position: absolute;
    inset: 0px;
    border-radius: 12px;
    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        transparent 30deg,
        rgba(102, 126, 234, 0.8) 60deg,
        rgba(118, 75, 162, 1) 90deg,
        rgba(102, 126, 234, 0.8) 120deg,
        transparent 150deg,
        transparent 360deg
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 6px;
    animation: rotating-glow 3s linear infinite;
    pointer-events: none;
    z-index: 1;
    filter: blur(6px);
}





/* Floating effect for images */
.mystery-reveal-item-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
    animation: float 10s ease-in-out infinite;
    aspect-ratio: 1/1;
    object-fit: contain;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Product Name */
.mystery-reveal-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

/* Revealed Color */
.mystery-reveal-color {
    font-size: 24px;
    font-weight: bold;
    /* color: #667eea; */
    text-transform: uppercase;
    margin-bottom: 12px;
    
}

.mystery-reveal-free-tag {
    font-size: 24px;
    font-weight: bold;
    /* color: #667eea; */
    text-transform: uppercase;
    width: 100%;
    margin-top: auto;
    border-top: 1px solid #ddd;
    padding-top: 10px;
    line-height: 1;
    letter-spacing: 10px;
}

/* Continue Button */
#mystery-reveal-continue {
    display: block;
    margin: 0 auto;
    padding: 15px 50px;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#mystery-reveal-continue:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .mystery-reveal-header {
        font-size: 24px;
    }

    /* .mystery-reveal-items {
        grid-template-columns: 1fr;
    } */

    .mystery-reveal-content {
        padding: 0px;
    }

    .mystery-reveal-item-card {
        padding: 12px;
    }

    .mystery-reveal-color {
        font-size: 12px;
    }

    .mystery-reveal-product-name {
        font-size: 10px;
    }

    .mystery-reveal-free-tag {
        font-size: 12px;
        letter-spacing: normal;
    }

    .mystery-reveal-items {
        gap: 4px;
    }
}

#mystery-items-details-modal-button {
    display: none;
}