:root {
    --bg-color: #5db8fe;
    --text-color: #1e1e1e;
    --header-bg: #5691d0;
    --border-color: rgb(0, 184, 245);
    --footer-bg: #5691d0;
    --btn-bg: #00bbff;
    --btn-hover: #f6fafc;
    --form-bg: aliceblue;
    --hover-bg: #ffcb00;
    --hover-text: #000;
}

::-webkit-scrollbar {
    width: 10px;
    border-radius: 10px;
    background-color: #003F4E;

}

::-webkit-scrollbar:hover {
    background-color: #003F4E;
}

::-webkit-scrollbar-thumb {
    box-shadow: 2px 2px 5px #003F4E;
    background: linear-gradient(45deg, #9465D4, #12E4DA);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #12E4DA, #9465D4);
}

    }
    ::-webkit-scrollbar:hover {
    background-color: #003F4E;
    }
    ::-webkit-scrollbar-thumb {
    box-shadow: 2px 2px 5px #003F4E;
    background: linear-gradient(45deg, #9465D4, #12E4DA);
    border-radius: 10px;
    }
    ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #12E4DA, #9465D4);
    }


.display-font {
    font-family: "Playfair Display", serif;
    font-size: large;
    font-optical-sizing: auto;
    font-weight: normal;
    font-style: normal;
}

.dark-mode {
    --bg-color: #06081b;
    --text-color: #ffffff;
    --header-bg: #333;
    --border-color: #444;
    --btn-bg: #444;
    --btn-hover: #eeb116;
    --footer-bg: #333;
    --form-bg: #2c2c2c;
    --hover-bg: #ffcb00;
    --hover-text: #000;
}

* {
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
}

body {
    font-family: 'Playfair Display', serif;
    margin: 0;
    padding: 0;
    text-align: center;
    /* background-color: #F0F4F8; */
    backdrop-filter: blur(8px);
    background-image: url(./assets/day-pic.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    color: #1A1A1A;
    transition: background-color 0.5s ease, color 0.5s ease;
    animation: fadeIn 0.8s ease-in-out;
}

/* Fade animation for theme change or page change */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

body.dark-mode {
    background-image: url(./assets/night-pics.avif);
    color: #fff;
}

/* Dark mode */
.dark-mode {
    background-color: #475569;
    color: white;
}

.dark-mode nav {
    background: #363f4b;
}

.dark-mode-toggle {
    position: sticky;
    top: 10px;
    right: 10px;
    padding: 12px 18px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    z-index: 1000;
    background: linear-gradient(135deg, #4e54c8, #8f94fb);
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease, transform 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #8f94fb, #4e54c8);
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40vh;
    flex-direction: column;
}

#city {
    width: 300px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #afafaf;
    border-radius: 5px;
    outline: none;
    text-align: center;
}

.suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #ccc;
    max-height: 150px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    background: #aeacac;
    display: none;
    border-radius: 5px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
    margin-top: 1em;
}

.suggestions-list li {
    padding: 10px;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
}

.suggestions-list li:hover {
    background-color: #5691d0;
}

/* Header Styles */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #9564d4, #11e6db);
    color: white;
    padding: 1rem 2rem;
    align-items: center;
    height: 65px;
}

.nav {
    display: flex;
    gap: 15px;
}

.nav a {
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    font-weight: bold;
    color: #f8f9fa;
    text-decoration: none;
    padding: 10px;
    position: relative;
    font-size: 20px;
    transition: all 0.3s ease-in-out;
}

