html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

* {
    font-family: sans-serif, Arial, Helvetica;
    color: black;
    /* outline: 1px solid red; */
}

a {
    text-decoration: none;
}

a:hover {
    background-color: lightblue;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -1rem;
    margin-bottom: -1rem;
}

h1 {
    font-size: 2rem;
}

.colour_theme {
    color: #0080ff;
}

.title {
    position: relative;
    top: -30px;
}



body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to right, #e0eafc, #cfdef3);
    margin: 0;
    padding: 2rem;
    color: #333;
}

h2 {
    font-size: 2rem;                          /* Larger font size */
    color: #0080ff;                           /* Soft blue color */
}

/* .weather-dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.weather-card {
    background-color: #ffffffcc;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 280px;
    max-width: 360px;
    flex: 1 1 auto;
}

.weather-card .source {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2b5876;
}

.combined-weather-card {
    border: 4px solid #2b5876;
    flex: 1 1 100%;
    max-width: 100%;
    box-sizing: border-box;
} */

.weather-dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

/* Normal weather cards */
.weather-card {
    background-color: #ffffffcc;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    /* min-width: 280px; */
    max-width: 360px;
    flex: 1 1 auto; /* allow shrinking/growing */
}

.weather-card .source {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2b5876;
}

/* Combined card takes its own row, natural width, wider */
.combined-weather-card {
    border: 4px solid #2b5876;
    flex: 0 0 auto;      /* natural width, do not grow/shrink */
    width: 25rem;        /* wider fixed width */
    max-width: 90%;      /* responsive: won't overflow screen */
}

/* Wrapper to center the combined card */
.combined-card-wrapper {
    width: 100%;              /* full row */
    display: flex;
    justify-content: center;  /* center its content */
    position: relative;            /* for positioning the image */
    margin-bottom: 2rem;      /* optional spacing below */
}

/* Image: right-aligned */
.top-row-image {
    position: absolute;
    right: 0;
    top: 50%;              
    transform: translateY(-50%);
    border-radius: 20px;  
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); 
    max-width: clamp(150px, 50%, 500px); /* min 150px, 50% of container, max 400px */
    height: auto;          
}

.not-combined-weather-card {
    border: 4px solid grey;
}

.section {
    margin-bottom: 1.2rem;
}

.label {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #666;
}

.value {
    font-size: 1.1rem;
}

.clickable {
    cursor: pointer;
    text-decoration: underline;
}

.global-toggle-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s ease;
    margin-left: 2rem;
}

.global-toggle-btn:hover {
    background-color: #0056b3;
}

