/* public/css/spin-wheel.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.header {
    width: 100%;
    padding: 10px;
    text-align: center;
    min-height: 20px;
}

.form-logo {
    text-align: center;
    margin-bottom: 5px;
}

.logo {
    max-width: 280px;
    height: auto;
    object-fit: contain;
}

.main-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 50px;
    padding: 20px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* Wheel Container */
.wheel-container {
    position: relative;
    width: 800px;
    height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#chart {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 10;
}

/* Wheel decoration background */
.wheel-decoration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    z-index: 1;
    pointer-events: none;
}

/* Outer frame - static on top */
.wheel-outer-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    z-index: 15;  /* Higher than rotating elements but lower than pointer */
    pointer-events: none;
}

/* Rotating container for wheel and decoration together */
.wheel-rotating-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    transform-origin: center center;
}

/* D3.js text styling */
.wheelText {
    font: 16px serif;
    font-family: "Arial Black", Gadget, sans-serif;
    font-weight: normal;
    text-align: center;
    text-shadow: 2px 2px #555555;
    fill: white;
}

.pointer {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-top: 50px solid #FFD700;
    z-index: 20;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}

/* Large Desktop (default) */
@media (min-width: 1200px) {
    .wheel-container {
        width: 900px;
        height: 1000px;
    }
    
    .wheel-decoration {
        width: 800px;
        height: 800px;
    }
    
    .wheel-outer-frame {
        width: 700px;
        height: 700px;
    }
    
    .wheel-rotating-container {
        width: 700px;
        height: 700px;
    }
    
    .pointer {
        top: 215px;
        border-left: 20px solid transparent;
        border-right: 20px solid transparent;
        border-top: 70px solid #FFD700;
    }
}

/* Tablet and smaller desktop */
@media (max-width: 1199px) and (min-width: 769px) {
    .main-container {
        gap: 30px;
    }
    
    .wheel-container {
        width: 500px;
        height: 500px;
    }
    
    .wheel-decoration {
        width: 600px;
        height: 600px;
    }
    
    .wheel-outer-frame {
        width: 500px;
        height: 500px;
    }
    
    .wheel-rotating-container {
        width: 500px;
        height: 500px;
    }
    
    .form-container {
        max-width: 350px;
    }
    .pointer {
        top: 45px;
        border-left: 20px solid transparent;
        border-right: 20px solid transparent;
        border-top: 70px solid #FFD700;
    }
}

/* Mobile and Tablet Portrait */
.welcome-modal {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

.welcome-modal-content {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    margin: 20px;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    text-align: center;
    animation: slideIn 0.5s ease;
}

.welcome-modal h2 {
    color: #8B0000;
    font-size: 32px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.welcome-modal p {
    color: #8B0000;
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.enter-button {
    padding: 15px 50px;
    background: linear-gradient(135deg, #8B0000, #DC143C);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(139,0,0,0.3);
}

.enter-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 25px rgba(139,0,0,0.4);
}

/* Form Container */
.form-container {
    background: linear-gradient(135deg, rgba(255,215,0,0.95), rgba(255,193,37,0.95));
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 100%;
}

.hero-text {
    text-align: center;
    margin-bottom: 25px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 900;
    color: #8B0000;
    position: relative;
    overflow: hidden;
}
.hero-text h1::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: shine 2s infinite;
}
@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.hero-text p {
    color: #8B0000;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 10px;
}

.livechat-link {
    color: #0066CC;
    text-decoration: none;
    font-weight: bold;
}

.livechat-link:hover {
    text-decoration: underline;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: #8B0000;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #FFA500;
    box-shadow: 0 0 10px rgba(255,165,0,0.3);
}

.spin-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff0000, #790000);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 20px rgba(126, 0, 88, 0.3);
    position: relative;      /* needed for ::after */
    overflow: hidden;        /* keeps shine inside */
}

.spin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 25px rgba(255, 0, 0, 0.5);
}

/* 🔒 Disabled state */
.spin-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ✨ Animated Shine Effect */
.spin-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: shine 2.5s infinite;
}

.winners-button {
    width: 100%;
    padding: 15px;
    background: white;
    color: #8B0000;
    border: 2px solid #FFD700;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    text-transform: uppercase;
}