.nav a::after {
    content: " ";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #9564d4, #11e6db);
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

.nav a:hover::after {
    transform: scaleX(1);
}

.nav a:hover {
    color: #9119f3;
    text-shadow: 0px 0px 5px rgba(48, 231, 207, 0.7);
}

.ham {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

#menu {
    display: none;
}

.ham span {
    display: block;
    width: 35px;
    height: 4px;
    background-color: white;
    border-radius: 2px;
    transition: 0.3s;
    left: 90px;

}


@media screen and (max-width:851px) {
    .nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 65px;
        z-index: 1000;
        left: 0;
        width: 100%;
        background: linear-gradient(90deg, #9564d4, #11e6db);
        box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
        text-align: center;
        border-top: 1px solid gray;
    }

    .nav a {
        display: block;
        padding: 15px;
        position: relative;
        text-decoration: none;
        color: white;
        position: relative;

    }

    .nav a:hover {
        color: white;
        transform: scale(1.05);
        text-decoration: none;

    }

    .nav a::after {
        content: " ";
        position: absolute;
        left: 0;
        bottom: -3px;
        width: 100%;
        height: 2px;
        background: linear-gradient(90deg, #40b0cc, #58152c);
        transform: scaleX(0);
        transition: transform 0.3s ease-in-out;
    }

    .nav a:hover::after {
        transform: scaleX(1);
    }

    .ham {
        display: flex;
    }

    #menu:checked~.nav {
        display: flex;
    }

    .dark-mode-toggle {
        box-shadow: none;
        background: none;
    }

    .dark-mode .nav {
        background: #363f4b;
    }

    .dark-mode .dark-mode-toggle {
        background: #363f4b;

    }

}

@media (max-width:675px) {
    .nav {
        max-width: 100%;
    }
}

.logo-container {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    /* Ensure alignment to the left */
    flex-wrap: nowrap;
    /* Prevents text from wrapping below */
    gap: 10px;
    /* Adds spacing between logo and text */
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
    white-space: nowrap;
    /* Ensures text stays in a single line */
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: contain;
}





/* Fix mobile layout */
@media (max-width: 768px) {


    .logo-container {
        justify-content: space-between;
        width: 100%;
    }

}


/* main css  */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 1em;
    min-height: calc(100vh - 161px);
}

.content-box {
    width: 40em;
}

@media(max-width:600px) {
    .content-box {
        width: 10em;
    }
}

.form {
    width: 100%;
    border-radius: 10px;
    background: url(/assets/bg-img.webp);
    background-size: 100% 100%;
    height: 100%;
    color: #ffff;
    display: grid;
    grid-template-rows: 1fr auto;
}

#display {
    display: flex;
    justify-content: space-between;
    padding: 2em;

    & h2 {
        margin-bottom: 1em;
    }
}

.temporary {
    align-self: center;
    text-align: center;
    margin-bottom: 15px;
}

#wicon {
    grid-row-start: 1;
    grid-row-end: 4;
    grid-column-start: 1;
    grid-column-end: 3;
    align-self: center;
}

#wname {
    grid-column-start: 3;
    grid-row-start: 1;
    text-align: center;
    align-self: center;
    justify-self: center;
}

.temp-display-box {
    display: grid;
    grid-template-rows: max-content;
}

#temp {
    font-size: 3em;
    font-weight: bold;
}

.temp-line {
    color: #000000;
    font-weight: normal;
}

.weather-location-box {
    align-self: flex-end;
}

#cname {
    grid-column-start: 3;
    grid-row-start: 3;
    text-align: center;
    align-self: center;
    justify-self: center;
}

.search-input-box {
    margin-bottom: 1em;
}

.location-input-box {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;

}

.location-input-box input[type='text'] {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

#city-input {
    padding: 0.8em 1em;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1em;
    border-radius: 10px 0px 0px 10px;
    outline: none;
    border: 1px solid transparent;
    background-color: #00000023;
    backdrop-filter: blur(5px);
    color: #000000;
    transition: 0.3s;
}

.dark-mode #city-input {
    color: white;
}

#city-input::placeholder {
    color: #000000;
}

.dark-mode #city-input::placeholder {
    color: #fff;
}

#city-input:focus {
    box-shadow: 0 0 6px 1px #5672d0;
    background-color: #0f0f0fab;
    color: white;
}



#submit-btn {
    border: 1px solid transparent;
    background-color: #010101;
    color: #ffff;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    font-size: medium;
    aspect-ratio: 1/1;
    outline: none;
    cursor: pointer;
    border-radius: 0px 10px 10px 0;
    transition: 0.3s;
    border-left: none;

    & svg {
        width: 20px;
        height: 20px;
    }
}

