@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

/* Root */
:root {
    /* neutral colours */
    --neutral-900: hsl(243, 96%, 9%);
    --neutral-800: hsl(243, 27%, 20%);
    --neutral-700: hsl(243, 23%, 24%);
    --neutral-600: hsl(243, 23%, 30%);
    --neutral-300: hsl(240, 6%, 70%);
    --neutral-200: hsl(250, 6%, 84%);
    --neutral-0: hsl(0, 0%, 100%);

    /* accent colours */
    --primary: hsl(233, 67%, 56%);
    --primary-dark: hsl(248, 70%, 36%);
    --orange-500: hsl(28, 100%, 52%);

    /* typography */
    --ff-main: 'DM Sans', sans-serif;
    --ff-secondary: 'Bricolage Grotesque', sans-serif;
    --fs-header: 3rem;
    --fs-subheading: 1.6rem;
    --fs-body: 1rem;
    --fs-small: 1.1rem;
    --fw-700: 700;
    --fw-600: 600;
    --fw-500: 500;
    --fw-300: 300;
}

body.light-theme {
    --neutral-900: hsl(214, 100%, 95%);
    --neutral-800: hsl(220, 60%, 91%);
    --neutral-700: hsl(213, 100%, 96%);
    --neutral-600: hsl(218, 51%, 86%);
    --neutral-300: hsl(218, 15%, 45%);
    --neutral-200: hsl(221, 45%, 36%);
    --neutral-0: hsl(222, 58%, 25%);   
    --primary: hsl(204, 86%, 53%);
    --primary-dark: hsl(204, 86%, 43%);
}

/* Reset */

html {
    scroll-behavior: smooth;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
p { text-wrap: pretty; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }

body {
    font-family: var(--ff-main);
    font-size: var(--fs-body);
    font-weight: var(--fw-600);
    color: var(--neutral-0);
    background-color: var(--neutral-900);
    padding: 0.5rem;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    line-height: 1.2;
    transition: background-color 0.5s ease;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    z-index: 1001;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0; 
    outline: 3px solid var(--primary-dark);
    position: fixed;
}

.skip-link:focus-visible {
    top: 0;
    position: fixed;
    outline: 3px solid var(--primary-dark);
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.search-input:focus-within {
    box-shadow: 0 0 0 2px var(--primary);
    outline: none;
}

/* Global transitions */

.dropdown-toggle,
.search-input,
.weather-detail,
.daily-card,
.hourly-forecast,
.hourly-card,
.dropdown-menu,
.hourly-dropdown-menu,
.search-suggestions,
.suggestion-item,
.dropdown-label,
.weather-main,
button,
h1, h2, p, span {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

.favourites-list,
.hourly-forecast ul {
    overscroll-behavior: contain;
    scroll-snap-type: y proximity;
}

.favourite-card,
.hourly-card,
.suggestion-item {
    scroll-snap-align: start;
}

button { 
    font-family: var(--ff-main); 
}

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

/* header styles */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
    padding: 0.25rem;
}

.logo img {
    height: 28px;
    width: auto;
}

body.light-theme .logo img {
    content: url(assets/images/logo-light.svg);
}

.theme-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#theme-toggle {
    background-color: var(--neutral-800);
    border: 1px solid var(--neutral-600);
    border-radius: 0.5rem;
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s;
}

#theme-toggle:hover {
    background-color: var(--neutral-700);
}

#theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--neutral-0);
}

#theme-toggle img {
    width: 20px;
    height: 20px;
    display: block;
}

h1 {
    font-family: var(--ff-secondary);
    font-size: var(--fs-header);
    font-weight: var(--fw-700);
    text-align: center;
    line-height: 1.05;
    padding: 2rem 0;
}

/* Search */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    width: 100%;
}


.search-input {
    display: flex;
    align-items: center;
    background-color: var(--neutral-800);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    gap: 0.9rem;
    flex: 1;
    transition: box-shadow 0.2s;
}

.search-input img { 
    width: 17px; 
}

body.light-theme .search-image {
    content: url(assets/images/icon-search-light.svg)
}

.search-input input {
    font-family: var(--ff-main);
    font-weight: var(--fw-500);
    font-size: var(--fs-body);
    background: none;
    color: var(--neutral-200);
    border: none;
    width: 100%;
}

.search-input input:focus { 
    outline: none; 
}

.search-input:focus-within {
    box-shadow: 0 0 0 2px var(--neutral-0);
}

.search-form button {
    font-size: var(--fs-small);
    background-color: var(--primary);
    padding: 0 1rem;
    border-radius: 0.5rem;
    width: 100%;
    height: 45px;
    border: none;
    color: var(--neutral-200);
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

body.light-theme .search-form button {
    color:var(--neutral-800);
}

.search-form button:hover { 
    background-color: var(--primary-dark); 
}
.search-form button:focus { 
    box-shadow: 0 0 0 2px var(--primary); 
}
.search-form button:active {
    transform: scale(0.95);
}

.search-input-container {
    position: relative;
    flex: 1;
}

/* Suggestion lists */

.search-suggestions, .comparison-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--neutral-800);
    border-radius: 0.5rem;
    margin-top: 0.4rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: none;
    border: 1px solid var(--neutral-600);
}

