/* General body styling */
body {
    font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(to bottom, #87ceeb, #f0f8ff);
    color: #333;
}

/* Header styling */
header {
    text-align: center;
    margin-bottom: 20px;
}
h1 {
    font-size: 2.5em;
    color: #ffffff;
    margin: 0;
}
p {
    font-size: 1.2em;
    color: #ffffff;
}

/* Button styling */
button {
    background-color: #ef795b;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-left: 10px;
}
button:hover {
    background-color: #d96b50;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
button:active {
    background-color: #bf5e47;
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
button:focus {
    outline: none;
    box-shadow: 0 0 4px rgba(239, 121, 91, 0.5);
}

.cell.headline:first-of-type {
    visibility: hidden;
}

/* Main container styling */
#mainDiv {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    box-sizing: border-box;
    overflow-x: auto;
}

/* Title and info text */
#mainTitle {
    font-size: 2em;
    color: #ef795b;
    margin: 0;
    padding: 10px 0;
    text-align: center;
    font-weight: bold;
}
#infoText {
    font-size: 1.2em;
    color: #323232;
    margin: 0;
    padding: 5px 5px;
    text-align: center;
    font-style: italic;
    margin-bottom: 15px;
}

/* Dropdown styling */
#locationName {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

label {
    font-size: 1.2em;
    color: #333;
    margin-right: 10px;
}
select {
    padding: 5px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #ffffff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}
select:hover {
    border-color: #007bff;
}
select:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 4px rgba(0, 91, 187, 0.5);
}

/* Weather grid styling */
.result {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
    width: 100%;
    margin-top: 20px;
    box-sizing: border-box;
    overflow-x: auto;
    max-width: 100%;
}

/* Cell styling */
.cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: 1px solid #ddd;
    background-color: #ffffff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 0;
    box-sizing: border-box;
}
.cell:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

/* Headline and title cells */
.cell.headline, .cell.title {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Weather icon styling */
.cell img {
    max-width: 48px;
    max-height: 48px;
    width: 100%;
    height: auto;
    margin-bottom: 10px;
    object-fit: contain;
    box-sizing: border-box;
}

/* Loader styling */
.loader {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 5px solid #ef795b;
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin: 30px auto;
}
.loader-btn {
    width: 22px;
    height: 22px;
    border-width: 3px;
    margin: 0;
    vertical-align: middle;
    display: inline-block;
    position: relative;
    top: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}



@media (max-width: 800px) {
    #mainDiv {
        width: 95%;
        padding: 2px;
        border-radius: 0;
        min-width: 0;
        margin-left: auto;
        margin-right: auto;
    }
    #locationName {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .result {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .cell {
        padding: 6px;
        font-size: clamp(0.7em, 1.5vw, 0.9em); /* Even smaller text */
    }
    .cell img {
        max-width: 32px;
        max-height: 32px;
    }
    #mainTitle {
        font-size: clamp(0.8em, 2.5vw, 1.1em);
    }
    #infoText {
        font-size: clamp(0.7em, 2vw, 0.95em);
    }
    button, select {
        font-size: clamp(0.8em, 2vw, 1em);
        padding: 7px 8px;
        width: 100%;
        box-sizing: border-box;
    }
    button {
        margin-left: 0; 
    }
    label {
        font-size: clamp(0.8em, 2vw, 1em);
    }
    p, h1 {
        font-size: clamp(0.8em, 2vw, 1em);
    }
}