/* css/wheel.css */

/* Update divider custom styles for light theme */
.divider-custom.divider-light .divider-custom-line {
    background-color: var(--text-color);
}

.divider-custom.divider-light .divider-custom-icon {
    color: var(--text-color);
}

#wheel-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

#wheel-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    /* This property ensures the container is always a square */
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

#fortune-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid var(--divider-color);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    transition: transform 0s; /* Default is no transition */
}

body.dark-theme #fortune-wheel {
    border-color: var(--divider-light-color);
}


#wheel-pointer {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--bs-danger);
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.3));
}

#spin-btn {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    border: 5px solid white;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    z-index: 5;
    /* Flexbox for centering */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0;
}
#spin-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}


#controls-container {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    border-radius: 0.5rem;
    height: 100%;
}

body.dark-theme #controls-container .card-title {
    color: var(--text-color);
}

#options-list {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--card-border);
    border-radius: 0.375rem;
}

#options-list .btn-group {
    gap: 2px;
}

#options-list .btn-group .btn {
    padding: 0.25rem 0.5rem;
}

/* Dark theme styles for options list */
body.dark-theme #options-list {
    background-color: #1a1a1a;
}

body.dark-theme #options-list .list-group-item {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
}

body.dark-theme #options-list .list-group-item:hover {
    background-color: #3d3d3d;
}

body.dark-theme #options-list .option-color-swatch {
    border-color: #404040;
}

body.dark-theme #options-list .text-muted {
    color: #a0a0a0 !important;
}

/* Custom scrollbar for options list */
#options-list::-webkit-scrollbar {
    width: 8px;
}
#options-list::-webkit-scrollbar-track {
    background: var(--section-alt-bg);
    border-radius: 4px;
}
#options-list::-webkit-scrollbar-thumb {
    background-color: var(--secondary-text-color);
    border-radius: 4px;
    border: 2px solid var(--section-alt-bg);
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0;
    will-change: transform, opacity;
    animation: fall 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fall {
    0% {
        transform: translateY(0) rotateZ(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(105vh) rotateZ(720deg);
        opacity: 0;
    }
}

/* Winners List Styles */
#winners-section {
    padding-top: 0;
    padding-bottom: 6rem;
    background-color: var(--section-alt-bg);
}

#winners-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--card-border);
    border-radius: .375rem;
    background-color: var(--card-bg);
    padding: 0.5rem;
}

#winners-list .list-group-item {
    background-color: transparent;
    border-left: 0;
    border-right: 0;
}

#winners-list .list-group-item:first-child {
    border-top: 0;
}

#winners-list .list-group-item:last-child {
    border-bottom: 0;
}

.winner-name {
    font-weight: bold;
    color: var(--link-color);
}
.winner-color-swatch {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border: 1px solid var(--card-border);
    border-radius: 3px;
    vertical-align: middle;
}
.winner-date {
    font-size: 0.8em;
    color: var(--secondary-text-color);
    margin-left: 0.5rem;
}

/* Style for option color swatch in both options and winners list */
.option-color-swatch {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border: 1px solid var(--card-border);
    border-radius: 3px;
    vertical-align: middle;
}


@media (max-width: 991px) {
    #wheel-container {
        max-width: 400px;
        margin-bottom: 2rem;
    }
     #spin-btn {
        width: 80px;
        height: 80px;
        font-size: 1rem;
    }
    #wheel-pointer {
        border-left-width: 15px;
        border-right-width: 15px;
        border-top-width: 30px;
        top: -10px;
    }
}

@media (max-width: 576px) {
    #options-list .btn-group .btn {
        padding: 0.375rem 0.5rem;
    }
} 
/* 
=====================================================
DEFINITIVE FIX for Modal Overflow on Mobile 
=====================================================
*/

/* Wrap the width override in a media query so it only affects mobile screens */
@media (max-width: 576px) {
    #universalModal .modal-dialog {
        max-width: calc(100% - 1rem); /* Only expand on small screens */
        margin-left: auto;
        margin-right: auto;
    }
}

/* This failsafe is fine to keep global */
#universalModal .modal-body {
    overflow-wrap: break-word;
    word-wrap: break-word; 
}

/* Hide audio elements used for sound effects (controlled via JS) */
audio#spin-audio,
audio#confetti-audio {
    display: none !important;
}

