:root {
    --card-background: rgba(30, 40, 60, 0.35);
    --text-color: #e0e0e0;
    --text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    --border-color: rgba(255, 255, 255, 0.2);
    --mouse-x: 50%;
    --mouse-y: 50%;
}

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

body {
    font-family: 'Rubik', sans-serif;
    color: var(--text-color);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-color: #0f1018;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/*Canvas + Background*/
#sky-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}
#foreground-img {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85%;
    object-fit: cover;
    object-position: center top;
    z-index: 1;
    pointer-events: none;
    filter: brightness(1);
    transition: filter 2.5s ease-in-out;
}
.theme-night #foreground-img,
.theme-rainy #foreground-img,
.theme-thunderstorm #foreground-img {
    filter: brightness(0.4);
}
.theme-snowy #foreground-img {
    filter: brightness(0.8) saturate(0.6);
}
.theme-sunny #foreground-img {
    filter: brightness(1.1) saturate(1.1);
}
#effects-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}
body.torch-on::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle 250px at var(--mouse-x) var(--mouse-y), rgba(255, 248, 220, 0.15) 0%, transparent 80%);
    pointer-events: none;
    z-index: 4;
    transition: background 0.5s ease;
}
.theme-night.torch-on body::before {
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(255, 248, 220, 0.15) 0%, rgba(255, 248, 220, 0.0) 20%);
}
.theme-sunny.torch-on::before {
    background: radial-gradient(circle 200px at var(--mouse-x) var(--mouse-y), rgba(255, 255, 220, 0.05) 0%, transparent 80%);
}

/*Main UI*/
.weather-lounge {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 500px;
    padding: 20px;
}
.search-bar {
    display: flex;
    width: 100%;
    margin-bottom: 20px;
    background-color: var(--card-background);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
#city-input {
    flex-grow: 1;
    border: none;
    padding: 15px 20px;
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: var(--text-color);
}
#city-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
#search-button, #geo-button {
    padding: 15px 20px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}
#search-button:hover, #geo-button:hover {
    background: rgba(255, 255, 255, 0.2);
}
#geo-button {
    border-left: 1px solid var(--border-color);
}

/*weather card*/
.weather-card {
    background: var(--card-background);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    width: 100%;
    text-align: center;
    text-shadow: var(--text-shadow);
    position: relative; 
    transition: all 0.5s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
#card-effects-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    border-radius: 20px;
}
.card-content {
    position: relative;
    z-index: 0;
    transition: opacity 0.5s ease-in-out;
}
.card-content.loading {
    opacity: 0.2;
}
.theme-sunny .weather-card {
    box-shadow: inset 5px 5px 15px rgba(255, 255, 220, 0.1), -8px -8px 20px rgba(0, 0, 0, 0.3);
}
#location-name {
    font-size: 2.5rem;
}
#weather-description {
    font-size: 1.2rem;
    text-transform: capitalize;
    margin-bottom: 15px;
}
.main-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: -10px 0;
}
#weather-icon {
    width: 100px !important;
    height: 100px !important;
}
#temperature {
    font-size: 5rem;
    font-weight: 500;
}
.details {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    font-size: 1rem;
}

/*Hourly forecast*/
.hourly-forecast-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}
.hourly-forecast-container::-webkit-scrollbar {
    height: 6px;
}
.hourly-forecast-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}
.hourly-forecast-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}
.hourly-forecast {
    display: flex;
    flex-wrap: nowrap;
    padding-bottom: 10px;
}
.hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}
.hourly-item .temp {
    font-weight: 500;
}
.hourly-item canvas {
    width: 40px !important;
    height: 40px !important;
}

/*Loader*/
.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 10;
}
@keyframes spin {
    0% {transform: translate(-50%, -50%) rotate(0deg);}
    100% {transform: translate(-50%, -50%) rotate(360deg);}
}

/*Tools + tester*/
#theme-tester {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 5px;
    display: flex;
    gap: 5px;
}
#theme-tester button {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    color: white;
    width: 45px;
    height: 45px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#theme-tester button:hover {
    background: rgba(255, 255, 255, 0.2);
}
#tools-sidebar {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.tool-button {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    font-size: 1.5rem;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    color: white;
    transition: background 0.2s, transform 0.2s;
}
.tool-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}
.tool-button.active {
    background: #007bff;
    color: white;
}
#torch-button.active {
    background: #ffc107;
}
#heater-button.active {
    background: #fc4a1a;
}

/* Clock */
#clock-container {
    position: fixed;
    top: 90px;
    right: 130px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
}
#clock-arc-container {
    width: 140px;
    height: 140px;
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
}
#clock-arc-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.clock-marker {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 3px black;
}

.marker-12 { top: 10px; }
.marker-3 { right: 10px; }
.marker-6 { bottom: 10px; }
.marker-9 { left: 10px; }

#clock-hand-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}
#hour-hand, #minute-hand {
    background: white;
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    border-radius: 2px;
}
#hour-hand {
    width: 4px;
    height: 40px;
    margin-left: -2px;
}
#minute-hand {
    width: 2px;
    height: 55px;
    margin-left: -1px;
}
#clock-center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    z-index: 1;
}
#clock-display {
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: 400;
    color: white;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0,0,0,0.2);
    padding: 2px 10px;
    border-radius: 20px;
}
footer {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 1px 1px 2px black;
    z-index: 5;
}
footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}