/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#game-container {
    width: 90%;
    max-width: 1000px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.screen {
    padding: 40px;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

h1 {
    color: #1a2a6c;
    margin-bottom: 30px;
    font-size: 2.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h2 {
    color: #1a2a6c;
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, #4e54c8, #8f94fb);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 15px;
    box-shadow: 0 4px 15px rgba(78, 84, 200, 0.3);
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(78, 84, 200, 0.4);
}

.primary-btn:active {
    transform: translateY(1px);
}

.mode-btn, .level-btn, .type-btn {
    background-color: rgba(255, 255, 255, 0.8);
    color: #1a2a6c;
    border: 2px solid rgba(78, 84, 200, 0.2);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mode-btn:hover, .level-btn:hover, .type-btn:hover {
    background-color: rgba(78, 84, 200, 0.1);
    border-color: rgba(78, 84, 200, 0.5);
    transform: translateY(-2px);
}

.mode-btn.selected, .level-btn.selected, .type-btn.selected {
    background: linear-gradient(135deg, #4e54c8, #8f94fb);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(78, 84, 200, 0.3);
}

.mode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Start Screen */
.game-modes, .difficulty-levels, .game-types {
    margin-bottom: 20px;
}

/* Gameplay Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #4e54c8, #8f94fb);
    color: white;
    border-bottom: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.game-header .score-container, .game-header .game-info {
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#map-container {
    height: 450px;
    width: 100%;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

.question-container {
    padding: 30px;
    background-color: rgba(249, 249, 249, 0.9);
    border-top: none;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 2;
}

#text-input-container {
    position: relative;
    margin: 20px auto;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#answer-input {
    width: 70%;
    padding: 16px 20px;
    font-size: 1.1rem;
    border: 2px solid rgba(78, 84, 200, 0.2);
    border-radius: 50px;
    margin-right: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    outline: none;
}

#answer-input:focus {
    border-color: #4e54c8;
    box-shadow: 0 4px 20px rgba(78, 84, 200, 0.15);
}

#autocomplete-container {
    position: absolute;
    width: 70%;
    max-height: 250px;
    overflow-y: auto;
    background-color: white;
    border: none;
    border-radius: 15px;
    z-index: 10;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

.autocomplete-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: rgba(78, 84, 200, 0.1);
}

#multiple-choice-container {
    margin: 30px auto;
    max-width: 600px;
}

#options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.option-btn {
    background-color: rgba(255, 255, 255, 0.8);
    color: #1a2a6c;
    border: 2px solid rgba(78, 84, 200, 0.2);
    padding: 16px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.option-btn:hover {
    background-color: rgba(78, 84, 200, 0.1);
    border-color: rgba(78, 84, 200, 0.5);
    transform: translateY(-2px);
}

.option-btn.correct {
    background: linear-gradient(135deg, #43c6ac, #27ae60);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.option-btn.incorrect {
    background: linear-gradient(135deg, #ff416c, #e74c3c);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

#feedback-container {
    padding: 30px;
    background-color: rgba(249, 249, 249, 0.9);
    border-top: none;
    text-align: center;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.5s ease-in-out;
}

#answer-feedback {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#location-fact {
    font-style: italic;
    color: #555;
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.5;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* End Screen */
.results-container {
    background: linear-gradient(135deg, rgba(78, 84, 200, 0.1), rgba(143, 148, 251, 0.1));
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(78, 84, 200, 0.2);
}

.results-container p {
    font-size: 1.4rem;
    margin: 15px 0;
    font-weight: 500;
    color: #1a2a6c;
}

/* Responsive Design */
@media (max-width: 768px) {
    #game-container {
        width: 95%;
        max-width: 100%;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .screen {
        padding: 25px 15px;
    }
    
    .mode-btn, .level-btn, .type-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        margin: 5px;
    }
    
    .primary-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
        margin: 10px;
    }
    
    #map-container {
        height: 300px;
    }
    
    .game-header {
        padding: 15px;
    }
    
    .game-header .score-container, .game-header .game-info {
        font-size: 1rem;
    }
    
    .question-container {
        padding: 20px 15px;
    }
    
    #text-input-container {
        flex-direction: column;
        align-items: center;
    }
    
    #answer-input {
        width: 90%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    #autocomplete-container {
        width: 90%;
    }
    
    #options-container {
        grid-template-columns: 1fr;
    }
    
    #feedback-container {
        padding: 20px 15px;
    }
    
    #answer-feedback {
        font-size: 1.2rem;
    }
    
    #location-fact {
        font-size: 1rem;
        padding: 10px;
    }
    
    .results-container {
        padding: 20px;
    }
    
    .results-container p {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .game-modes, .difficulty-levels, .game-types {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .mode-btn, .level-btn, .type-btn {
        width: 90%;
        margin: 5px 0;
    }
}