.suggestion-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    color: var(--neutral-200);
    transition: background-color 0.2s;
    opacity: 0;
    transform: translateY(10px);
    animation: slideIn 0.3s forwards;
    display: flex;
    align-items: center;
}

.country-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid var(--neutral-600);
    object-fit: cover;
}

.suggestion-item:hover {
    background-color: var(--neutral-700);
    color: var(--neutral-0);
}

.suggestion-item:nth-child(1) {animation-delay: 0.05s;}
.suggestion-item:nth-child(2) {animation-delay: 0.1s;}
.suggestion-item:nth-child(3) {animation-delay: 0.15s;}
.suggestion-item:nth-child(4) {animation-delay: 0.2s;}
.suggestion-item:nth-child(5) {animation-delay: 0.25s;}


/* Dropdown */
.units-dropdown {
    position: relative;
    display: inline-block;
}

body.light-theme .units-image {
    content: url(assets//images/icon-units-light.svg)
}

.dropdown-toggle {
    background-color: var(--neutral-800);
    color: var(--neutral-0);
    border-radius: 0.5rem;
    display: flex;
    gap: 0.35rem;
    padding: 0.3rem;
    cursor: pointer;
    border: 1px solid var(--neutral-600);
    transition: box-shadow 0.2s, transform 0.1s;
}

.dropdown-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--neutral-0);
}
.dropdown-toggle:active {
    transform: scale(0.95);
}

body.light-theme .dropdown-image {
    content: url(assets/images/icon-dropdown-light.svg);
}

.dropdown-bridge {
    position: absolute;
    right: 0;
    top: 100%;
    width: 100%;
    height: 16px;
    z-index: 9;
}

.dropdown-menu, .hourly-dropdown-menu {
    position: absolute;
    right: 0;
    top: 130%;
    background-color: var(--neutral-800);
    border-radius: 0.8rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 10;
    border: 1px solid var(--neutral-600);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s;
}

.dropdown-menu {
    min-width: 210px;
    padding: 0 0 0.1rem;
}

.hourly-dropdown-menu {
    min-width: 200px;
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.units-dropdown:hover .dropdown-menu, .dropdown-menu:hover {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.hourly-dropdown:focus-within .hourly-dropdown-menu, .hourly-dropdown:hover .hourly-dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-switch:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--neutral-0);
}

.dropdown-section {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--neutral-600);
    margin-bottom: 0.2rem;
}
.dropdown-section:first-child, .dropdown-section:last-child { 
    border-bottom: none; 
}
.dropdown-section:not(:first-child) { 
    padding-top: 0; 
}

.dropdown-title {
    display: block;
    font-size: 0.8rem;
    color: var(--neutral-200);
    margin-bottom: 0.5rem;
    font-weight: var(--fw-500);
    padding: 0 0.15rem;
}

.dropdown-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--neutral-200);
    padding: 0.4rem 0.3rem;
    font-weight: var(--fw-500);
    border-radius: 0.5rem;
    background-color: none;
    transition: color 0.2s, background-color 0.2s;
    margin-bottom: 0.1rem;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.dropdown-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--neutral-700);
    z-index: -1;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
}

.dropdown-label:hover::before {
    transform: translateX(0);
}

.checkmark {
    width: 0.9em;
    display: none;
}

.dropdown-label.active {
    color: var(--neutral-0);
    background-color: var(--neutral-700);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-label.active .checkmark {
    display: inline-block;
}

body.light-theme .checkmark {
    content: url('assets/images/icon-checkmark-light.svg');
}

.dropdown-switch {
    width: 100%;
    background-color: var(--neutral-800);
    color: var(--neutral-0);
    border: none;
    font-size: 0.9rem;
    font-weight: var(--fw-600);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    text-align: left;
}

.dropdown-switch:hover {
    background-color: var(--neutral-700);
}

.dropdown-image, .hourly-dropdown .dropdown-image {
    transition: transform 0.3s ease;
}

.dropdown-menu.show ~ .dropdown-toggle .dropdown-image,
.hourly-dropdown:hover .dropdown-image,
.hourly-dropdown:focus-within .dropdown-image,
.units-dropdown:hover .dropdown-toggle .dropdown-image {
    transform: rotate(180deg);
}

.dropdown-menu.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* grid */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "current"
        "details"
        "daily"
        "hourly";
    gap: 1.7rem;
}

.item.current-weather{ 
    grid-area: current 
}
.item-daily-forecast{ 
    grid-area: daily 
}
.item-hourly-forecast{ 
    grid-area: hourly 
}

/* current weather */
.weather-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background-image: url(assets/images/bg-today-small.svg);
    background-size: cover;
    background-position: center;
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    border: 1px solid var(--neutral-600);
    position: relative;
}

