@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;600;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
}

/* Variables for theme colors */
:root {
    --background-color: linear-gradient(135deg, #1c1c1c, #2e2e2e);
    --text-color: #e0e0e0;
    --container-background: rgba(40, 40, 40, 0.9);
    --button-background: #ff4b2b;
    --container-border: 2px solid rgba(255, 255, 255, 0.1);
    --button-hover: #ff9068;
    --header-background: rgb(54, 54, 54);
}

/* Light Theme */
body.light-theme {
    --background-color: linear-gradient(135deg, #e0eafc, #cfdef3);
    --text-color: #2c3e50;
    --container-background: rgba(255, 255, 255, 0.9);
    --container-border: 2px solid rgba(0, 0, 0, 0.1);
    --button-background: #3498db;
    --button-hover: #2980b9;
    --header-background: white;
}

body {
    background: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-container, .forecast {
    display: flex;
}

.container {
    background-color: var(--container-background);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: var(--container-border);
    transition: background-color 0.3s;
}

.search-box {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.search-box input {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 12px;
    border-radius: 50px;
    color: var(--text-color);
    width: 100%;
}

.search-box .fa-location-dot {
    margin-right: 1rem;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box button {
    margin-left: 1rem;
    background-color: var(--button-background);
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: var(--button-hover);
}

.weather-box img {
    width: 100px;
}

.weather-box,
.weather-details,
.forecast {
    opacity: 0; 
    transform: translateX(50px); 
    max-height: 0; 
    overflow: hidden; 
    transition: all 0.3s ease-in-out;
}

.weather-box.active,
.weather-details.active,
.forecast.active {
    opacity: 1;
    transform: translateX(0); 
    max-height: 500px; 
}

.temperature {
    font-size: 64px;
}

.description {
    font-size: 24px;
    text-transform: capitalize;
    margin-bottom: 10px;
}

.weather-details{
    display: none;
}

.weather-details.active {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.weather-details .text {
    text-align: center;
}

.not-found {
    display: none;
    opacity: 0;
    transform: scale(0.9); /* Start slightly smaller */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.not-found.active {
    display: block;
    opacity: 1;
    transform: scale(1); /* Grow to full size */
}

.not-found img {
    max-width: 100%;
    height: auto;
    display: block; /* Ensure it is displayed */
    margin: 0 auto; /* Center the image */
}


.forecast{
    display: none;
}

.forecast.active {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 6px;
}

.day {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.day img {
    width: 50px;
}

.day-items {
    margin-left: 10px;
}

.temperature1, .temperature2, .temperature3, .temperature4, .temperature5 {
    font-size: 20px;
}

.day-p {
    font-size: 18px;
}

/* Theme Toggle Styles */
.theme-toggle-wrapper {
    position: absolute;
    right: 0;
    margin-right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #616161;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Additional theme-specific styles */
body.light-theme .search-box input {
    color: rgb(48, 47, 47);
    background: rgba(190, 190, 190, 0.6);
}

body.light-theme .search-box input::placeholder {
    color: rgb(51, 51, 51);
}

body.light-theme .day{
    background-color: #ffffff;
}

body.light-theme .toggle-label {
    color: var(--text-color);
}

.app-header {
    width: 100%;
    position: fixed;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 0;
    background-color: var(--header-background);
    color: var(--text-color);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    border-radius: 0 0 50px 50px;
}

.app-footer{
    width: 100%;
    position: fixed;
    bottom: 0;
    display: flex;
    justify-content: center;
    text-align: center;
    padding: 20px 0;
    border-radius: 50px 50px 0 0;
    background-color: var(--header-background);
    color: var(--text-color);
}

.app-footer a{
    color: var(--button-background);
    text-decoration: none;
}

.app-footer i{
    margin-left: 5px;
}