:root {
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent: #4cc9f0;
    --accent-hover: #4895ef;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius: 16px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    transition: background 0.5s ease;
}

.app-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    white-space: nowrap;
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
}

#cityInput {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

#cityInput:focus {
    border-color: var(--accent);
}

#searchBtn {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

#searchBtn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10001;
    display: none;
}

.search-results.active {
    display: block;
}

.search-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

          #unitsBtn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 50px;
}

#unitsBtn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

#unitsBtn.active {
    background: rgba(76, 201, 240, 0.2);
    color: var(--accent);
    border-color: var(--accent);
}

#geoBtn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
}

#geoBtn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.weather-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.4s ease;
}

.hidden {
    display: none !important;
}

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

.current-weather {
    padding: 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.location-info {
    flex: 1;
    min-width: 200px;
}

#cityName {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

#dateInfo {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.condition {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 500;
}

.temp-display {
    display: flex;
    align-items: center;
    gap: 16px;
}

.weather-icon {
    font-size: 3.5rem;
    line-height: 1;
}

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

#tempValue {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.unit {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 8px;
}

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

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
    grid-column: 1 / -1;
}

.detail {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

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

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

.hourly-forecast, .daily-forecast {
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hourly-forecast h2, .daily-forecast h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.hourly-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}

.hourly-item {
    min-width: 70px;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

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

.hourly-item .temp {
    font-weight: 600;
    font-size: 0.95rem;
}

.daily-grid {
    display: grid;
    gap: 12px;
}

.daily-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 14px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
}

.daily-left {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
}

.daily-icon {
    font-size: 1.8rem;
}

.daily-info .date {
    font-weight: 500;
    margin-bottom: 4px;
}

.daily-stats {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.daily-temp {
    text-align: right;
}

.daily-temp .high {
    font-weight: 600;
    font-size: 1.1rem;
}

.daily-temp .low {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error-box {
    background: rgba(255, 80, 80, 0.15);
    border: 1px solid rgba(255, 80, 80, 0.3);
    padding: 16px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.error-box button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

        .error-box button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Wind Profile Section */
.wind-profile {
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.wind-profile h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.wind-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.wind-alt-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.wind-alt-card .altitude {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.wind-alt-card .speed {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    flex: 1;
}

.wind-alt-card .speed .unit {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.7;
}

.wind-alt-card .direction {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.wind-alt-card .gust {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

@media (max-width: 600px) {
    body { padding: 12px; }
    .header { flex-wrap: wrap; }
    .search-box { order: 3; width: 100%; }
    .weather-details { grid-template-columns: repeat(2, 1fr); }
    #cityName { font-size: 1.5rem; }
    #tempValue { font-size: 2.8rem; }
}