body.light-theme .weather-main {
    background-image: url('assets/images/bg-today-small-light.svg');
}

.current-weather {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weather-meta { 
    display: flex; 
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    width: 100%;
}

.weather-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding: 0.5rem 0.8rem;
    background-color: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    max-width: 100%;
    width: fit-content;
    animation: fadeIn 0.5s ease-out forwards;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    overflow-wrap: break-word;
}

body.light-theme .weather-tip {
    background-color: rgba(255,255,255,0.25);
}

.weather-tip-icon {
    font-size: var(--fs-small);
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.weather-tip-text {
    font-size: 0.9rem;
    color: var(--neutral-0);
    font-weight: var(--fw-500);
    line-height: 1.3;
    flex-grow: 1;
    word-break: break-word;
    white-space: normal;
}

.favourite-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.15s ease;
}

.favourite-toggle:hover {
    transform: scale(1.1);
}

.favourite-toggle:active {
    transform: scale(0.95);
}

.favourite-toggle img {
    width: 30px;
    height: 30px;
}

.item.favourites-section {
    margin-bottom: 1.5rem;
    background-color: var(--neutral-800);
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid var(--neutral-600);
}

.favourites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.favourites-header h2 {
    font-size: var(--fs-small);
    margin: 0;
}

.favourites-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.favourite-card {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-small);
    align-items: center;
    background-color: var(--neutral-700);
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    border: 1px solid var(--neutral-600);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.favourite-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--neutral-600);
    z-index: -1;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
}

.favourite-card:hover::before {
    transform: translateX(0);
}

.favourite-location {
    font-weight: var(--fw-600);
}

.favourite-remove {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.no-favourites {
    text-align: center;
    color: var(--neutral-300);
    padding: 1rem;
}

.weather-location { 
    font-size: var(--fs-subheading); 
    font-weight: var(--fw-700); 
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weather-date {
    font-size: var(--fs-small);
    color: var(--neutral-200);
    font-weight: var(--fw-500);
}

.weather-info { 
    display: flex; 
    align-items: center; 
    gap: 0.8rem; 
}

.weather-temperature { 
    font-size: 5rem; 
}

.weather-info img { 
    max-width: 100px; 
    height: auto; 
}

/* details */
.weather-details-container {
    position: relative;
    width: 100%;
}

.weather-details-wrapper {
    overflow: hidden;
    position: relative;
}

.weather-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    width: 100%;
    transition: opacity 0.15s ease-in-out, visibility 0s linear 0.15s;
    top: 0;
    left: 0;
}

.weather-details.active {
    visibility: visible;
    opacity: 1;
    position: relative;
    transition: opacity 0.15s ease-in-out;
}

.uv-indicator {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--neutral-900);
    font-weight: var(--fw-600);
    margin-left: 5px;
}

.nav-arrow {
    position: static;
    width: 32px;
    height: 32px;
    background-color: var(--neutral-700);
    border: 1px solid var(--neutral-600);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s, transform 0.15s;
}

.nav-arrow img {
    width: 14px;
    height: 14px;
}

.nav-arrow.nav-prev img {
    transform: rotate(90deg);
}

.nav-arrow.nav-next img {
    transform: rotate(270deg);
}

body.light-theme .nav-arrow img {
    content: url(assets/images/icon-dropdown-light.svg);
}

.nav-arrow:hover {
    background-color: var(--neutral-600);
}

.nav-arrow:active {
    transform: scale(0.9);
}

.pagination-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--neutral-600);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    position: relative;
    overflow: visible;
}

.dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background-color: rgba(var(--primary), 0.2);
    border-radius: 50%;
    z-index: -1;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.dot:hover {
    transform: scale(1.2);
    background-color: var(--neutral-300);
}

.dot:hover::after {
    transform: scale(1);
}

.dot.active {
    background-color: var(--primary);
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--neutral-700);
}

/* Card shells */

.hourly-card, .daily-card, .weather-detail {
    border-radius: 0.5rem;
    border: 1px solid var(--neutral-600);
}

.daily-card, .weather-detail, .hourly-forecast, .comparison-results, .api-error, .loading-animation {
    background-color: var(--neutral-800);
}

/* Detail cards */

.weather-detail {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: transform 0.2s ease-out;
    height: 100px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.weather-detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--neutral-600);
    z-index: -1;
    transition: transform 0.3s ease;
    transform: translateY(100%);
}

.weather-detail:hover::before {
    transform: translateY(0);
}

.weather-detail:hover, .daily-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.weather-detail-label {
    font-size: var(--fs-small);
    color: var(--neutral-200);
    font-weight: var(--fw-500);
}

.weather-detail-value { 
    font-size: var(--fs-subheading); 
    font-weight: var(--fw-300); 
    display: flex;
    align-items: center;
}


/* daily forecast */
.daily-forecast h2, .hourly-header h2 { 
    font-size: var(--fs-small);
}

.daily-forecast h2 {
    margin: 0.25rem 0 0.5rem;
}

