/* Resetting default styles and setting base styles */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: 'Open Sans', sans-serif;
    text-align: center;
    background: linear-gradient(to bottom, #FFD700, #FFECB3),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0, rgba(255, 255, 255, 0.1) 10px, transparent 10px, transparent 20px);
    background-blend-mode: overlay;
    line-height: 1.6;
    color: #333;
}

body {
    margin: 20px auto; /* Centered body with equal margins */
    max-width: 800px; /* Optional: Set a max-width if needed */
}

/* Header Styles */
header {
    background-color: #007BFF;
    color: #fff;
    padding: 25px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 120px;
    overflow: hidden;
}

header h1 {
    font-family: 'Tektur', cursive;
    font-size: 8vw;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    margin: 0;
    line-height: 1;
    color: #fff;
}

/* Section Styles */
section {
    background-color: #f9f9f9;
    padding: 40px;
    margin: 30px auto;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

/* Welcome Message Styles */
#welcome-message p {
    font-size: 2.2em;
    font-weight: 600;
    color: #444;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Question Display Styles */
#question-display {
    font-size: 1.6em;
    min-height: 150px;
    margin-bottom: 40px;
    padding: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    text-align: center;
    background: linear-gradient(to bottom, #FFD700, #FFECB3);
    transition: opacity 0.5s ease-in-out;
}

/* Game Area Styles */
#game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-in-out;
}

/* Game Buttons Styles */
#game-buttons {
    text-align: center;
    margin: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

#game-buttons button {
    margin: 15px;
    padding: 18px 40px; /* Match Begin button padding */
    font-size: 1.4em;
    border: none;
    border-radius: 10px; /* Match Begin button border-radius */
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#next-button {
    background: linear-gradient(to bottom, #4CAF50, #43A047);
    color: #fff;
}

#reset-button {
    background-color: #FF4500;
    color: #fff;
    /* Removed specific padding and font-size adjustments */
}

/* Category Selection Styles */
#category-selection {
    text-align: left;
    margin-bottom: 40px;
    padding: 20px;
}

#category-selection p {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 15px;
}

#category-selection label {
    display: flex; /* Use flexbox for alignment */
    align-items: center; /* Center items vertically */
    margin: 10px auto;
    text-align: left;
    width: fit-content;
    font-size: 1em;
}

#category-selection input[type="checkbox"] {
    margin-right: 10px; /* Adjust spacing between checkbox and label */
    transform: scale(1.3);
    cursor: pointer;
    position: relative;
}

#category-selection input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 4px;
    transform: translateY(-50%);
    background-color: #fff;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#category-selection input[type="checkbox"]:checked::before {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

#category-selection input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 4px;
    width: 8px;
    height: 8px;
    background-color: #fff;
    transform: translateY(-50%);
    border-radius: 2px;
}

#category-selection input[type="checkbox"]:hover::before {
    border-color: #4CAF50;
}

/* Game Settings Styles */
#game-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

#game-settings > div {
    margin: 10px 20px;
}

#game-settings label[for="numQuestions"] {
    font-size: 4.5em;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
    color: #333;
}

#game-settings input[type="number"] {
    padding: 18px;
    border: 2px solid #666;
    border-radius: 10px;
    font-size: 1.6em;
    width: 120px;
    margin-left: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

#game-settings input[type="number"]:focus {
    border-color: #007BFF;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.5);
    outline: none;
}
#game-settings button[type="button"] {
    padding: 18px 40px;
    font-size: 1.4em;
    background: linear-gradient(to bottom, #007BFF, #0056b3);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-top: 30px;
    width: auto;
}

#game-settings button[type="button"]:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    background: linear-gradient(to bottom, #0056b3, #00428f);
}

/* Footer Styles */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background-color: #e0e0e0;
    border-radius: 12px;
    font-size: 0.9em;
    color: #555;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive Design - Mobile Styles */
@media (max-width: 600px) {
    body {
        margin: 10px;
    }

    section {
        margin: 20px auto;
        padding: 30px;
    }

    #game-buttons button {
        padding: 16px 35px;
        font-size: 1.2em;
        display: block;
        width: 100%;
        margin: 10px 0;
    }

    #question-display {
        font-size: 1.4em;
        padding: 20px;
    }

    #category-selection {
        text-align: center;
    }

    #category-selection label {
        display: flex;
        align-items: center;
        margin: 10px auto;
        text-align: left;
        width: fit-content;
        font-size: 1em;
    }

    #game-settings {
        flex-direction: column;
        align-items: center;
    }

    #game-settings > div {
        width: 100%;
        margin: 10px 0;
        text-align: center;
    }

    #game-settings label[for="numQuestions"] {
        font-size: 2.5em;
        text-align: center;
    }

    #game-settings input[type="number"] {
        width: 80px;
        font-size: 1.2em;
        text-align: center;
        margin: 10px auto;
    }

    #game-settings button[type="button"] {
        width: 90%;
        margin: 20px auto;
    }

    #next-button:active,
    #reset-button:active {
        transform: scale(0.95);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
}

/* Hover Styles (Desktop Only) */
@media (hover: hover) {
    #next-button:hover {
        transform: scale(1.05) rotate(2deg);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
        background: linear-gradient(to bottom, #43A047, #3D8B40);
    }

    #reset-button:hover {
        transform: scale(1.05) rotate(2deg);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
        background-color: #E23A00;
    }
}