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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --accent-color: #f093fb;
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    animation: float 20s infinite ease-in-out;
}

.cloud-1 {
    width: 200px;
    height: 60px;
    top: 10%;
    left: -200px;
    animation-delay: 0s;
}

.cloud-2 {
    width: 150px;
    height: 45px;
    top: 30%;
    left: -150px;
    animation-delay: 7s;
}

.cloud-3 {
    width: 180px;
    height: 55px;
    top: 50%;
    left: -180px;
    animation-delay: 14s;
}

.sun {
    position: absolute;
    top: 5%;
    right: 5%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #f093fb 0%, #f5576c 100%);
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(240, 147, 251, 0.6);
    animation: pulse 4s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(120vw); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Container */
.container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Glass Card */
.weather-card {
    width: 100%;
    max-width: 500px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 40px 30px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Header */
.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.weather-icon {
    font-size: 2.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

/* Search Section */
.search-section {
    margin-bottom: 25px;
}

.search-box-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 8px;
    transition: all 0.3s ease;
}

.search-box-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(240, 147, 251, 0.3);
    transform: scale(1.02);
}

.search-icon {
    padding: 0 12px;
    font-size: 1.2rem;
    opacity: 0.7;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    padding: 12px 0;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.search-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Loading & Error */
.hidden {
    display: none !important;
}

.loading-container,
.error-container {
    text-align: center;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container p,
.error-container p {
    font-size: 1rem;
    margin-bottom: 8px;
}

.error-container small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* Weather Info */
.weather-info {
    animation: fadeIn 0.5s ease;
}

.main-weather {
    text-align: center;
    margin-bottom: 25px;
}

.location-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.location-icon {
    font-size: 1.2rem;
}

.location-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.current-time {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
}

.temperature-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.weather-icon-large {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    animation: float 3s infinite ease-in-out;
}

.temp-wrapper {
    display: flex;
    align-items: flex-start;
}

.temp-value {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
}

.temp-unit {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 10px;
}

.feels-like {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 10px;
}

.feels-like strong {
    color: var(--text-primary);
}

.condition-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 15px;
}

.condition-icon {
    font-size: 1.3rem;
}

/* Divider */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    margin: 25px 0;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.3s ease;
}

.detail-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.detail-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.detail-content {
    flex: 1;
}

.detail-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 400;
    margin-bottom: 5px;
}

.detail-content strong {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.detail-description {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Forecast Section */
.forecast-section {
    margin-top: 25px;
}

.forecast-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.hourly-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.hourly-scroll::-webkit-scrollbar {
    height: 6px;
}

.hourly-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.hourly-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.hourly-item {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 15px 20px;
    text-align: center;
    min-width: 80px;
    transition: all 0.3s ease;
}

.hourly-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.hour-time {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.hour-icon {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.hour-temp {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Footer */
.card-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.card-footer p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.card-footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.card-footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.credits {
    font-size: 0.75rem !important;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 520px) {
    .weather-card {
        padding: 30px 20px;
    }
    
    .logo h1 {
        font-size: 1.6rem;
    }
    
    .temp-value {
        font-size: 4rem;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .search-btn {
        padding: 12px 18px;
    }
    
    .btn-text {
        display: none;
    }
}