.daily-forecast ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.daily-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem;
    gap: 0.5rem;
}

.daily-card img { 
    width: 50px; 
    height: auto; 
}

.daily-day { 
    font-size: var(--fs-small); 
    font-weight: var(--fw-500); 
}

.daily-temps {
    display: flex;
    gap: 2rem;
    font-size: 0.8rem;
}

.daily-temperature-low { 
    color: var(--neutral-200); 
}

/* hourly forecast */
.hourly-forecast {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 1rem;
    border: 1px solid var(--neutral-600);
}

.hourly-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.hourly-dropdown .dropdown-toggle {
    padding: 0.5rem 0.8rem;
    background-color: var(--neutral-600);
    border-radius: 0.5rem;
}

.hourly-date-info, .hourly-day-separator {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--neutral-300);
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid var(--neutral-600);
}

.hourly-day-separator {
    display: flex;
    align-items: center;
}

.hourly-forecast ul {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    max-height: 420px;
    overflow-y: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.hourly-forecast ul::-webkit-scrollbar {
    display: none;
}

.hourly-card {
    display: flex;
    align-items: center;
    background-color: var(--neutral-700);
    justify-content: space-between;
    padding: 0.5rem 0.8rem;
}

.hourly-card img { 
    width: 30px; 
    height: auto; 
}

.hourly-card-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-small);
    font-weight: var(--fw-500);
}

.hourly-temperature { 
    font-size: 0.9rem; 
    color: var(--neutral-200); 
}

.hourly-dropdown {
    position: relative;
    display: inline-block;
}

.weekday-item {
    background: none;
    border: none;
    color: var(--neutral-0);
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    text-align: left;
    cursor: pointer;
    border-radius: 0.3rem;
    outline: none;
    margin: 0 0.5rem;
    transition: background 0.2s;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.weekday-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--neutral-700);
    z-index: -1;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
}

.weekday-item:hover::before, .weekday-item:focus::before  {
    transform: translateX(0);
}

.weekday-item.active {
    font-weight: var(--fw-700);
}


/* Comparison */
#compare-toggle {
    background-color: var(--neutral-800);
    border: 1px solid var(--neutral-600);
    border-radius: 0.5rem;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--neutral-0);
    transition: background-color 0.2s, transform 0.1s;
    font-weight: var(--fw-500);
}

#compare-toggle:hover {
    background-color: var(--neutral-700);
}

#compare-toggle:active {
    transform: scale(0.95);
}

#compare-toggle img {
    width: 20px;
    height: 20px;
}

body.light-theme #compare-toggle img {
    content: url('assets/images/compare-light.webp');
}

#compare-toggle, .units-dropdown .dropdown-toggle {
    font-size: 0.9rem;
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-comparison {
    margin-top: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--neutral-600);
    scroll-margin-top: 1rem;
}

.comparison-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.comparison-header h2 {
    margin-bottom: 0.5rem;
    font-size: var(--fs-subheading);
}

.comparison-header p {
    color: var(--neutral-200);
    font-size: 0.9rem;
}

.comparison-cities {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.comparison-city {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comparison-city h3 {
    font-size: var(--fs-small);
    font-weight: var(--fw-600);
    margin-bottom: 0.5rem;
}

.comparison-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: var(--fw-700);
    color: var(--primary);
    position: relative;
}

.comparison-vs::before, .comparison-vs::after {
    content: '';
    height: 1px;
    flex: 1;
    background-color: var(--neutral-600);
    margin: 0 1rem;
}

.comparison-search-container {
    position: relative;
    width: 100%;
}

.comparison-search {
    width: 100%;
}

.comparison-results {
    border-radius: 1rem;
    padding: 1rem;
    min-height: 300px;
    border: 1px solid var(--neutral-600);
}

.comparison-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: var(--neutral-300);
    font-style: italic;
}

.comparison-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comparison-location {
    font-size: 1.2rem;
    font-weight: var(--fw-600);
    margin-bottom: 0.4rem;
}

.comparison-date {
    font-size: 0.9rem;
    color: var(--neutral-200);
}

.comparison-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.comparison-icon {
    width: 60px;
    height: 60px;
}

.comparison-temp-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: 0.8rem;
    background-color: var(--neutral-700);
    border: 1px solid var(--neutral-600);
    margin-bottom: 0.5rem;
}

.comparison-temp-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid var(--neutral-600);
    padding-top: 0.8rem;
}

.comparison-feels-like, .comparison-min-max {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feels-like-label, .min-max-label {
    font-size: 0.9rem;
    color: var(--neutral-200);
}

.feels-like-value, .min-max-value {
    font-size: 1.2rem;
    font-weight: var(--fw-600);
}

.comparison-temp {
    font-size: 2.5rem;
    font-weight: var(--fw-300);
}

.comparison-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    text-align: center;
}

.comparison-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--neutral-200);
}

.metric-value {
    font-size: 1.1rem;
}

.metric-better {
    color: #48bf91;
    font-weight: var(--fw-700);
}

