/* Global Styles */

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(to right, #e0f7fa, #b2ebf2);
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sticky Footer Layout */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto; /* pushes footer down */
}

.site-footer {
    flex-shrink: 0;
}

/* Header / Navbar */
.site-header {
    width: 100%;
    background-color: #000000; /* black */
    color: #ffffff;            /* white text */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.navbar {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: bold;
    font-size: 1rem;
    color: #ffffff;
}

#open-help-btn {
    padding: 6px 12px;
    border-radius: 5px;
    border: 1px solid #ffffff;
    background-color: transparent;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.9rem;
}

#open-help-btn:hover {
    background-color: #ffffff;
    color: #000000;
}

/* Footer */
.site-footer {
    width: 100%;
    text-align: center;
    padding: 10px 20px;
    font-size: 0.9rem;
    background-color: #000000; /* black */
    color: #ffffff;            /* white text */
}

.site-footer a {
    color: #ffffff;
    text-decoration: underline;
}

.site-footer a:hover {
    text-decoration: none;
}


/* Main container */
.container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
}

#main-content {
    flex: 1;
}

/* App title */
.app-title {
    text-align: center;
    margin-bottom: 15px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 10px;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    color: #000;
    z-index: 1000;
}

.skip-link:focus {
    top: 10px;
}

/* Visually hidden content (for screen readers) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0 0 0 0);
    overflow: hidden;
}

/* Modal Styles */

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    width: 85%;
    max-width: 450px;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    border: none;
    background: none;
}

/* --------------------
   Weather Card
-------------------- */

.weather-card {
    max-width: 520px;   /* was 100% – gives it a nice chunky size */
    width: 100%;
    padding: 22px;      /* was 16px */
    background: linear-gradient(135deg, #81d4fa, #4fc3f7);
    border-radius: 12px;
    text-align: center;
    color: #080808;
    margin: 0 auto;
}

.weather-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

/* Weather Icon */
#weather-icon {
    font-size: 50px;
    display: block;
    margin: 10px auto;
}

/* Input & Button */
.input-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
}

#city-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#city-input-btn {
    width: 100%;
    font-size: 16px;
    padding: 10px;
    background-color: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#city-input-btn:hover {
    background-color: #2980b9;
}

/* Error Container */
#error-container {
    color: #ff4444;
    background-color: #ffeeee;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    display: none;
    margin-bottom: 10px;
}

/* Weather Info (hidden until first result) */
#weather-info {
    margin-top: 12px;
    display: none;
}

/* --------------------
   City List
-------------------- */

.city-list {
    margin-top: 10px;
}

.city-list p {
    margin-bottom: 8px;
    font-size: 14px;
}

.city-btn {
    margin: 3px;
    padding: 6px 10px;
    border: none;
    border-radius: 5px;
    background-color: #0277bd;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

.city-btn:hover {
    background-color: #01579b;
}

/* --------------------
   Loading Spinner
-------------------- */

.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    z-index: 1000;
}

#temperature {
    font-size: 1.6rem;
    font-weight: bold;
}

#description,
#wind-speed,
#date {
    font-size: 1rem;
}

/* Media Queries - mobile-first layout */

/* >= 375px (small phones and up) */
@media (min-width: 375px) {
    .container {
        padding: 24px;
    }

    .weather-card {
        padding: 18px;
    }

    #city-input {
        font-size: 17px;
    }

    #city-input-btn {
        font-size: 17px;
    }
}

/* >= 576px (larger phones / small tablets) */
@media (min-width: 576px) {
    body {
        align-items: center;
    }

    .container {
        max-width: 540px;
    }

    .weather-card {
        max-width: 500px;
    }

    .input-group {
        flex-direction: row;
        align-items: center;
    }

    #city-input {
        width: 70%;
    }

    #city-input-btn {
        width: auto;
        margin-left: 8px;
        padding: 10px 16px;
    }
}

/* >= 768px (tablets and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }

    .app-title {
        font-size: 2rem;
    }

    .weather-card {
        padding: 20px;
    }
}

/* >= 1024px (small desktops and up) */
@media (min-width: 1024px) {
    .container {
        max-width: 900px;
    }

    .weather-card {
        max-width: 480px;
    }

    .city-btn {
        font-size: 15px;
        padding: 7px 12px;
    }
}
