:root {
    --primary-blue: #1e88e5;
    --primary-dark: #1565c0;
    --accent-blue: #00f2fe;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-light: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(145deg, #0a1f2e, #0b2f4e);
    min-height: 100vh;
    color: var(--text-light);
    overflow-x: hidden;
    position: relative;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.sun {
    position: absolute;
    top: 50px;
    right: 50px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #ffd700, #ffb300);
    border-radius: 50%;
    box-shadow: 0 0 80px #ffd700;
    animation: sunPulse 6s ease-in-out infinite;
    opacity: 0.25;
}

.moon {
    position: absolute;
    top: 50px;
    right: 50px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #f0f0f0, #c0c0c0);
    border-radius: 50%;
    box-shadow: 0 0 60px #ffffff;
    animation: moonPulse 8s ease-in-out infinite;
    opacity: 0;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 1000px;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 5;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.cloud:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

.cloud1 {
    width: 140px;
    height: 50px;
    top: 80px;
    left: -150px;
    animation: floatCloud 35s linear infinite;
}

.cloud1::before {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 20px;
}

.cloud1::after {
    width: 80px;
    height: 80px;
    top: -40px;
    left: 50px;
}

.cloud2 {
    width: 180px;
    height: 60px;
    top: 200px;
    left: -200px;
    animation: floatCloud 45s linear infinite;
    animation-delay: -10s;
}

.cloud2::before {
    width: 70px;
    height: 70px;
    top: -35px;
    left: 25px;
}

.cloud2::after {
    width: 90px;
    height: 90px;
    top: -45px;
    left: 60px;
}

.cloud3 {
    width: 160px;
    height: 55px;
    top: 350px;
    left: -180px;
    animation: floatCloud 40s linear infinite;
    animation-delay: -20s;
}

.cloud4 {
    width: 200px;
    height: 65px;
    top: 500px;
    left: -220px;
    animation: floatCloud 50s linear infinite;
    animation-delay: -5s;
}

.cloud-effect {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    display: none;
}

.cloud-effect.active {
    display: block;
}

.cloud-particle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 20px white;
    animation: explodeCloud 1s ease-out forwards;
}

.container {
    position: relative;
    z-index: 10;
    max-width: 1300px;
    margin: 0 auto;
    padding: 30px 40px;
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: rgba(10, 25, 40, 0.4);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 60px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.location-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.location-icon-wrapper {
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, #00c6fb, #005bea);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0, 198, 251, 0.4);
}

.location-icon-wrapper:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.8);
}

.location-text h1 {
    font-size: 26px;
    font-weight: 600;
}

.location-text h1 span {
    font-weight: 400;
    opacity: 0.9;
    font-size: 20px;
}

.datetime {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 5px;
    font-family: 'Courier New', monospace;
}

.current-weather-premium {
    background: linear-gradient(145deg, rgba(30, 136, 229, 0.3), rgba(21, 101, 192, 0.3));
    backdrop-filter: blur(20px);
    border-radius: 50px;
    padding: 40px;
    margin-bottom: 50px;
    display: grid;
    grid-template-columns: 1fr auto 1.5fr;
    align-items: center;
    gap: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.current-weather-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.current-weather-left {
    text-align: left;
}

.temp-large {
    font-size: 80px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(145deg, #fff, #a0d0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(255,255,255,0.3);
}

.feels-like {
    font-size: 18px;
    opacity: 0.9;
    margin-top: 5px;
    color: var(--text-dim);
}

.weather-desc-main {
    font-size: 24px;
    font-weight: 600;
    margin-top: 10px;
    text-transform: capitalize;
}

.current-weather-center {
    display: flex;
    justify-content: center;
}

.weather-icon-main {
    width: 150px;
    height: 150px;
    filter: drop-shadow(0 0 30px rgba(255,255,255,0.5));
    animation: floatIcon 4s ease-in-out infinite;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    border-color: var(--accent-blue);
}

.stat-item i {
    font-size: 28px;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.stat-item span {
    font-size: 24px;
    font-weight: 700;
}

.stat-item label {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

.forecast-title {
    margin-bottom: 30px;
    position: relative;
}

.forecast-title h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(145deg, #fff, var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.forecast-decoration {
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue), transparent);
    border-radius: 2px;
    animation: expandWidth 2s ease-out;
}

.forecast-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.forecast-card {
    background: rgba(20, 40, 60, 0.5);
    backdrop-filter: blur(15px);
    border-radius: 35px;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.forecast-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.forecast-card:hover {
    transform: translateY(-15px) scale(1.05);
    border-color: var(--accent-blue);
    box-shadow: 0 15px 40px rgba(0, 242, 254, 0.3);
    background: rgba(0, 150, 200, 0.2);
}

.forecast-card:hover::before {
    left: 100%;
}

.forecast-card.active {
    border: 2px solid var(--accent-blue);
    background: rgba(0, 242, 254, 0.15);
    box-shadow: 0 0 40px rgba(0, 242, 254, 0.4);
}

.forecast-day {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.forecast-date {
    font-size: 14px;
    color: var(--text-dim);
    margin-top: -5px;
}

.forecast-icon {
    width: 80px;
    height: 80px;
    margin: 5px 0;
    animation: floatIcon 3s ease-in-out infinite;
}

.forecast-temp {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(145deg, #fff, var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.forecast-desc {
    font-size: 14px;
    color: var(--text-dim);
    text-transform: capitalize;
    text-align: center;
}

.forecast-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-dim);
}

.forecast-stats i {
    color: var(--accent-blue);
    margin-right: 5px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(145deg, #0a1f2e, #0b2f4e);
    border-radius: 50px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 32px;
    font-weight: 700;
}

.modal-header h2 span {
    color: var(--accent-blue);
    text-shadow: 0 0 15px rgba(0, 242, 254, 0.5);
}

.modal-close {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
    color: var(--accent-blue);
}

.modal-body {
    padding: 40px;
}

.modal-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.modal-detail-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.modal-detail-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
    border-color: var(--accent-blue);
}

.modal-detail-item i {
    font-size: 40px;
    color: var(--accent-blue);
}

.modal-detail-info {
    display: flex;
    flex-direction: column;
}

.modal-detail-label {
    font-size: 14px;
    color: var(--text-dim);
}

.modal-detail-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.modal-detail-unit {
    font-size: 16px;
    color: var(--text-dim);
    margin-left: 5px;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(145deg, #00c6fb, #005bea);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0, 198, 251, 0.4);
}

.toast.show {
    transform: translateX(0);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 40, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: opacity 0.5s;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 68, 68, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 4000;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.error-message.active {
    display: flex;
    animation: slideInRight 0.3s;
}

@keyframes floatCloud {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 200px)); }
}

@keyframes sunPulse {
    0%, 100% { opacity: 0.25; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.1); }
}

@keyframes moonPulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.2; }
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes explodeCloud {
    0% { transform: scale(0) translate(0, 0); opacity: 1; }
    100% { transform: scale(3) translate(var(--x), var(--y)); opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes expandWidth {
    from { width: 0; }
    to { width: 100px; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 1024px) {
    .current-weather-premium {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .current-weather-left { text-align: center; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .container { padding: 20px; }
    .weather-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .location-info { flex-direction: column; }
    .location-text h1 { font-size: 22px; }
    .temp-large { font-size: 60px; }
    .forecast-grid-premium {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 15px;
    }
    .modal-content { width: 95%; }
    .modal-header h2 { font-size: 24px; }
}

@media (max-width: 480px) {
    .forecast-grid-premium { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }
    .modal-detail-grid { grid-template-columns: 1fr; }
}