.metric-worse {
    color: #ff7061;
    font-weight: var(--fw-700);
}

.weekly-trend {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    background-color: var(--neutral-700);
    border-radius: 0.75rem;
    border: 1px solid var(--neutral-600);
}

.trend-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.trend-message {
    font-size: 0.95rem;
    line-height: 1.3;
    color: var(--neutral-200);
}

.trend-warmer {
    color: #ff7061;
}

.trend-cooler {
    color: #48A3FF;
}

.trend-wetter {
    color: #6B7AFF;
}

.trend-drier {
    color: #E8B828;
}

/* no results found */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    gap: 0.8rem;
    color: var(--neutral-200);
    text-align: center;
}

.no-results img {
    width: 40px;
    height: 40px;
    opacity: 0.7;
}

.no-results-title {
    font-size: 1.1rem;
    font-weight: var(--fw-600);
    color: var(--neutral-0);
}

.no-results-message {
    font-size: 0.9rem;
    line-height: 1.4;
}

.comparison-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: var(--neutral-300);
    text-align: center;
    padding: 1rem;
    gap: 0.8rem;
}

.comparison-no-results img {
    width: 36px;
    height: 36px;
    opacity: 0.7;
}

/* api error */
.api-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--neutral-800);
    border-radius: 1rem;
    border: 1px solid var(--neutral-600);
    padding: 2.5rem 1.5rem;
    gap: 1rem;
    min-height: 300px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 550px;
}

.api-error img {
    width: 60px;
    height: 60px;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.api-error h3 {
    font-size: var(--fs-subheading);
    color: var(--neutral-200);
}

.api-error p {
    color: var(--neutral-200);
    max-width: 400px;
    margin-bottom: 1rem;
}

.retry-button {
    background-color: var(--primary);
    color: var(--neutral-0);
    border: none;
    border-radius: 0.5rem;
    padding: 0.7rem 1.5rem;
    font-size: var(--fs-small);
    cursor: pointer;
    transition: background-color 0.2s;
}

.retry-button:hover {
    background-color: var(--primary-dark);
}

/* loading state */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--neutral-900);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    padding: 3rem;
    border-radius: 1.5rem;
    background-color: var(--neutral-800);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--neutral-600);
}

.weather-icon-container {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sun-core {
    position: absolute;
    width: 70px;
    height: 70px;
    background: var(--orange-500);
    border-radius: 50%;
    top: 35px;
    left: 35px;
    z-index: 2;
    box-shadow: 0 0 20px rgba(255, 159, 28, 0.5);
    animation: pulse 2.5s infinite alternate ease-in-out;
}

.sun-rays {
    position: absolute;
    width: 110px;
    height: 110px;
    top: 15px;
    left: 15px;
    border-radius: 50%;
    background: transparent;
    border: 4px solid var(--orange-500);
    opacity: 0.6;
    z-index: 1;
    animation: spin 12s linear infinite;
}

.cloud {
    position: absolute;
    background: white;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 3;
}

.cloud-1 {
    width: 70px;
    height: 20px;
    top: 70px;
    left: 25px;
    animation: float 3s ease-in-out infinite alternate;
    position: relative;
    overflow: visible;
}

.cloud-1:before, .cloud-1:after {
    content: '';
    position: absolute;
    background-color: white;
    border-radius: 50%;
}

.cloud-1:before {
    width: 35px;
    height: 35px;
    top: -18px;
    left: 12px;
}

.cloud-1:after {
    width: 25px;
    height: 25px;
    top: -12px;
    left: 36px;
}

.cloud-2 {
    width: 50px;
    height: 20px;
    top: 55px;
    left: 35px;
    border-radius: 30px;
    animation: float-cloud-2 5s ease-in-out infinite;
    position: relative;
}

.cloud-2:before, .cloud-2:after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

.cloud-2:before {
    width: 25px;
    height: 25px;
    top: -15px;
    left: 7px;
}

.cloud-2:after {
    width: 18px;
    height: 18px;
    top: -10px;
    left: 25px;
}

.raindrops {
    position: absolute;
    left: 16px;
    top: 20px;
    z-index: 4;
}

.drop {
    position: absolute;
    width: 7px;
    height: 12px;
    background: rgb(74, 156, 237);
    border-radius: 50%;
    opacity: 0;
    animation: rain 1.5s linear infinite;
}

.drop-1 {
    left: 0;
    animation-delay: 0s;
}

.drop-2 {
    left: 15px;
    animation-delay: 0.2s;
}

.drop-3 {
    left: 30px;
    animation-delay: 0.4s;
}

.loading-text {
    font-size: 1.2rem;
    color: var(--neutral-200);
    font-weight: var(--fw-500);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dot-1, .dot-2, .dot-3 {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--primary);
    opacity: 0;
    animation: fade-dots 1.5s infinite;
    margin-left: 2px;
}

/* radar */

.radar-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

#radar-button {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    gap: 0.5rem;
    background-color: rgba(39, 37, 65, 0.8);
    color: var(--neutral-0);
    border: 1px solid var(--neutral-600);
    border-radius: 0.5rem;
    padding: 8px;
    min-height: 36px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: background-color 0.2s, transform 0.1s;
}

