/* css/style.css */

/* GENERAL BODY & PAGE LAYOUT */
body {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center the fakebody horizontally on the page */
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    padding-top: 20px;
    background: linear-gradient(#e0eafc, #cfdef3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Improved font stack */
    overflow-x: hidden;
    background-image: url(https://i.ibb.co/Ngfnykwj/ibslogonobg.png);
    background-repeat: repeat;
    background-size: 3%;
    background-color: #000000;
    color: #333; /* Default text color */
}

.fakebody {
    background-color: rgba(255, 255, 255, 0.5); /* Slightly less transparent */
    padding: 2em 3em; /* Adjusted padding for a more balanced look */
    border-radius: 1.5em; /* Slightly softer corners */
    max-width: 1000px; /* Adjusted max width for better fit of elements */
    width: 90%; /* Responsive width */
    box-shadow: 0 8px 25px rgba(0,0,0,0.2); /* Deeper shadow */
    margin-bottom: 30px; /* Space above footer */
    box-sizing: border-box; /* Ensures padding is included in width */

    /* Flexbox for vertical stacking and centering content inside fakebody */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center children horizontally */
}

.innerbody {
    width: 100%; /* Ensure it takes full width inside fakebody */
    text-align: center; /* Centers H1 and HR as they are block but not flex items here */
}

h1 {
    font-size: 2.5em; /* Larger, more prominent heading */
    color: #2c3e50; /* Darker, professional color */
    margin-bottom: 0.5em;
    line-height: 1.2;
}

/* DESCRIPTION BOX */
#descriptionBox {
    background-color: rgba(255, 255, 255, 0.8); /* Slightly more transparent than fakebody */
    padding: 1.5em 2.5em; /* Adjusted padding */
    border-radius: 1em;
    margin-top: 1.5em; /* Space below H1 */
    max-width: 700px; /* Optimal reading width */
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1); /* Lighter shadow */
    font-size: 1.05em;
    line-height: 1.7;
    color: #555; /* Softer text color */
    margin-left: auto; /* CENTER THE DESCRIPTION BOX */
    margin-right: auto; /* CENTER THE DESCRIPTION BOX */
}

#descriptionBox p {
    margin: 0;
}

hr {
    border: none;
    border-top: 2px solid #eee; /* Lighter, subtle separator */
    margin: 2em auto; /* Centered with vertical space */
    width: 50%; /* Shorter line for aesthetics */
}

/* WHEEL & CONTROLS CONTAINER */
#wheelContainer {
    display: flex;
    justify-content: center; /* Centers items (controls + canvas) horizontally */
    align-items: flex-start; /* Align items to the top vertically */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    width: 100%; /* Important: Takes full width inside .innerbody for centering */
    margin-top: 1.5em; /* Space from HR */
}

canvas {
    border: 8px solid #000000; /* Blue border for wheel */
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 25px rgba(0,0,0,0.4); /* Enhanced shadow */
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers items within the controls column (textarea, buttons) */
    margin-right: 2.5em; /* Space between controls and wheel */
    margin-bottom: 1em; /* Space for wrapping on small screens */
}

textarea {
    width: 300px;
    height: 200px; /* Increased height for more names */
    margin-bottom: 15px;
    padding: 12px;
    font-size: 1.1em;
    border-radius: 10px; /* Softer corners */
    border: 1px solid #c0c0c0; /* Lighter border */
    resize: vertical; /* Allow vertical resizing only */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); /* Inner shadow for depth */
}

#itemCount {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 10px;
}

select,
button {
    margin: 8px; /* More vertical space */
    padding: 12px 25px; /* More generous padding */
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 30px; /* Pill-shaped buttons */
    border: none;
    background: #3498db; /* Consistent blue with wheel border */
    color: white;
    transition: background 0.3s ease, transform 0.2s ease; /* Smooth hover effects */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); /* Button shadow */
}

select:hover,
button:hover {
    background: #2980b9; /* Darker blue on hover */
    transform: translateY(-2px); /* Slight lift effect */
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background: #cccccc;
    transform: none;
    box-shadow: none;
}

/* COUNTDOWN */
#countdown {
    font-size: 8em;
    color: #333;
    font-weight: bold;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 102;
    background-color: rgba(255, 255, 255, 0.9); /* Slightly more opaque for countdown */
    padding: 25px 50px; /* Larger padding */
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    min-width: 180px;
    text-align: center;
}

/* WINNER POPUP */
#winnerDiv {
    position: fixed; /* Use fixed for full screen overlay */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Darker overlay */
    display: flex; /* Use flex to center content */
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4em; /* Larger winner text */
    font-weight: bold;
    text-shadow: 3px 3px 7px rgba(0,0,0,0.5);
    z-index: 101 !important;
    display: none; /* Hidden by default, JavaScript shows it */
}

#winnerDiv:empty {
    display: none;
}

#lastWinner {
    margin-top: 2em;
    font-size: 1.2em;
    color: #666;
}

/* ADAPTIVE LAYOUT FOR SMALLER SCREENS */
@media (max-width: 850px) {
    .fakebody {
        padding: 1.5em 1em; /* Less padding on smaller screens */
        width: 95%;
    }

    h1 {
        font-size: 1.8em;
    }

    #descriptionBox {
        padding: 1em;
        font-size: 0.95em;
    }

    #wheelContainer {
        flex-direction: column; /* Stack controls and wheel vertically */
        align-items: center; /* Center items when stacked */
    }

    .controls {
        margin-right: 0; /* Remove horizontal margin when stacked */
        margin-bottom: 2em; /* Add vertical space when stacked */
    }

    canvas {
        margin-top: 0; /* Remove top margin from canvas as wheelContainer handles it */
        width: 300px; /* Make wheel smaller on mobile */
        height: 300px;
    }

    textarea {
        width: 90%; /* Make textarea more responsive */
    }

    #countdown {
        font-size: 5em; /* Smaller countdown on mobile */
    }

    #winnerDiv {
        font-size: 2.5em; /* Smaller winner text on mobile */
    }
}