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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    background: #000;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    overflow: hidden;
    color: #fff;
}

.container {
    width: 100%;
    height: 100vh;
    animation: fadeIn 0.5s ease-in;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    flex-shrink: 0;
}

header h1 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.subtitle {
    font-size: 0.75rem;
    opacity: 0.5;
    font-weight: 400;
}

/* Persistent Search Bar */
.search-bar {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 6px;
    margin: 0 auto 20px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 500px;
}

.search-bar .city-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    color: #fff;
    font-weight: 500;
}

.search-bar .city-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-bar .city-input:focus {
    background: rgba(255, 255, 255, 0.05);
}

.search-bar .search-btn {
    padding: 12px 20px;
    font-size: 0.85rem;
}

.location-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.location-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Loading State */
.loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Error State */
.error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.error-message {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.city-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.city-input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.city-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.search-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 600;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.retry-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.retry-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.hidden {
    display: none !important;
}

#weather-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Current Weather Section */
.current-weather {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: slideUp 0.5s ease-out;
    text-align: center;
}

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

.location h2 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 30px;
    font-weight: 700;
    letter-spacing: 1px;
}

.location p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-top: 8px;
    font-weight: 500;
}

.weather-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.temperature {
    display: flex;
    align-items: baseline;
    margin: -10px 0 20px;
}

.temp-value {
    font-size: 10rem;
    font-weight: 200;
    color: #fff;
    line-height: 0.85;
    letter-spacing: -8px;
}

.temp-unit {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 8px;
    font-weight: 300;
}

.weather-icon img {
    width: 100px;
    height: 100px;
    margin-bottom: -10px;
}

.weather-description {
    text-align: center;
    margin: 20px 0;
}

.weather-description p {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
}

.weather-details {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.detail-item {
    text-align: center;
    transition: all 0.2s ease;
}

.detail-item:hover {
    transform: scale(1.05);
}

.detail-label {
    display: block;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.detail-value {
    display: block;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Forecast Section */
.forecast {
    animation: slideUp 0.5s ease-out 0.1s both;
    flex-shrink: 0;
    padding: 20px 0 30px;
}

.forecast h3 {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    text-align: center;
}

.forecast-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 5px 10px;
}

.forecast-container::-webkit-scrollbar {
    display: none;
}

.forecast-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 14px 8px;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 90px;
    width: 90px;
    height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}

.forecast-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.forecast-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    width: 100%;
    word-wrap: break-word;
    line-height: 1.2;
}

.forecast-icon {
    flex-shrink: 0;
    margin: 4px 0;
}

.forecast-icon img {
    width: 40px;
    height: 40px;
    display: block;
}

.forecast-temp {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    flex-shrink: 0;
}

.forecast-desc {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.2;
    width: 100%;
    margin: 0;
    padding: 0 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .temp-value {
        font-size: 8rem;
        letter-spacing: -6px;
    }

    .weather-description p {
        font-size: 1.5rem;
        letter-spacing: 1.5px;
    }

    .weather-details {
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

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

    header h1 {
        font-size: 1rem;
    }

    .temp-value {
        font-size: 6rem;
        letter-spacing: -5px;
    }

    .temp-unit {
        font-size: 2rem;
    }

    .location h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

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

    .weather-description p {
        font-size: 1.3rem;
        letter-spacing: 1px;
    }

    .weather-details {
        gap: 25px;
    }

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

    .forecast-container {
        gap: 10px;
        justify-content: flex-start;
    }

    .forecast-card {
        min-width: 85px;
        width: 85px;
        height: 165px;
        padding: 12px 8px;
    }

    .forecast-date {
        font-size: 0.62rem;
    }

    .forecast-desc {
        font-size: 0.56rem;
    }
}

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

    header h1 {
        font-size: 0.9rem;
    }

    .subtitle {
        font-size: 0.65rem;
    }

    .temp-value {
        font-size: 5rem;
        letter-spacing: -4px;
    }

    .temp-unit {
        font-size: 1.5rem;
    }

    .location h2 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .weather-icon img {
        width: 70px;
        height: 70px;
    }

    .weather-description p {
        font-size: 1.1rem;
        letter-spacing: 0.5px;
    }

    .weather-details {
        gap: 20px;
    }

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

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

    .forecast-card {
        min-width: 75px;
        width: 75px;
        height: 155px;
        padding: 12px 6px;
    }

    .forecast-date {
        font-size: 0.6rem;
    }

    .forecast-temp {
        font-size: 1.1rem;
    }

    .forecast-icon img {
        width: 35px;
        height: 35px;
    }

    .forecast-desc {
        font-size: 0.54rem;
    }
}
