/* CSS for Spin the Wheel & Promo Code System */

/* --- SPIN THE WHEEL MODAL --- */
.wheel-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.wheel-modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.wheel-modal-card {
    background: linear-gradient(135deg, #16161a 0%, #0d0d11 100%);
    border: 1px solid rgba(255, 215, 0, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.05);
    border-radius: 24px;
    width: 90%;
    max-width: 820px;
    padding: 40px;
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: center;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.wheel-modal-overlay.visible .wheel-modal-card {
    transform: translateY(0) scale(1);
}

.wheel-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    z-index: 10;
}

.wheel-close-btn:hover {
    color: var(--color-gold, #ffd700);
    transform: scale(1.1);
}

/* Left side: The Wheel */
.wheel-container {
    position: relative;
    width: 340px;
    height: 340px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-outer-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 6px solid #1a1a24;
    background: #0d0d11;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.2), inset 0 0 20px rgba(0, 0, 0, 0.8);
    position: relative;
    padding: 4px;
    box-sizing: border-box;
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    transform: rotate(0deg);
    transition: transform 8s cubic-bezier(0.1, 0.8, 0.1, 1);
}

.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 24px solid var(--color-gold, #ffd700);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
    z-index: 5;
}

.wheel-center-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, #2a2a35 0%, #111116 100%);
    border: 3px solid var(--color-gold, #ffd700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
    z-index: 6;
}

/* Right side: Form / Copy */
.wheel-content-side {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.wheel-title {
    font-family: var(--font-title);
    color: var(--color-gold, #ffd700);
    font-size: 2.2rem;
    margin: 0 0 10px 0;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.25);
    line-height: 1.2;
}

.wheel-subtitle {
    font-family: var(--font-body);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 25px 0;
}

.wheel-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wheel-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 12px;
    padding: 14px 18px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.wheel-input:focus {
    border-color: var(--color-gold, #ffd700);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

.wheel-checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    user-select: none;
    line-height: 1.4;
}

.wheel-checkbox-container input {
    margin-top: 2px;
    cursor: pointer;
}

.wheel-checkbox-container a {
    color: var(--color-gold, #ffd700);
    text-decoration: underline;
}

.wheel-spin-btn {
    background: linear-gradient(90deg, #2d6b1f 0%, #3a7d2b 100%);
    border: none;
    border-radius: 12px;
    padding: 15px 25px;
    color: #fff;
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 5px 15px rgba(58, 125, 43, 0.35);
}

.wheel-spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(58, 125, 43, 0.5);
    filter: brightness(1.1);
}

.wheel-spin-btn:active:not(:disabled) {
    transform: translateY(0);
}

.wheel-spin-btn:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: none;
    cursor: not-allowed;
}

.wheel-decline-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 10px;
    align-self: center;
    transition: color 0.2s;
}

.wheel-decline-btn:hover {
    color: #fff;
}

/* Success / Coupon Display */
.wheel-success-view {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.wheel-success-emoji {
    font-size: 4rem;
    animation: wheel-bounce 1s infinite alternate;
}

.coupon-box {
    background: rgba(255, 215, 0, 0.08);
    border: 2px dashed var(--color-gold, #ffd700);
    border-radius: 12px;
    padding: 16px 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin: 15px 0;
    position: relative;
    overflow: hidden;
}

.coupon-code {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.coupon-copy-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 16px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.coupon-copy-btn:hover {
    background: var(--color-gold, #ffd700);
    color: #000;
    border-color: var(--color-gold, #ffd700);
}

.coupon-auto-apply-msg {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
}


/* --- PROMO CODE INPUT IN CART --- */
.cart-promo-wrapper {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-promo-title {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.cart-promo-input-group {
    display: flex;
    gap: 8px;
}

#cart-promo-input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

#cart-promo-input:focus {
    border-color: var(--color-gold, #ffd700);
}

#cart-promo-apply-btn {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid var(--color-gold, #ffd700);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--color-gold, #ffd700);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

#cart-promo-apply-btn:hover {
    background: var(--color-gold, #ffd700);
    color: #000;
}

.cart-promo-badge {
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-gold, #ffd700);
}

.cart-promo-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
    transition: color 0.2s;
}

.cart-promo-remove:hover {
    color: #ff6b6b;
}

/* Promo Free Item Choose Button */
.promo-choose-btn {
    width: 100%;
    margin-top: 8px;
    background: linear-gradient(90deg, #ffd700 0%, #ffaa00 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    color: #000;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.promo-choose-btn:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.35);
}


/* --- FREE ITEM PICKER MODAL --- */
.free-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 210000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.free-picker-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.free-picker-card {
    background: #111116;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    width: 90%;
    max-width: 680px;
    max-height: 85vh;
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.free-picker-overlay.visible .free-picker-card {
    transform: scale(1);
}

.free-picker-header {
    margin-bottom: 20px;
}

.free-picker-title {
    font-family: var(--font-title);
    color: var(--color-gold, #ffd700);
    font-size: 1.6rem;
    margin: 0 0 5px 0;
}

.free-picker-subtitle {
    font-family: var(--font-body);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin: 0;
}

.free-picker-list {
    flex-grow: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    padding-right: 5px;
}

.free-picker-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s;
}

.free-picker-item:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.free-picker-item-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.free-picker-item-name {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.4em;
    line-height: 1.2;
}

/* Animations */
@keyframes wheel-bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .wheel-modal-card {
        flex-direction: column;
        padding: 30px 20px;
        gap: 25px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .wheel-container {
        width: 260px;
        height: 260px;
    }
    
    .wheel-title {
        font-size: 1.7rem;
        text-align: center;
    }
    
    .wheel-subtitle {
        font-size: 0.85rem;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .free-picker-list {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }
}
