/* 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: 20px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
    gap: 20px;
}

.header h1,
.site-logo-text {
    flex: 1;
    text-align: center;
    min-width: 200px;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.08);
    color: #1a3c52;
}

.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-links a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid transparent;
}

.nav-links a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

h1 {
    color: #1a3c52;
    margin: 0;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.08);
    letter-spacing: 1px;
    font-weight: 700;
}

.title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.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);
}

.dark-mode-toggle {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    color: #2c3e50;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px 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: 10px;
    margin-bottom: 10px;
    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: 1rem;
    color: #5d6d7e;
    /* Muted gray-blue */
    margin-bottom: 10px;
    line-height: 1.4;
}

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

#message {
    font-size: 1rem;
    min-height: 25px;
    margin-bottom: 10px;
    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 green color */
#map-object svg path:hover,
#map-object svg polygon:hover,
#map-object svg rect:hover {
    fill: #22c55e !important;
    /* Bright green 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 */
/* Mobile First Approach */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 0 10px;
        margin-bottom: 15px;
        height: auto;
        text-align: left;
    }

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

    .nav-links {
        order: 2;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
    }

    .nav-links a {
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .dark-mode-toggle {
        order: 3;
        padding: 6px 10px;
        font-size: 1rem;
        margin: 0;
        align-self: flex-end;
        display: none;
        /* Hide dark mode button on mobile */
    }

    h1 {
        font-size: 1.5rem;
        margin: 2px 0;
    }

    .header {
        margin-bottom: 10px;
    }

    .game-info {
        padding: 12px;
        margin-bottom: 8px;
    }

    #instructions {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    #state-to-find {
        font-size: 1.2rem;
        padding: 8px 12px;
        margin-bottom: 8px;
    }

    .mode-selector {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }

    .mode-selector label {
        font-size: 0.9rem;
    }

    .mode-selector select {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .controls-row {
        flex-direction: column;
        gap: 12px;
        margin-top: 12px;
    }

    .buttons-container {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .buttons-container button {
        width: 100%;
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .score-container {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .score-item,
    .attempts-item {
        padding: 8px 12px;
        font-size: 0.9rem;
        flex: 1;
        text-align: center;
    }

    #map-container {
        padding: 12px;
        margin-bottom: 15px;
    }

    #map-object {
        max-width: 100%;
        height: auto;
    }

    .quiz-cards {
        flex-direction: column;
        gap: 12px;
        margin: 15px 0;
        align-items: center;
    }

    .quiz-card {
        max-width: 100%;
        padding: 15px;
    }

    .quiz-card h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .quiz-card p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .play-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Modal responsiveness */
    .modal-content {
        margin: 10px;
        padding: 20px;
        width: 95%;
        max-width: none;
    }

    .modal-content h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .modal-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Timer display */
    .timer-display {
        padding: 6px 12px;
        font-size: 1rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 15px;
    }

    .header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        padding: 0 15px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a {
        padding: 7px 12px;
        font-size: 0.95rem;
    }

    h1 {
        font-size: 2rem;
    }

    .game-info {
        padding: 15px;
    }

    #state-to-find {
        font-size: 1.3rem;
        padding: 10px 16px;
    }

    .controls-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }

    .buttons-container {
        gap: 10px;
    }

    .buttons-container button {
        padding: 11px 20px;
        font-size: 0.95rem;
    }

    .score-container {
        gap: 12px;
    }

    .score-item,
    .attempts-item {
        padding: 9px 15px;
    }

    .quiz-cards {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }

    .quiz-card {
        max-width: calc(50% - 10px);
        min-width: 200px;
    }
}

@media (max-width: 768px) {

    /* Prevent zoom on input focus */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Touch device optimizations */
    button:hover {
        transform: none;
    }

    button:active {
        transform: scale(0.95);
    }

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

    .nav-links a:active {
        background: #e2e8f0;
        transform: scale(0.95);
    }

    .play-btn:hover {
        transform: none;
    }

    .play-btn:active {
        transform: scale(0.95);
    }

    .quiz-card:hover {
        transform: none;
    }

    .quiz-card:active {
        transform: scale(0.98);
    }
}