body.light-theme #radar-button {
    background-color: rgba(218, 227, 246, 0.25);
} 

#radar-button:hover {
    background-color: var(--neutral-700);
}

#radar-button:active {
    transform: scale(0.95);
}

#radar-button img {
    width: 20px;
    height: 20px;
}

body.light-theme #radar-button img {
   content: url(assets/images/icon-radar-light.webp);
}

.radar-layers, .radar-timeline {
    z-index: 1000;
    pointer-events: auto;
}

.radar-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    overflow: hidden;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.radar-modal.active {
    display: block;
    opacity: 1;
}

.radar-modal-content {
    position: relative;
    background-color: var(--neutral-800);
    margin: 2rem auto;
    padding: 0;
    width: 90%;
    max-width: 1000px;
    border-radius: 1rem;
    border: 1px solid var(--neutral-600);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out forwards;
    height: calc(100% - 4rem);
    display: flex;
    flex-direction: column;
}

.radar-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--neutral-600);
}

.radar-modal-header h2 {
    margin: 0;
    font-size: var(--fs-subheading);
}

.radar-close-button {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--neutral-200);
    cursor: pointer;
}

.radar-close-button:hover{
    color: var(--neutral-0);
}

.radar-map-container {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#radar-map {
    width: 100%;
    height: 100%;
    background-color: var(--neutral-700);
    z-index: 500;
}

.radar-timeline {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 0.8rem;
    background-color: rgba(39, 37, 65, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--neutral-600);
}

body.light-theme .radar-timeline {
    background-color: rgba(218, 227, 246, 0.25);
}

.radar-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--neutral-600);
    outline: none;
    border-radius: 2px;
}

.radar-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.radar-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.radar-time-label {
    font-size: 0.9rem;
    color: var(--neutral-200);
    min-width: 80px;
    text-align: right;
}

.radar-timeline-button {
    background-color: var(--neutral-700);
    border: 1px solid var(--neutral-600);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

body:not(.light-theme) .leaflet-tile-pane {
  filter: brightness(1.5) contrast(0.9);
}

body.light-theme #radar-play-pause img[src*="icon-play"] {
    content: url(assets/images/icon-play-light.webp);
}

body.light-theme #radar-play-pause img[src*="icon-pause"] {
    content: url(assets/images/icon-pause-light.webp);
}

.radar-timeline-button img {
    width: 14px;
    height: 14px;
}

.radar-layer-button {
    background-color: var(--neutral-700);
    border: 1px solid var(--neutral-600);
    color: var(--neutral-200);
    padding: 0.5rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.radar-layer-button:hover {
    background-color: var(--neutral-600);
}

.radar-layer-button.active {
    background-color: var(--primary);
    color: var(--neutral-0);
    border-color: var(--primary);
}

.radar-layers {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(var(--neutral-800-rgb), 0.8);
    border-radius: 0.5rem;
    border: 1px solid var(--neutral-600);
    backdrop-filter: blur(5px);
}

body.light-theme .radar-layer-button {
    background-color: var(--neutral-800);
    color: var(--neutral-200);
}

body.light-theme .radar-layer-button.active {
    background-color: var(--primary);
    color: var(--neutral-0);
}

/* Animations */
@keyframes modalFadeIn {
    from {transform: translateY(20px); opacity: 0;}
    to {transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% {transform: scale(1); box-shadow: 0 0 20px rgba(255, 159, 28, 0.4);}
    100% {transform: scale(1.1); box-shadow: 0 0 30px rgba(255, 159, 28, 0.7);}
}

@keyframes spin {
    0% {transform: rotate(0deg);}
    100% {transform: rotate(360deg);}
}

@keyframes float {
    0% {transform: translateX(-5px) translateY(0px);}
    50% {transform: translateX(0px) translateY(2px);}
    100% {transform: translateX(5px) translateY(-2px);}
}

@keyframes rain {
    0% {transform: translateY(0); opacity: 0.9;}
    70% {opacity: 0.9;}
    100% {transform: translateY(20px); opacity: 0px;}
}

@keyframes fade-dots {
    0% {transform: scale(0.8); opacity: 0.3;}
    50% {transform: scale(1.2); opacity: 1;}
    100% {transform: scale(0.8); opacity: 0.3;}
}

@keyframes float-cloud-2 {
    0% {transform: translateX(-5px) translateY(0px);}
    25% {transform: translateX(0px) translateY(2px);}
    50% {transform: translateX(5px) translateY(-1px);}
    75% {transform: translateX(0px) translateY(-2px);}
    100% {transform: translateX(-5px) translateY(0px);}    
}

@keyframes fadeIn {
    from {opacity: 0; transform: translateY(10px);}
    to {opacity: 1; transform: translateY(0);}
}

.main-content > div {
    opacity: 0;
    animation: fadeIn 1.5s forwards;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-5px);
    }
}