.winners-button:hover {
    background: #FFD700;
    transform: translateY(-2px);
}

.bottom-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.bottom-button {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #ff0000, #790000);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.bottom-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(179, 0, 170, 0.555);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    margin: auto;
    margin-top: 50px;
    margin-bottom: 50px;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    animation: slideIn 0.5s ease;
    text-align: center;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 30px;
    font-weight: bold;
    color: #8B0000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close:hover {
    transform: scale(1.2);
}

.celebration-icons {
    font-size: 50px;
    margin: 20px 0;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.prize-name {
    font-size: 32px;
    color: #8B0000;
    font-weight: bold;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.modal-description {
    color: #111;
    font-size: 18px;
    margin: 20px 0;
}

.ok-button {
    padding: 12px 40px;
    background: #8B0000;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ok-button:hover {
    transform: scale(1.05);
    background: #a10000;
}

.winners-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

.winner-item {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    display: flex;
    font-weight: bold;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    color: white;
    font-size: 15px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .main-container {
        flex-direction: column;
        gap: 20px;
        padding: 10px;
    }

    .wheel-container {
        width: 430px;
        height: 430px;
    }

    .wheel-decoration {
        width: 400px;
        height: 400px;
    }
    
    .wheel-outer-frame {
        width: 350px;
        height: 350px;
    }

    .wheel-rotating-container {
        width: 300px;
        height: 300px;
    }

    .pointer {
        top: 72px;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 50px solid #FFD700;
    }

    .form-container {
        padding: 20px;
        margin: 0 10px;
        max-width: calc(100% - 20px);
    }
    
    .form-logo {
        margin-bottom: 5px;
    }
    
    .logo {
        max-width: 200px;
    }

    .hero-text h1 {
        font-size: 18px;
    }

    .hero-text p {
        font-size: 12px;
    }

    /* Welcome Modal Mobile Fix */
    .welcome-modal {
        padding: 15px;
    }

    .welcome-modal-content {
        padding: 25px 15px;
        margin: 10px;
        max-width: calc(100% - 20px);
        width: 100%;
    }

    .welcome-modal h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .welcome-modal p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .enter-button {
        padding: 12px 30px;
        font-size: 16px;
    }

    /* Regular Modals Mobile Fix - Only apply these styles on mobile */
    .modal {
        padding: 15px;
    }

    .modal-content {
        width: calc(100% - 30px);
        max-width: 400px;
        margin: 20px auto;
        padding: 20px 15px;
        max-height: 80vh;
        overflow-y: auto;
        top: 30%;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    .prize-name {
        font-size: 20px;
        margin: 15px 0;
    }

    .modal-description {
        font-size: 14px;
        margin: 15px 0;
    }

    .celebration-icons {
        font-size: 35px;
        margin: 15px 0;
    }

    .ok-button {
        padding: 10px 30px;
        font-size: 16px;
    }

    .close {
        right: 10px;
        top: 10px;
        font-size: 24px;
    }

    .winners-list {
        max-height: 300px;
    }

    .winner-item {
        padding: 10px;
        font-size: 14px;
    }

    .input-group label {
        font-size: 14px;
    }

    .input-group input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .spin-button {
        padding: 12px;
        font-size: 16px;
    }

    .winners-button {
        padding: 12px;
        font-size: 14px;
    }

    .bottom-button {
        padding: 10px;
        font-size: 12px;
    }
}

/* Smaller mobile devices */
@media (max-width: 430px) {
    .wheel-container {
        width: 400px;
        height: 400px;
    }

    .wheel-decoration {
        width: 400px;
        height: 400px;
    }
    
    .wheel-outer-frame {
        width: 350px;
        height: 350px;
    }

    .wheel-rotating-container {
        width: 300px;
        height: 300px;
    }
    .pointer {
        top: 55px;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 50px solid #FFD700;
    }

    .welcome-modal h2 {
        font-size: 20px;
    }

    .welcome-modal p {
        font-size: 13px;
    }

    .modal-content {
        padding: 15px;
    }

    .celebration-icons {
        font-size: 30px;
    }
}