.hourly-container {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 10px;
    border-left: 4px solid #ccc;
    padding-left: 10px;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

.hourly-container.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

.hourly-container.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.hourly-entry {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    font-family: "Segoe UI", sans-serif;
    font-size: 14px;
}

.hour-time {
    width: 3.75rem;
    text-align: left;
    color: #666;
    flex-shrink: 0;
}

.hour-temp {
    width: 3.75rem;
    text-align: right;
    font-weight: bold;
    color: #333;
    padding-right: 15px;
    flex-shrink: 0;
}

.hour-condition {
    flex: 1;
    text-align: left;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hourly-entry.highlight {
    background-color: #cfdef3;
}

/* New container for rain icon + percentage */
.hour-rain {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 4px;
    margin-right: 1rem;
}

/* Default rain icon (color) */
.rain-icon {
    width: 18px;   /* Recommended display size */
    height: 18px;  /* Maintain square aspect ratio */
    margin-right: 6px; /* Space between icon and percentage */
    fill: #0077cc; /* Optional: tint the SVG blue to match weather theme */
    opacity: 0.9;  /* Slight transparency looks good on light backgrounds */
}

/* Percentage text */
.hour-rain-percent {
    width: 35px; /* ✅ fixed width for perfect vertical alignment */
    text-align: right; /* keeps % aligned right within the fixed space */
    font-size: 0.9em;
    color: #0077cc;
    font-weight: normal;
    transition: color 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

/* ---------------------- */
/* 🎨 Color Level Styles  */
/* ---------------------- */

/* 0% — gray, desaturated */
.rain-gray {
    filter: grayscale(100%) brightness(60%);
    opacity: 0.5;
    color: #777 !important;
}

/* 1–30% — light blue */
.rain-light {
    filter: none;
    opacity: 0.9;
    color: #66b3ff !important;   /* light blue */
}

/* 31–70% — medium blue */
.rain-medium {
    filter: none;
    opacity: 0.95;
    color: #0077cc !important;   /* medium blue */
}

/* 71–100% — dark blue */
.rain-dark {
    filter: none;
    opacity: 1;
    color: #004080 !important;   /* dark blue */
}

/* Container styling */
.form-homepage {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 50px auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    overflow: visible;
}

/* Input field styling */
input[type="text"] {
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 70%;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    border-color: #007BFF;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

/* Button styling */
button {
    padding: 12px 20px;
    font-size: 1rem;
    background-color: #007BFF;
    color: #E9ECEF;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#form-homepage-text {
    font-size: 1rem;
}

.form-searchpage input {
    padding: 8px 12px;            /* Add some padding inside the input for better size */
    font-size: 16px;              /* Set the font size for better readability */
    border: 1px solid #ccc;       /* Light border for the input box */
    border-radius: 4px;           /* Rounded corners for the input box */
    margin-right: 10px;           /* Add some space between the input and button */
    width: 10rem;                 /* Set a fixed width for the input box */
}

button:hover {
    background-color: #0056b3;
}

.flash-message {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: opacity 1s ease-out;
}

.not-combined-source a {
    color: inherit;
}

.attribution-combined {
  font-size: 0.85rem;   /* Smaller text */
  color: #555;          /* Optional: softer gray */
}

.attribution-combined a {
  color: inherit;       /* Makes links match the parent text color */
}

.header-block {
    width: 100%;
}

.header-block {
    font-size: 2rem;        /* same as before */
    margin-bottom: 12px;
}

.controls-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;                /* space between searchbox & toggle */
    width: 100%;
}

/* Search form */
.form-searchpage {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-searchpage input {
    padding: 8px 12px;
    font-size: 1.2rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Buttons */
.search-btn,
.global-toggle-btn {
    padding: 10px 18px;
    font-size: 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s ease;
}

.global-toggle-btn {
    background-color: #007bff;
    color: white;
}

.search-btn {
    background-color: #007bff;
    color: white;
}

.about-container {
    background-color: #b4d0f7;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    max-width: 650px;
    margin: 0 auto; /* horizontally center */
    line-height: 1.6;
    text-align: center;
}

.about-container p {
    margin: 0.8em 0;
}
.about-container .title {
    font-size: 1.6em;
    font-weight: bold;
    color: #2a7ae2;
}
.about-container .subtitle {
    font-size: 1.3em;
    font-weight: bold;
    color: #1c4f91;
    margin-top: 1em;
}
.about-container .highlight {
    font-size: 1.1em;
    font-weight: bold;
    color: #2a7ae2;
}

#nav-question {
  display: none;
}

.autocomplete-wrapper {
    position: relative;
    display: block;
    width: 20rem;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    box-sizing: border-box;
    font-family: inherit;
}

.autocomplete-item {
    padding: 8px 12px;
    background-color: white; /* break inheritance */
    cursor: pointer;
    display: block;
    border-bottom: 1px solid #eee;
    transition: background-color 0.1s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: #f0f0f0;
}

.autocomplete-results .autocomplete-item.active {
    background-color: #2563eb !important; /* strong blue */
    color: white !important;
}

@media (max-width: 1200px) {
    .top-row-image {
        display: none;
    }

    #homepage-favicon {
        display: none;
    }

    .controls-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-top: -2rem;
        margin-bottom: -1rem;
    }

    form {
        margin: 20px auto;  
        padding: 15px; 
    }

    /* .form-homepage {
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: #f9f9f9;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        max-width: 100%;
        font-size: 3rem;
    } */

    .form-homepage {
        display: flex;
        flex-direction: column;   /* Stack items vertically */
        justify-content: center;  /* Center items vertically inside container */
        align-items: stretch;     /* Make items take full width of container */
        gap: 10px;                /* Space between items */
        margin: 50px auto;
        padding: 20px;
        background-color: #f9f9f9;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        max-width: 500px;
    }

    #form-homepage-text {
        font-size: 1rem;
    }

    .global-toggle-btn {
        width: 100%;
        margin: auto;
        margin-bottom: 1rem;
        margin-top: -2rem;
    }

    nav {
        font-size: 1.5rem;
        margin-left: -2rem;
        margin-top: -3rem;
    }

    input[type="text"] {
        width: auto;  
        padding: 10px 15px; 
        font-size: 1rem;
    }

    .form-homepage button {
        width: 100%;
    }

    h2 {
        font-size: 1.5rem;
        margin-top: 1rem;
    }
    
    #nav-about {
        display: none;
    }

    #nav-question {
        display: inline-block;
    }

    #top-hr {
        margin-top: -2rem;
    }

    h1 {
        margin-top: 2rem;
    }

    /* .form-searchpage button {
        width: 100%;
        min-height: 3rem;
        font-size: 2rem;
    } */

    /* html {
        font-size: clamp(10px, 2vw, 12px);
    }

    .weather-card .source {
        font-size: 2rem;
        color: #2b5876;
    }

    .weather-dashboard {
        display: flex;
        flex-direction: column; 
        gap: 1.8rem;  
        justify-content: center;
        align-items: center; 
        padding: 10px; 
    }

    .weather-card {
        max-width: 80%;  
        margin: 0 auto;   
    }

    .section {
        margin-bottom: 1.8rem; 
    }

    .flash-message {
        font-size: 1.8rem;  
        padding: 8px 10px;  
    }

    .hourly-container {
        max-height: 60dvh;  
    }

    .hourly-entry {
        display: flex;
        align-items: center;
        padding: 0.5rem 0.6rem 0.5rem 0;
        border-bottom: 0.1rem solid rgb(189, 188, 188);
        font-family: "Segoe UI", sans-serif;
        font-size: 1.8rem;
    }

    .hour-time {
        width: 3.75rem;
        padding-right: 1.5rem;
        text-align: left;
        color: #666;
        flex-shrink: 0;
    }

    .label, .value {
        font-size: 1.8rem;  
    }

    .rain-icon {
        width: 1.8rem;
        height: 1.8rem;
    }

    .hour-rain-percent {
        font-size: 1.8rem;  
    }

    .hour-rain {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin-top: 4px;
        padding-right: 1em;
    }

    .container {
        width: 100%;
        padding: 1rem;  
    }

    h1 {
        font-size: 3rem;
    }

    .hour-condition {
        font-size: 1.8rem; 
        white-space: normal;
    }

    .header-block {
        font-size: 1.8rem;
        margin-bottom: 3rem;
    }

    .form-searchpage {
        width: 100%;
    }

    .form-searchpage input {
        width: 100%;
        min-height: 3rem;
        font-size: 2rem;
    }

    h2 {
        font-size: 3rem;
    } */
}