.item.current-weather { animation-delay: 0.1s; }
.item.favourites-section { animation-delay: 0.2s; }
.item.daily-forecast { animation-delay: 0.3s; }
.item.hourly-forecast { animation-delay: 0.4s; }

img[src*="icon-sunny"] {
    animation: spin 30s linear infinite;
}

img[src*="icon-partly-cloudy.webp"],
img[src*="icon-night-partly-cloudy.webp"], 
img[src*="icon-overcast.webp"] {
    animation: drift 4s ease-in-out infinite alternate;
}

@keyframes drift {
    from {transform: translateX(-3%);}
    to {transform: translateX(3%);}
}

img[src*="icon-rain"], img[src*="icon-drizzle"] {
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 100% {transform: translateY(0);}
  50% {transform: translateY(1.5px);}
}

@keyframes slideIn {
  to {opacity: 1; transform: translateY(0);}
}


#theme-toggle {
  transition: transform 0.1s, background-color 0.3s;
}

#theme-toggle:active {
  transform: scale(0.95);
}

/* Favourite animation */
@keyframes favourite-pop {
    0% {
        transform: scale(1);
    }
    50% {transform: scale(1.1);
    }
    70% {transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.favourite-icon.animate {
    animation: favourite-pop .4s ease-in-out;
}

/* Weather background effects */
.weather-background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* Night stars */

.night-background .weather-background-effects {
    background-color: rgba(20, 20, 40, 0.1);
}

.star {
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle ease-in-out infinite;
}

.star-bright {
    box-shadow: 0 0 8px 4px rgba(255, 255, 255, 0.8);
}

/* Rain effect */
.rain-background .weather-background-effects {
    background: linear-gradient(to bottom,  transparent, rgba(100, 100, 200, 0.05));
}

.rain-drop {
    position: absolute;
    width: 1px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6));
    height: 20px;
    top: -20px;
    animation: rainfall linear infinite;
}

/* Snow effect */
.snow-flake {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    top: -6px;
    animation: snowfall linear infinite;
}

@keyframes twinkle {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 0.8;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

@keyframes rainfall {
    from {transform: translateY(0); opacity: 0;}
    10% {opacity: 1;}
    90% {opacity: 1;}
    to {transform: translateY(100vh); opacity: 0;}
}

@keyframes snowfall {
    from {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {opacity: 1;}
    90% {opacity: 0.8;}
    to {
        transform: translateY(100vh) translateX(20px) rotate(360deg);
        opacity: 0;
    }
}

/* media queries */

@media (min-width: 640px) {
    .search-form {
        flex-direction: row;
        max-width: 560px;
        margin-inline: auto;
    }
    .search-form button {
        width: auto;
        padding: 0 1rem;
    }

    :root { 
        --fs-header: 3.2rem; 
    }
    .weather-main { 
        padding: 2rem 1.25rem; 
        background-image: url(assets/images/bg-today-large.svg); 
    }
    .weather-info img { 
        max-width: 90px; 
    }
    .weather-temperature { 
        font-size: 4rem; 
    }

    .daily-forecast ul { 
        grid-template-columns:  repeat(4, 1fr); 
    }
}

@media (max-width: 767px) {
    #compare-toggle span {
        display: none;
    }

    .units-dropdown .dropdown-toggle span {
        display: none;
    }

    .units-dropdown .dropdown-toggle .units-image {
        margin-right: 4px;
    }

    .radar-toggle {
        position: absolute;
        top: auto;
        left: auto;
        bottom: 20px;
        right: 20px;
        z-index: 5;
    }

    #radar-button {
        padding: 10px;
        min-width: 32px;
        min-height: 32px;
        background-color: rgba(39, 37, 65, 0.6);
        backdrop-filter: blur(5px);
        border-radius: 50%;
    }

    #radar-button span {
        display: none;
    }

    #radar-button img {
        margin-right: 0;
    }
}

