/* styles.css */

/* Basic resets and styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #1e272e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

h1 {
    color: #e74c3c;
    margin-bottom: 25px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.wheel-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto;
    perspective: 1000px;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    transform-style: preserve-3d;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.7), inset 0 0 30px rgba(255, 255, 255, 0.1);
    display: flex; /* To center the spin button */
    justify-content: center;
    align-items: center;
}

.segment {
    position: absolute;
    width: 50%;
    height: 50%;
    top: 0;
    left: 50%;
    transform-origin: 0% 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 15px;
    color: #ffffff;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 1.2em;
}

/* Create segments with 3D rotation for 5 segments */
.segment:nth-child(1) {
    transform: rotate(0deg) skewY(-18deg);
    background: linear-gradient(45deg, #FF6B6B, #FFD93D);
}
.segment:nth-child(2) {
    transform: rotate(72deg) skewY(-18deg);
    background: linear-gradient(45deg, #FFD93D, #1DD1A1);
}
.segment:nth-child(3) {
    transform: rotate(144deg) skewY(-18deg);
    background: linear-gradient(45deg, #1DD1A1, #54a0ff);
}
.segment:nth-child(4) {
    transform: rotate(216deg) skewY(-18deg);
    background: linear-gradient(45deg, #54a0ff, #5f27cd);
}
.segment:nth-child(5) {
    transform: rotate(288deg) skewY(-18deg);
    background: linear-gradient(45deg, #5f27cd, #ff9ff3);
}

.pointer {
    width: 0; 
    height: 0; 
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 50px solid #f1c40f;
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.2));
}

/* Spin Button at the Center */
#spinButton {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #e74c3c;
    color: #ffffff;
    border: none;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

#spinButton:hover {
    background-color: #c0392b;
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(231, 76, 60, 0.7);
}

.hidden {
    display: none;
}

#result, #formContainer, #couponContainer {
    margin-top: 30px;
}

#result h2, #formContainer h2, #couponContainer h2 {
    margin-bottom: 15px;
    color: #34495e;
}

#prize {
    font-weight: bold;
    color: #e67e22;
    font-size: 1.5em;
}

label {
    display: block;
    text-align: left;
    margin: 15px 0 5px;
    color: #2c3e50;
    font-size: 1em;
}

input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input:focus {
    border-color: #e74c3c;
    outline: none;
}

button[type="submit"], #claimButton {
    margin-top: 20px;
    padding: 12px 30px;
    background-color: #1abc9c;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(26, 188, 156, 0.5);
}

button[type="submit"]:hover, #claimButton:hover {
    background-color: #16a085;
    transform: scale(1.05);
    box-shadow: 0 15px 25px rgba(26, 188, 156, 0.7);
}

#couponCode {
    font-size: 1.8em;
    font-weight: bold;
    color: #e74c3c;
    margin: 20px 0;
}

@media (max-width: 480px) {
    .wheel-container {
        width: 260px;
        height: 260px;
    }
    
    .segment {
        font-size: 0.9em;
        padding-bottom: 10px;
    }
    
    #spinButton {
        width: 60px;
        height: 60px;
        font-size: 1em;
    }
    
    h1 {
        font-size: 1.4em;
    }
}
