/* Improved eye-comfortable color scheme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8f4f8 0%, #d6eaf8 100%); /* Soft blue-gray gradient */
    min-height: 100vh;
    color: #2c3e50;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header Styles */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 15px;
    height: 50px;
}

.header h1 {
    flex: 1;
    text-align: center;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-links a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: #f0f4f8;
}

h1 {
    color: #1a3c52;
    margin: 0;
    font-size: 2.5rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.05);
    letter-spacing: 1px;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-decoration: none;
    display: inline-block;
}

.nav-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

#map-container {
    background-color: rgba(255, 255, 255, 0.9); /* Clean white with transparency */
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: center;
    border: 1px solid rgba(52, 73, 94, 0.1);
}

.game-info {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    width: 100%;
    max-width: 1000px;
    text-align: center;
    border: 1px solid rgba(52, 73, 94, 0.08);
}

.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 20px;
}

.buttons-container {
    display: flex;
    gap: 15px;
}

.score-container {
    display: flex;
    gap: 15px;
}

.score-item {
    background-color: #e8f6f3; /* Soft mint green */
    padding: 10px 18px;
    border-radius: 10px;
    border: 2px solid #52c4a0;
    font-weight: 600;
    color: #27ae60;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.15);
}

.attempts-item {
    background-color: #fef9e7; /* Soft warm yellow */
    padding: 10px 18px;
    border-radius: 10px;
    border: 2px solid #f1c40f;
    font-weight: 600;
    color: #d68910;
    box-shadow: 0 2px 6px rgba(241, 196, 15, 0.15);
}

#instructions {
    font-size: 1.2rem;
    color: #5d6d7e; /* Muted gray-blue */
    margin-bottom: 15px;
    line-height: 1.4;
}

#state-to-find {
  font-size: 1.9rem;
  color: #2c5282;
  margin-bottom: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: 2px solid #90cdf4;
  border-radius: 12px;
  padding: 12px 24px;
  background-color: #ebf8ff;
  display: inline-block;
  box-shadow: 0 3px 8px rgba(44, 82, 130, 0.08);
}
#message {
    font-size: 1.2rem;
    min-height: 30px;
    margin-bottom: 15px;
    font-weight: 500;
}

.message-correct {
    color: #27ae60; /* Keep success green */
}

.message-wrong {
    color: #e67e22; /* Softer red-orange instead of bright red */
}

.message-hint {
    color: #8e44ad; /* Purple for hints */
}

#map-object {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    filter: contrast(0.95) brightness(1.02); /* Slightly soften map colors */
}


button {
    background-color: #009688;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

button:hover {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.2);
}

#score, #attempts {
    font-weight: bold;
    font-size: 1.1rem;
}

/* State hover effects with comfortable colors */
#map-object svg path:hover, 
#map-object svg polygon:hover, 
#map-object svg rect:hover {
    fill: #aed6f1 !important; /* Soft blue hover */
    transition: fill 0.2s ease;
}

#map-object svg .clicked {
    fill: #f1948a !important; /* Soft coral for clicks */
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Comfortable tooltip colors */
.map-tooltip {
    position: fixed;
    background-color: rgba(44, 62, 80, 0.92);
    color: #ecf0f1;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    z-index: 10000;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(236, 240, 241, 0.2);
    transform: translate(12px, -30px);
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    #state-to-find {
        font-size: 1.5rem;
        padding: 12px 20px;
    }

    .game-info {
        padding: 15px;
    }

    .controls-row {
        flex-direction: column;
        gap: 15px;
    }

    .score-container {
        flex-direction: row;
        justify-content: center;
    }
}

/* Hidden class for UI elements */
.hidden {
    display: none;
}

/* Game Mode Selector */
.mode-selector {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.mode-selector label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.mode-selector select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #3498db;
    background-color: white;
    font-weight: 600;
    color: #3498db;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.mode-selector select:hover {
    background-color: #f8f9fa;
    border-color: #2980b9;
}

.mode-selector select:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Timer Styles */
.timer-container {
    margin-bottom: 10px;
}

.timer-display {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.timer-display.warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    animation: timer-pulse 1s infinite;
}

.timer-display.critical {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    animation: timer-pulse 0.5s infinite;
}

@keyframes timer-pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

/* Start Game Button */
#start-game-btn {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#start-game-btn:hover {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.3);
}

/* Quiz Cards */
.quiz-cards {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.quiz-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid rgba(52, 73, 94, 0.1);
    text-align: center;
    max-width: 350px;
    width: 100%;
    transition: all 0.3s ease;
}

.quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.quiz-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: 700;
}

.quiz-card p {
    color: #5d6d7e;
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.play-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.play-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}
