:root {
    --bg-main: linear-gradient(180deg, #2a3c63 0%, #585975 40%, #9f797b 100%);
    --card-bg: rgba(255, 255, 255, 0.15);
    --card-bg-secondary: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-blue: #ffffff;
    --accent-blue-hover: rgba(255, 255, 255, 0.8);
    --border-color: rgba(255, 255, 255, 0.15);
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.1);
}

/* Dark Theme overrides (midnight iOS style) */
body.dark-theme {
    --bg-main: linear-gradient(180deg, #0b101e 0%, #1a1b35 40%, #291b2c 100%);
    --card-bg: rgba(0, 0, 0, 0.3);
    --card-bg-secondary: rgba(0, 0, 0, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: var(--bg-main);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Remove dynamic background interference for a clean professional look */
.bg-animation {
    display: none;
}

/* Main Container - Apple Maps Style Card */
.app-container {
    background: transparent;
    border-radius: 24px;
    padding: 2rem;
    width: 90%;
    max-width: 420px;
    box-shadow: none;
    border: none;
    transform: translateY(10px);
    opacity: 0;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Header & Search */
.search-section {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    justify-content: center;
}



.search-box {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 0.6rem 0.6rem 0.6rem 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--border-color);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1), 0 8px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--accent-blue);
    font-size: 1.3rem;
    margin-right: 0.6rem;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 1.15rem;
    font-weight: 500;
}

.search-box input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.search-box .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    margin-left: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    transition: all 0.3s ease;
}

.search-box .icon-btn:hover {
    transform: scale(1.05) rotate(15deg);
    background: rgba(255, 255, 255, 0.3);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid var(--border-color);
    outline: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.4rem;
    transition: all 0.2s ease;
    box-shadow: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.02);
}

.icon-btn:active {
    transform: scale(0.96);
}

.location-btn {
    background: var(--card-bg-secondary);
    color: white;
    box-shadow: none;
}

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

/* Status Message */
.status-message {
    text-align: center;
    padding: 1rem;
    background: var(--card-bg-secondary);
    border-radius: 12px;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

.status-message.hidden {
    display: none;
}

.status-message p {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Weather Content */
.weather-content {
    transition: opacity 0.4s ease;
}

.weather-content.hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.current-weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

.city-name {
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 0;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.temperature {
    font-size: 6rem;
    font-weight: 200;
    line-height: 1;
    display: flex;
    align-items: flex-start;
    margin-bottom: 0;
    margin-top: 0;
    color: var(--text-primary);
    text-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.temperature .unit {
    font-size: 4rem;
    font-weight: 200;
    margin-top: 0.5rem;
    color: var(--text-primary);
}

.weather-desc {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-primary);
    text-transform: capitalize;
    margin-bottom: 0.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.high-low {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* AI Summary Card */
.ai-summary-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 1rem;
    margin-top: 1.5rem;
    width: 100%;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    text-align: left;
}

.ai-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
}

.ai-header i {
    color: #ffd60a; /* Sparkle color */
}

.ai-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-primary);
}

/* Weather Details Grid */
.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.detail-card {
    background: var(--card-bg-secondary);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
}

.detail-card:hover {
    background: rgba(255, 255, 255, 0.2);
}

.detail-icon {
    font-size: 1.4rem;
    color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.detail-info {
    display: flex;
    flex-direction: column;
}

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

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

/* Responsive */
@media (max-width: 400px) {
    .app-container {
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    .weather-details {
        grid-template-columns: 1fr;
    }
}

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

/* Forecast & Hourly Section */
.hourly-section, .forecast-section {
    margin-top: 1.5rem;
    background: var(--card-bg-secondary);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
}

.forecast-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.forecast-container {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
}

.forecast-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.forecast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    padding: 0.8rem 0.5rem;
    border-radius: 12px;
    flex: 1;
    min-width: 60px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.forecast-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.forecast-day {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.forecast-icon {
    font-size: 1.5rem;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 122, 255, 0.2));
}

.forecast-temp {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.forecast-temp-min {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Globe Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.globe-wrapper {
    position: relative;
    width: 90%;
    max-width: 600px;
    height: 70vh;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex; justify-content: center; align-items: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.4);
}

.globe-hint {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,1);
}

#globe-viz {
    width: 100%;
    height: 100%;
}