@media (min-width: 768px) {
    :root {
        --fs-header: 3.2rem;
    }

    .daily-forecast ul { 
        grid-template-columns: repeat(5, 1fr); 
    }

    .weather-icon-container {
        width: 150px;
        height: 150px;
    }

    .sun-core {
        width: 70px;
        height: 70px;
        top: 40px;
        left: 40px;
    }

    .sun-rays {
        width: 120px;
        height: 120px;
        top: 15px;
        left: 15px;
    }

    .comparison-cities {
        flex-direction: row;
    }

    .comparison-vs {
        width: 60px;
        flex-shrink: 0;
    }

    .comparison-vs::before, .comparison-vs::after {
        display: none;
    }

    .comparison-feels-like, .comparison-min-max {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.1rem;
        text-align: center;
        padding: 0.4rem 0;
    }

    .feels-like-label, .min-max-label {
        font-size: 0.9rem;
        color: var(--neutral-200);
        margin-bottom: 0.1rem;
    }

    .comparison-temp-details {
        flex-direction: row;
        justify-content: space-around;
    }

    .comparison-main {
        margin-bottom: 1rem;
        justify-content: center;
    }

    .weekly-trend {
        padding: 1rem 1.2rem;;
    }

    .trend-message {
        font-size: 1rem;
    }

    .header-bar {
        gap: 0.5rem;
    }

    .theme-controls {
        gap: 0.75rem;
    }

    #compare-toggle, .units-dropdown .dropdown-toggle {
        font-size: var(--fs-body);
        padding: 0.5rem 0.8rem;
    }

    .radar-toggle {
        top: 20px;
        left: 20px;
        bottom: auto;
        right: auto;
    }

    #radar-button {
        font-size: var(--fs-body);
        padding: 0.5rem 0.8rem;
        border-radius: 0.5rem 0.8rem;
        background-color: rgba(39, 37, 65, 0.8);
    }

    #radar-button img {
        margin-right: 8px;
    }

    #compare-toggle span, .units-dropdown .dropdown-toggle span, #radar-button span {
        display: inline;
    }
}

@media (min-width: 1024px) {
    :root {
        --fs-header: 2.9rem;
        --fs-subheading: 1.5rem;
        --fs-body: 1.125rem;
        --fs-small: 1rem;
    }

    .container {
        max-width: 1300px;
    }

    .logo img {
        height: 40px;
    }

    #theme-toggle img {
        width: 24px;
        height: 24px;
        display: block;
    }

    body.light-theme .weather-main {
        background-image: url('assets/images/bg-today-large-light.svg');
    }


    .hourly-card {
        padding: 0.85rem 0.8rem;
    }
    .dropdown-toggle {
        gap: 0.6rem;
        padding: 0.5rem 0.6rem;
    }

    .search-form {
        margin-bottom: 1.5rem;
    }

    .weather-details {
        margin: 1rem 0;
    }

    .main-content {
        grid-template-columns: minmax(100px, 0.7fr) minmax(350px, 2fr) minmax(180px, 1fr);
        grid-template-rows: auto 1fr;
        grid-template-areas:
            "favourites current hourly"
            "favourites daily hourly";
        gap: 1.5rem;
        align-items: start;
    }

    .item.current-weather { 
        grid-area: current; 
        width: 100%;
        min-width: 0;
    }

    .item.favourites-section {
        grid-area: favourites;
        margin-bottom: 0;
        height: auto;
        align-self: start;
        display: flex;
        flex-direction: column;
        max-height: unset;
    }
    .item.daily-forecast { 
        grid-area: daily; 
    }
    .item.hourly-forecast { 
        grid-area: hourly; 
        height: 725px;
    }

    .favourites-list {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        flex: 1;
        min-height: 0;
        max-height: 660px;
        overflow-y: auto;
        scroll-behavior: smooth;
        scrollbar-width: none;
        padding-right: 4px;
        padding-bottom: 4px;
    }

    .favourites-list::-webkit-scrollbar {
        display: none;
    }

    .no-favourites {
        text-align: center;
        color: var(--neutral-300);
        padding: 1rem;
        min-height: auto;
        height: auto;
    }

    .favourite-card {
        flex-shrink: 0;
        min-height: 54px;
    }

    .weather-main {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 5rem 1.5rem;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }
    .weather-meta { 
        align-items: flex-start;
        flex: 1;
        min-width: 0;
        max-width: 60%;
        overflow: hidden;
        white-space: nowrap;
    }
    .weather-info { 
        align-self: center; 
        gap: 0.5rem; 
    }
    .weather-info img { 
        max-width: 110px; 
    }
    .weather-temperature { 
        font-size: 4.5rem; 
    }

    .weather-details {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

    .weather-detail {
        gap: 1rem;
    }

    .weather-location {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .daily-forecast h2 { 
        margin-bottom: 1rem; 
    }
    .daily-forecast ul {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        width: 100%;
    }

    .daily-card {
        flex: 1;
        min-width: 0;
        padding: 0.8rem 0.4rem;
        gap: 0.5rem;
        transition: transform 0.2s ease-out;
        position: relative;
        overflow: hidden;
        z-index: 1;
    }

    .daily-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--neutral-600);
        z-index: -1;
        transition: transform 0.3s ease;
        transform: translateY(100%);
    }

    .daily-card:hover::before {
        transform: translateY(0);
    }

    .daily-day {
        font-size: calc(var(--fs-small) * 0.9);
    }

    .daily-temps {
        gap: 1rem;
        justify-content: center;
    }

    .hourly-forecast { 
        padding: 1.2rem; 
        min-width: 0;
        display: flex;
        flex-direction: column;
        height: auto;
    }
    .hourly-forecast ul { 
        grid-template-columns: 1fr;
        max-height: 650px;
        overflow-y: auto;
        padding-bottom: 0.5rem;
    }

    .weather-navigation {
        margin-top: 0;
    }

    .weather-tip {
        max-width: 90%;
    }
}