#submit-btn:hover {
    box-shadow: 0 0 6px 1px #2d2d2d;
}

#submit-btn:active {
    background-color: transparent;
}

.w-detail-box {
    width: 50%;
    background-color: #4e5edc44;
    backdrop-filter: blur(10px);
    padding: 1em;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1em;
}

.oth-weather-content {
    padding: 1em;
}

.w-details-head {
    color: #c0c0c0;
    font-size: 0.85em;
    margin-bottom: 0.2em;
}

#init-message {
    font-size: 1.5em;
    color: #000000;
    background: rgb(15, 245, 153);
    background: linear-gradient(120deg, rgba(15, 245, 153, 1) 0%, rgba(82, 210, 255, 1) 50%, rgba(6, 138, 223, 1) 100%);
    padding: 0.5rem 0;
    margin-top: 1em;
    border-radius: 10px;
}

.dark-mode #init-message {
    color: white;
    background: rgb(2, 0, 36);
    background: linear-gradient(90deg, rgba(2, 0, 36, 1) 27%, rgba(9, 9, 121, 1) 65%, rgba(0, 212, 255, 1) 100%);
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #1c1c22, #8f94fb);
    color: white;
    padding: 30px 20px;
    bottom: 0;
    width: 100%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    margin-top: 2em;
    text-align: center;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    transition: background 0.5s ease;
}

footer:hover {
    background: linear-gradient(135deg, #8f94fb, #4e54c8);
}
.dark-mode footer{
    background: linear-gradient(135deg, #29292a, #3c3c3d);
}
.dark-mode footer:hover {
    background: linear-gradient(135deg, #3c3c3d, #29292a);
}

.footer-container ul {
    list-style: none;
    display: flex;
    flex-flow: wrap;
    justify-content: center;
    gap: 1.5em;
    padding: 0;
    margin: 0;
}

.footer-container ul li {
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.footer-container ul li:hover {
    transform: translateY(-5px);
}

ul li a {
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
}

ul li a:hover {
    color: #ffdd57;
}

/* responsive css  */
@media screen and (max-width: 676px) {
    .content-box {
        width: 95vw;
    }

    #display {
        padding: 1em;
    }
}

@media screen and (max-width: 515px) {
    .oth-weather-content {
        flex-flow: wrap;
    }

    .w-detail-box {
        width: calc(50% - 0.5em);
    }

    #wicon {
        width: 100px;
    }
}

@media screen and (max-width: 440px) {
    .logo-img {
        margin-right: 5px;
        width: 30px;
        height: 30px;
    }

    .logo-container h1 {
        font-size: 1.2em;
    }
}

@media screen and (max-width: 375px) {
    .w-detail-box {
        width: 100%;
    }
}


/* Reduce footer spacing on smaller screens */
@media (max-width: 600px) {
    .footer-container ul li {
        margin-bottom: 3px;
        /* Less gap on mobile */
    }

    footer {
        padding: 5px;
        /* Reduce padding to save space */
    }
}

/* util classes */
.d-inline-flex {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.f-bold {
    font-weight: bold;
}

/* C to F toggling btn */
#toggle {
    background: #fff;
    border: none;
    padding: 5px 10px;
    display: inline-block;
    font-size: 20px;
    font-weight: 600;
    width: 80px;
    margin-left: 4px;
    text-transform: uppercase;
    cursor: pointer;
    transform: skew(-21deg);
}


#toggle::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    left: 0;
    background: rgb(20, 20, 20);
    opacity: 0;
    z-index: -1;
    transition: all 0.5s;
}

#toggle:hover {
    color: #fff;
}

#toggle:hover::before {
    left: 0;
    right: 0;
    opacity: 1;
}


/* Weather suggestion  */
#weather-suggestion {
    font-size: 30px;
    font-weight: bolder;
    color: #fff;

}