/* --- Global Resets & Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f4f8; /* Slightly cooler light background */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* --- Navigation Bar --- */
.navbar {
    background-color: #2c3e50; /* Dark, sophisticated navbar */
    color: white;
    padding: 12px 25px; /* Slightly reduced padding */
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.nav-logo {
    font-size: 1.6rem; /* Adjusted size */
    font-weight: 600;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 20px; /* Adjusted spacing */
}

.nav-links a {
    color: #ecf0f1; /* Lighter text color */
    text-decoration: none;
    font-size: 1rem; /* Adjusted size */
    padding: 8px 15px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active-nav-link {
    background-color: #1abc9c; /* Teal accent */
    color: #ffffff;
}

/* --- Content Area & Sections --- */
.content-area {
    margin-top: 70px; /* Adjust based on final navbar height + some breathing room */
    padding: 25px;
    width: 100%;
    max-width: 700px; /* Increased max-width for content */
    display: flex; /* Will be managed by JS to show one section */
    flex-direction: column;
    align-items: center;
}

.content-section {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    padding: 15px 0; /* Add some padding top/bottom for each section */
}

.content-section.active-section {
    display: flex;
    animation: fadeIn 0.5s ease-out;
}

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

.section-title {
    font-size: 2rem;
    color: #34495e; /* Darker blue-gray */
    margin-bottom: 20px;
    text-align: center;
}

/* --- Reusable Card Style (for weather and game) --- */
.card {
    background: #ffffff;
    padding: 25px 30px; /* Uniform padding */
    border-radius: 12px; /* Softer radius */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08); /* Softer, more spread shadow */
    width: 100%; /* Full width within its container */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease-out;
}

/* --- Reusable Form Elements --- */
.app-input {
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #d1d9e0; /* Softer border */
    border-radius: 8px;
    flex-grow: 1;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.app-input:focus {
    outline: none;
    border-color: #007bff; /* Standard focus blue */
    box-shadow: 0 0 0 0.15rem rgba(0,123,255,.2);
}

.app-button {
    padding: 12px 22px;
    font-weight: 600; /* Bolder */
    font-size: 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    white-space: nowrap;
}
.app-button:hover {
    background-color: #005fc5; /* Darker blue */
    transform: translateY(-1px);
}
.app-button:active {
    transform: translateY(0px);
}
.app-button:disabled {
    background-color: #a0c7e4; /* Lighter blue for disabled */
    cursor: not-allowed;
    transform: none;
}

/* --- Weather App Specific Styles --- */
.weatherForm {
    margin-bottom: 25px;
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    max-width: 500px; /* Constrain form width */
}

.weather-card .main-info { /* Renamed card for specificity */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}
.weather-card .cityDisplay {
    font-size: 2.4rem; /* Slightly smaller for balance */
    font-weight: 600;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 8px;
}
.weather-card .weatherEmoji {
    width: 100px; /* Standardized size */
    height: 100px;
    margin: 0 0 5px 0;
}
.weather-card .tempDisplay {
    font-size: 4rem;
    font-weight: 700; /* Bolder */
    color: #17a2b8; /* Accent color */
    margin: 0 0 5px 0;
}
.weather-card .descDisplay {
    font-size: 1.2rem;
    font-style: italic;
    color: #55606a; /* Slightly darker gray */
    margin-bottom: 15px;
    text-transform: capitalize;
}
.weather-card .details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Adjusted minmax */
    gap: 15px 20px; /* Row and column gap */
    width: 100%;
    text-align: left;
    border-top: 1px solid #e9ecef; /* Lighter border */
    padding-top: 20px;
}
.weather-card .detail-item {
    background-color: #f8f9fa;
    padding: 10px 12px; /* Slightly less padding */
    border-radius: 6px;
}
.weather-card .detail-label {
    font-size: 0.85rem; /* Smaller label */
    font-weight: 600;
    color: #6c757d;
    margin: 0 0 4px 0;
    text-transform: uppercase;
}
.weather-card .detail-value {
    font-size: 1rem;
    font-weight: 500;
    color: #343a40;
    margin: 0;
}
.weather-card .errorDisplay { /* Scoped error display to weather card */
    font-size: 1.2rem;
    font-weight: 500;
    color: #d9534f; /* Softer red */
    padding: 15px;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    border-radius: 8px;
    width: calc(100% - 40px);
}

/* --- Game Section Styles --- */
.game-container {
    /* Uses .card style */
    gap: 18px; /* Spacing between game elements */
}

.game-instructions {
    font-size: 0.95rem;
    color: #55606a;
    margin-bottom: 0px; /* Reduced margin */
}

.game-clues {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    border: 1px solid #e9ecef;
}
.game-clues p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}
.game-clues p:last-child {
    margin-bottom: 0;
}
.game-clues strong {
    color: #34495e;
}

.game-input-area {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    max-width: 400px; /* Max width for input area */
}

.game-button { /* Specific game buttons */
    background-color: #1abc9c; /* Teal for game actions */
}
.game-button:hover {
    background-color: #16a085;
}
.game-button:disabled {
    background-color: #a8d5cf;
}


.game-feedback-message {
    font-size: 1.1rem;
    font-weight: 600; /* Bold feedback */
    min-height: 1.5em;
    margin-top: 5px;
}
.game-feedback-message.win { color: #27ae60; /* Greener win */ }
.game-feedback-message.lose { color: #c0392b; /* Stronger red lose */ }
.game-feedback-message.info { color: #2980b9; /* Bluer info */ }
.game-feedback-message.warm { color: #f39c12; /* Orange for warmer */ }
.game-feedback-message.cold { color: #3498db; /* Blue for colder */ }


.game-info-message {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.game-answer {
    background-color: #e8f6f3;
    border: 1px solid #a3e4d7;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    width: 100%;
    max-width: 400px;
}
.game-answer p {
    font-size: 1rem;
    margin-bottom: 5px;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 15px;
    }
    .nav-logo { font-size: 1.4rem; }
    .nav-links a { font-size: 0.9rem; padding: 6px 10px; }
    .nav-links li { margin-left: 10px; }

    .content-area {
        margin-top: 60px; /* Adjusted for potentially smaller navbar */
        padding: 15px;
    }
    .section-title { font-size: 1.8rem; }
    .card { padding: 20px; }
}

@media (max-width: 600px) {
    .weatherForm, .game-input-area {
        flex-direction: column;
        width: 100%;
    }
    .app-input, .app-button {
        width: 100%;
    }
    .app-input { margin-bottom: 10px; /* Spacing when stacked */ }

    .weather-card .cityDisplay { font-size: 2rem; }
    .weather-card .tempDisplay { font-size: 3.2rem; }
    .weather-card .details-grid { grid-template-columns: 1fr; } /* Single column */
    .weather-card .weatherEmoji { width: 80px; height: 80px; }

    .game-clues p, .game-feedback-message, .game-answer p { font-size: 0.9rem; }
}