/* Tablet devices (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
    }

    .quiz-cards {
        gap: 20px;
    }

    .quiz-card {
        max-width: 300px;
    }

    #map-container {
        max-width: 95%;
    }
}

/* Large mobile devices (landscape) */
@media (max-height: 480px) and (orientation: landscape) {
    body {
        padding: 8px;
    }

    .header {
        margin-bottom: 8px;
        padding: 0 8px;
    }

    .game-info {
        padding: 8px;
        margin-bottom: 8px;
    }

    #map-container {
        padding: 8px;
        margin-bottom: 10px;
    }

    .quiz-cards {
        margin: 10px 0;
        gap: 8px;
    }

    .quiz-card {
        padding: 10px;
    }

    .quiz-card h3 {
        font-size: 1.1rem;
        margin-bottom: 5px;
    }

    .quiz-card p {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .play-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* 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: 15px;
    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: 250px;
    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;
}

.blog-article h1 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.2;
}

.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);
}

/* Dark Mode Styles */
body.dark-mode {
    background: #1a202c;
    color: #e2e8f0;
}

body.dark-mode .title {
    color: #e2e8f0;
    background: none;
    -webkit-text-fill-color: #e2e8f0;
}

body.dark-mode .header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .nav-links a {
    background: rgba(66, 153, 225, 0.2);
    color: #e2e8f0;
}

body.dark-mode .nav-links a:hover {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

body.dark-mode #instructions {
    color: #e2e8f0;
}

body.dark-mode #state-to-find {
    color: #e2e8f0;
}

body.dark-mode #message {
    color: #e2e8f0;
}

body.dark-mode .game-info {
    background: rgba(45, 55, 72, 0.5);
}

body.dark-mode .mode-selector label {
    color: #e2e8f0;
}

body.dark-mode .mode-selector select {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}

body.dark-mode .score-container {
    color: #e2e8f0;
}

body.dark-mode #map-container {
    background: rgba(45, 55, 72, 0.3);
}

body.dark-mode .nav-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .nav-btn:hover {
    background: #3182ce;
    color: white;
}

body.dark-mode .icon-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .icon-btn:hover {
    background: #3182ce;
    color: white;
}

body.dark-mode .dark-mode-toggle {
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .dark-mode-toggle:hover {
    background: #4a5568;
}

body.dark-mode .mode-btn {
    background: #2d3748;
    border-color: #e2e8f0;
    color: #e2e8f0;
}

body.dark-mode .mode-btn.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

body.dark-mode .mode-btn:hover:not(.active) {
    background: #4a5568;
}

body.dark-mode .quiz-card {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .quiz-card h3 {
    color: #e2e8f0;
}

body.dark-mode .quiz-card p {
    color: #cbd5e0;
}

body.dark-mode .game-info {
    background-color: rgba(45, 55, 72, 0.95);
    border-color: rgba(74, 85, 104, 0.08);
}

body.dark-mode #state-to-find {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode #message {
    color: #e2e8f0;
}

body.dark-mode .score-item {
    background-color: #2d3748;
    border-color: #27ae60;
    color: #22c55e;
}

body.dark-mode .attempts-item {
    background-color: #2d3748;
    border-color: #f1c40f;
    color: #d68910;
}

body.dark-mode .mode-selector select {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .mode-selector select:hover {
    background-color: #4a5568;
    border-color: #2980b9;
}

body.dark-mode .timer-display {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

body.dark-mode button {
    background-color: #3182ce;
    color: white;
}

body.dark-mode button:hover {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

body.dark-mode .nav-links a {
    color: #e2e8f0;
}

body.dark-mode .nav-links a:hover {
    background: #4a5568;
}