:root {
    --bg-primary: #0a0f1c;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252b3d;
    --accent-primary: #00d4ff;
    --accent-secondary: #6366f1;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #6366f1 100%);
    --text-primary: #ffffff;
    --text-secondary: #b4bcd0;
    --text-muted: #6b7280;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.6);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
}

.header {
    text-align: center;
    padding: 2.5rem 1rem 1rem;
    position: relative;
}

.logo {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.8rem;
    opacity: 0;
    transform: translateY(-20px);
    animation: slideDown 0.8s var(--spring) 0.2s forwards;
    gap: 10px;
}

.logo i {
    font-size: 3rem;
    color: rgb(3, 181, 212);
}

.logo h1 {
    font-size: 3rem;
    font-weight: 900;
    color: rgb(0, 217, 255);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0;
    transform: translateY(-20px);
    animation: slideDown 0.8s var(--spring) 0.4s forwards;
    margin-bottom: -0.2rem;
}

@keyframes slideDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-section {
    padding: 0 1rem 2rem;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.8s var(--spring) 0.6s forwards;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-input {
    width: 100%;
    height: 60px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    border-color: var(--accent-primary);
    padding: 0 60px 0 24px;
    font-size: 1rem;
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    outline: none;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: rgb(0, 217, 255);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    padding-bottom: 1px;
}

.search-btn:hover {
    opacity: 0.5;
}

.globe-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -2;
    opacity: 0.15;
    pointer-events: none;
}

.globe {
    width: min(80vw, 600px);
    height: auto;
    border-radius: 50%;
    box-shadow: 0 0 100px rgba(0, 212, 255, 0.2);
    animation: slowRotate 30s linear infinite;
}

@keyframes slowRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 28, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    max-width: 300px;
}

.spinner-container {
    position: relative;
    margin-bottom: 2rem;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-top: 3px solid var(--accent-primary);
    border-right: 3px solid var(--accent-secondary);
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto;
    position: relative;
}

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

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

.weather-container {
    padding: 0 1rem 2rem;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(40px);
    transition: var(--transition);
}

.weather-card {
    width: 100%;
    max-width: 600px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    transform: scale(0.95);
    transition: var(--transition);
}

.weather-card.show {
    transform: scale(1);
}

.weather-header {
    background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(255, 255, 255, 0.02) 100%);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.weather-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.weather-icon {
    font-size: 4rem;
    color: rgb(3, 181, 212);
}

.temperature {
    font-size: 4rem;
    font-weight: 800;
    color: rgb(0, 217, 255);
}

.weather-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: capitalize;
}

.weather-details {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.detail-icon {
    width: 48px;
    height: 48px;
    background: rgb(3, 181, 212);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    min-width: 48px;
}

.detail-content {
    flex: 1;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.weather-container.show {
    opacity: 1;
    transform: translateY(0);
    animation: slideUp 0.8s var(--spring);
}

.detail-card {
    animation: fadeInScale 0.6s var(--spring) backwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.error-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    max-width: 90%;
    width: 400px;
}

.error-message {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius);
    text-align: left;
    font-weight: 500;
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    position: relative;
    overflow: hidden;
    animation: opacityFade 1s var(--spring);
}

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

.error-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.error-icon {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.error-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.error-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    margin-left: 2rem;
}

.error-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: var(--transition);
}

.error-close:hover {
    opacity: 0.8;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .search-section {
        padding: 0 1rem 1.5rem;
    }

    .search-input {
        height: 56px;
        font-size: 0.95rem;
    }

    .search-btn {
        width: 40px;
        height: 40px;
    }

    .weather-header {
        padding: 1.5rem;
    }

    .weather-main {
        flex-direction: column;
        gap: 1rem;
    }

    .weather-icon {
        font-size: 3rem;
    }

    .temperature {
        font-size: 3rem;
    }

    .weather-details {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 0.75rem;
    }

    .detail-card {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 2rem 2rem 01rem;
    }

    .logo {
        gap: 0.5rem;
    }

    .logo i {
        font-size: 1.5rem;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .weather-header {
        padding: 1.25rem;
    }

    .temperature {
        font-size: 2.5rem;
    }

    .weather-icon {
        font-size: 2.5rem;
    }

    .detail-card {
        padding: 1rem;
        gap: 0.75rem;
    }

    .detail-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1rem;
    }
}