/**
 * Spin the Wheel Challenge - Frontend Styles (BLACK/WHITE SPIRAL VERSION)
 */

.stwc-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(circle at center, #2c2c2c 0%, #1a1a1a 70%, #000000 100%);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
}

/* Controls - WHITE LABELS */
.stwc-controls {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: end;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.stwc-control-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 150px;
}

.stwc-control-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #ffffff;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.stwc-control-group select {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: all 0.3s ease;
    min-height: 40px;
    backdrop-filter: blur(5px);
}

.stwc-control-group select:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 1);
}

.stwc-control-group select option {
    background: white;
    color: #333;
    padding: 8px;
}

/* Wheel Container - BLACK/WHITE SPIRAL THEME */
.stwc-wheel-container {
    background: radial-gradient(circle at center, #ffffff 0%, #f0f0f0 20%, #cccccc 60%, #999999 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.8),
        inset 0 0 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Hypnotic spiral background animation */
.stwc-wheel-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        #000000,
        #ffffff,
        #000000,
        #ffffff,
        #000000
    );
    animation: stwc-spiral-rotate 30s linear infinite;
    z-index: 1;
    opacity: 0.1;
}

@keyframes stwc-spiral-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#stwc-wheel {
    display: block;
    margin: 0 auto;
    border-radius: 50%;
    box-shadow: 
        0 0 0 5px #000000,
        0 0 0 10px #ffffff,
        0 0 0 15px #000000,
        0 0 30px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 2;
    background: #ffffff;
}

.stwc-spin-controls {
    margin-top: 20px;
    position: relative;
    z-index: 3;
}

.stwc-spin-button {
    background: linear-gradient(135deg, #000000 0%, #333333 50%, #000000 100%);
    border: 3px solid #ffffff;
    color: white;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.6),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.stwc-spin-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.stwc-spin-button:hover:not(:disabled)::before {
    left: 100%;
}

.stwc-spin-button:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.8),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, #333333 0%, #555555 50%, #333333 100%);
}

.stwc-spin-button:active:not(:disabled) {
    transform: translateY(0) scale(1.02);
}

.stwc-spin-button:disabled {
    background: #666;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    border-color: #999;
}

/* Loading */
.stwc-loading {
    text-align: center;
    padding: 40px 20px;
    color: #ffffff;
}

.stwc-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #ffffff;
    border-radius: 50%;
    animation: stwc-spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

@keyframes stwc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.stwc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.stwc-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 50%, #e0e0e0 100%);
    border: 5px solid #000000;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.8),
        inset 0 0 0 2px #ffffff;
    animation: stwc-modal-appear 0.5s ease-out;
    color: #000000;
}

@keyframes stwc-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.stwc-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #000000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stwc-close:hover {
    color: #ff0000;
    transform: scale(1.2) rotate(90deg);
}

/* Result */
.stwc-result {
    text-align: center;
}

.stwc-emoji {
    font-size: 80px;
    margin-bottom: 20px;
    display: block;
    line-height: 1;
    animation: stwc-emoji-pulse 2s ease-in-out infinite;
}

@keyframes stwc-emoji-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.stwc-title {
    font-size: 28px;
    font-weight: bold;
    color: #000000;
    margin: 0 0 20px 0;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.stwc-description {
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
    margin-bottom: 30px;
}

.stwc-description h1,
.stwc-description h2,
.stwc-description h3,
.stwc-description h4,
.stwc-description h5,
.stwc-description h6 {
    margin: 20px 0 10px 0;
    color: #000000;
}

.stwc-description p {
    margin: 10px 0;
}

.stwc-description ul,
.stwc-description ol {
    text-align: left;
    margin: 10px 0;
    padding-left: 20px;
}

.stwc-description a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.stwc-description a:hover {
    text-decoration: underline;
}

.stwc-description .button,
.stwc-description button {
    background: #000000;
    color: white;
    padding: 10px 20px;
    border: 2px solid #333333;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    margin: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stwc-description .button:hover,
.stwc-description button:hover {
    background: #333333;
    text-decoration: none;
    transform: translateY(-2px);
}

#stwc-spin-again {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    border: 2px solid #ffffff;
    color: white;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    margin-top: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#stwc-spin-again:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, #333333 0%, #555555 100%);
}

/* Error Message */
.stwc-error-message {
    text-align: center;
    padding: 40px;
    color: #ffffff;
    background: rgba(220, 50, 50, 0.8);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.stwc-error-message h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 24px;
}

.stwc-error-message p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stwc-container {
        padding: 15px;
        margin: 10px;
    }
    
    .stwc-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px;
    }
    
    .stwc-control-group {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }
    
    .stwc-control-group select {
        width: 100%;
    }
    
    .stwc-wheel-container {
        padding: 20px;
        border-radius: 15px;
    }
    
    #stwc-wheel {
        width: 300px !important;
        height: 300px !important;
    }
    
    .stwc-spin-button {
        padding: 12px 25px;
        font-size: 16px;
    }
    
    .stwc-modal-content {
        padding: 30px 20px;
        margin: 0 10px;
    }
    
    .stwc-emoji {
        font-size: 60px;
    }
    
    .stwc-title {
        font-size: 24px;
    }
    
    .stwc-description {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    #stwc-wheel {
        width: 250px !important;
        height: 250px !important;
    }
    
    .stwc-emoji {
        font-size: 50px;
    }
    
    .stwc-title {
        font-size: 20px;
    }
    
    .stwc-spin-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .stwc-control-group label {
        font-size: 13px;
    }
}

/* Browser-specific dropdown fixes */
.stwc-control-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Accessibility */
.stwc-spin-button:focus,
.stwc-control-group select:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.stwc-modal-content:focus {
    outline: none;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .stwc-control-group select {
        border-width: 3px;
        border-color: #ffffff;
        color: #000;
        background: white;
    }
    
    .stwc-spin-button {
        border: 3px solid white;
    }
    
    .stwc-modal-content {
        border: 5px solid #000000;
    }
    
    .stwc-control-group label {
        color: #ffffff;
        font-weight: bold;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .stwc-spin-button,
    .stwc-modal-content,
    #stwc-spin-again,
    .stwc-emoji {
        transition: none;
        animation: none;
    }
    
    .stwc-spinner {
        animation: none;
        border-top-color: transparent;
    }
    
    .stwc-wheel-container::before {
        animation: none;
    }
    
    @keyframes stwc-modal-appear {
        from, to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }
}