* {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

:root {
    --primary-color: #00d4ff;
    --secondary-color: #0099cc;
    --accent-color: #ff6b6b;
    --dark-bg: #0f1419;
    --card-bg: #1a2332;
    --border-color: #2d3e50;
    --text-primary: #ffffff;
    --text-secondary: #b0b9c1;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1a1f2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-logo i {
    font-size: 1.8rem;
}

.nav-search {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.nav-search:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.nav-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
}

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

.nav-search button {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-search button:hover {
    transform: scale(1.2);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    animation: fadeIn 0.8s ease-out;
}

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

/* ===== ERROR CONTAINER ===== */
.error-container {
    display: none;
    margin-bottom: 2rem;
    animation: slideInDown 0.5s ease-out;
}

.error-message {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    border-radius: 10px;
    padding: 1.5rem;
    color: #ff6b6b;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.error-message i {
    font-size: 1.5rem;
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== WEATHER CURRENT ===== */
.weather-current {
    margin-bottom: 3rem;
}

.weather-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 153, 204, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    animation: slideUp 0.6s ease-out;
}

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

.main-card {
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.location-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.last-updated {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.weather-icon-main {
    width: 150px;
    height: 150px;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.4));
    animation: float 3s ease-in-out infinite;
}

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

.temperature-display {
    display: flex;
    align-items: baseline;
    gap: 2rem;
    margin-bottom: 2rem;
}

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

.temp {
    font-size: 4rem;
    font-weight: 700;
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.temp-unit {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.feels-like {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.feels-like-temp {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== DETAILS GRID ===== */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.detail-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.detail-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.detail-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.detail-content {
    flex: 1;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

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

/* ===== SECTION STYLING ===== */
.section-title {
    margin-bottom: 1.5rem;
}

.section-title h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.section-title i {
    color: var(--primary-color);
}

/* ===== HOURLY FORECAST ===== */
.weather-hourly {
    margin-bottom: 3rem;
}

.hourly-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
}

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

.hourly-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.hourly-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.hourly-item {
    min-width: 120px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.hourly-item:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--primary-color);
    transform: translateY(-10px);
}

.hourly-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.hourly-icon {
    font-size: 2rem;
    margin: 0.5rem 0;
}

.hourly-temp {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== 5-DAY FORECAST ===== */
.weather-forecast {
    margin-bottom: 3rem;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.forecast-card {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(245, 87, 108, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.forecast-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-10px);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2) 0%, rgba(245, 87, 108, 0.1) 100%);
}

.forecast-day {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.forecast-icon {
    font-size: 2.5rem;
    margin: 1rem 0;
}

.forecast-temp {
    margin-bottom: 0.5rem;
}

.forecast-max {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.forecast-min {
    font-size: 1rem;
    color: var(--text-secondary);
}

.forecast-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.8rem;
    text-transform: capitalize;
}

/* ===== ADDITIONAL INFO ===== */
.weather-additional {
    margin-bottom: 3rem;
}

.additional-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.8rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.info-card:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: var(--primary-color);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    color: var(--text-primary);
}

.info-content {
    flex: 1;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

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

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 25, 0.9);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
}

.loading-spinner.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-search {
        max-width: 100%;
        width: 100%;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 0.8rem;
    }

    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .main-container {
        padding: 1rem;
    }

    .weather-card {
        padding: 1.5rem;
    }

    .weather-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .location-info h1 {
        font-size: 1.8rem;
    }

    .weather-icon-main {
        width: 100px;
        height: 100px;
    }

    .temperature-display {
        flex-direction: column;
        gap: 1rem;
        justify-content: center;
        align-items: center;
    }

    .temp {
        font-size: 3rem;
    }

    .details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .detail-item {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .additional-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .info-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
    }

    .info-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .info-label {
        font-size: 0.85rem;
    }

    .info-value {
        font-size: 1.1rem;
    }
}

@media (max-width: 600px) {
    .details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .detail-item {
        flex-direction: row;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.5rem;
    }

    .nav-logo {
        font-size: 0.95rem;
    }

    .nav-logo i {
        font-size: 1.2rem;
    }

    .nav-search input {
        font-size: 0.85rem;
    }

    .section-title h2 {
        font-size: 1.1rem;
    }

    .location-info h1 {
        font-size: 1.3rem;
    }

    .weather-card {
        padding: 1rem;
    }

    .weather-description {
        font-size: 1rem;
    }

    .last-updated {
        font-size: 0.75rem;
    }

    .temp {
        font-size: 2.5rem;
    }

    .feels-like {
        font-size: 0.95rem;
    }

    .weather-icon-main {
        width: 80px;
        height: 80px;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .detail-item {
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .detail-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .detail-label {
        font-size: 0.8rem;
    }

    .detail-value {
        font-size: 1rem;
    }

    .forecast-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .forecast-card {
        padding: 1.5rem 1rem;
    }

    .forecast-icon {
        font-size: 2rem;
    }

    .additional-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-card {
        padding: 1.2rem;
        gap: 1rem;
    }

    .info-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .info-label {
        font-size: 0.8rem;
    }

    .info-value {
        font-size: 1rem;
    }

    .hourly-scroll {
        gap: 0.6rem;
        padding-bottom: 0.8rem;
    }

    .hourly-item {
        min-width: 90px;
        padding: 0.8rem 0.5rem;
    }

    .hourly-time {
        font-size: 0.8rem;
    }

    .hourly-icon {
        font-size: 1.5rem;
    }

    .hourly-temp {
        font-size: 1rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    text-align: left;
    margin-left: 10px;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}