/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1D4585;
    --primary-hover: #153268;
    --secondary-color: #4A9ED6;
    --secondary-hover: #2B7DB5;
    --accent-color: #F5C520;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #EFF6FF;
    --bg-gradient: linear-gradient(160deg, #EFF6FF 0%, #DBEAFE 60%, #EDE9FE 100%);
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #BFDBFE;
    --shadow: 0 1px 3px 0 rgba(29, 69, 133, 0.1), 0 1px 2px 0 rgba(29, 69, 133, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(29, 69, 133, 0.15), 0 4px 6px -2px rgba(29, 69, 133, 0.08);
    --input-bg: #ffffff;
}

[data-theme="dark"] {
    --primary-color: #4A9ED6;
    --primary-hover: #2B7DB5;
    --secondary-color: #60b4e8;
    --secondary-hover: #4A9ED6;
    --bg-color: #0f172a;
    --bg-gradient: linear-gradient(160deg, #0f172a 0%, #0d1f3c 60%, #1a1035 100%);
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --input-bg: #0f172a;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.dark-mode-toggle label {
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 3rem;
    height: 1.6rem;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 1rem;
    cursor: pointer;
    transition: background 0.25s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 1.2rem;
    height: 1.2rem;
    left: 0.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateY(-50%) translateX(1.4rem);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1rem;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.site-logo {
    height: 42px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.auth-logo {
    width: 80px;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    white-space: nowrap;
}

.subtitle {
    display: none;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow), inset 0 3px 0 var(--secondary-color);
    transition: background 0.3s, box-shadow 0.3s;
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.4rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-ghost {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background-color: var(--bg-color);
}

/* Disabled Button State */
.btn:disabled,
.btn.loading {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:disabled:hover,
.btn.loading:hover {
    transform: none;
    box-shadow: none;
}

/* Map Search Row */
.map-search-row {
    display: flex;
    gap: 0.5rem;
}

.map-search-row input {
    flex: 1;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.map-search-row input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Map container inside modal */
#modalMap {
    width: 100%;
    height: 350px;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    z-index: 0;
}

.coords-label {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Preferences Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.preferences-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preference-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preference-group > label {
    font-weight: 600;
    color: var(--text-primary);
}

/* Style Buttons */
.style-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.style-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-radius: 0.4rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.style-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.style-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Checkbox and Radio Groups */
.checkbox-group,
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.checkbox-label:hover,
.radio-label:hover {
    background-color: var(--bg-color);
}

.checkbox-label input,
.radio-label input {
    cursor: pointer;
    width: 1.125rem;
    height: 1.125rem;
}

/* Weather Display */
.weather-display {
    animation: fadeIn 0.5s ease-in;
}

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

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timestamp {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.generated-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.generated-text h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.weather-text {
    color: white;
    font-size: 1.125rem;
    line-height: 1.8;
}

.weather-details {
    margin-top: 1.5rem;
}

.details-panel {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 0.2rem;
}

.weather-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.weather-data-item {
    padding: 0.75rem;
    background-color: var(--card-bg);
    border-radius: 0.375rem;
}

.weather-data-item label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.weather-data-item span {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-spinner p {
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* Error Display */
.error-display {
    padding: 1.5rem;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 0.5rem;
    color: var(--error-color);
}

.error-display h3 {
    margin-bottom: 0.5rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

footer p {
    margin: 0.25rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1rem;
    }

    .container {
        padding: 1rem 0.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .style-buttons {
        flex-direction: column;
    }

    .style-btn {
        width: 100%;
    }

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

    .checkbox-group,
    .radio-group {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Accessibility */
button:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==================== Multi-Location Styles ==================== */

/* Location Cards Container */
.locations-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.no-locations {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Location Card */
.location-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    padding: 1.1rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}

.location-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.location-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.location-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.location-actions .btn {
    margin-top: 0;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: color 0.2s, transform 0.2s;
}

.btn-icon:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.location-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.location-details p {
    margin: 0.25rem 0;
}

/* Location Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content-wide {
    max-width: 720px;
}

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

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: var(--input-bg);
    color: var(--text-primary);
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Weather Dashboard */
.comparative-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    transition: background 0.3s;
}

[data-theme="dark"] .comparative-text {
    background: linear-gradient(135deg, rgba(29, 69, 133, 0.35) 0%, rgba(74, 158, 214, 0.2) 100%);
    border: 1px solid rgba(74, 158, 214, 0.2);
}

.comparative-text p {
    color: white;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

.empty-dashboard {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

/* Modern Weather Cards */
.dash-card {
    border-radius: 1.25rem;
    padding: 1.5rem;
    color: white;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dash-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -30px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}

.dash-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.35);
}

.dash-card:focus {
    outline: 2px solid rgba(255,255,255,0.6);
    outline-offset: 2px;
}

/* card gradient themes */
.dash-card.cond-clear   { background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #fda085 100%); }
.dash-card.cond-sunny   { background: linear-gradient(135deg, #fa8231 0%, #f7b731 100%); }
.dash-card.cond-cloud   { background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%); }
.dash-card.cond-rain    { background: linear-gradient(135deg, #373b44 0%, #4286f4 100%); }
.dash-card.cond-drizzle { background: linear-gradient(135deg, #4b6cb7 0%, #374a63 100%); }
.dash-card.cond-snow    { background: linear-gradient(135deg, #e0eafc 0%, #89c4e1 100%); color: #1a2a4a; }
.dash-card.cond-thunder { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #4a1942 100%); }
.dash-card.cond-fog     { background: linear-gradient(135deg, #5c677d 0%, #8d9db6 100%); }

.dc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.dc-location { flex: 1; min-width: 0; }

.dc-label {
    font-size: 1rem;
    font-weight: 700;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dc-city {
    font-size: 0.78rem;
    opacity: 0.7;
    display: block;
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dc-emoji {
    font-size: 2.75rem;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.dc-temp-row {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
}

.dc-temp {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
}

.dc-feels {
    font-size: 0.82rem;
    opacity: 0.7;
    padding-bottom: 0.55rem;
}

.dc-desc {
    font-size: 0.9rem;
    opacity: 0.85;
    text-transform: capitalize;
    margin-bottom: 1.1rem;
    min-height: 1.2em;
}

.dc-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    border-top: 1px solid rgba(255,255,255,0.18);
    padding-top: 0.9rem;
    margin-top: auto;
}

.dc-metric {
    display: grid;
    grid-template-columns: 5.5rem 1fr 3rem;
    align-items: center;
    gap: 0.5rem;
}

.dc-metric-icon {
    font-size: 0.9rem;
    margin-right: 0.2rem;
}

.dc-metric-label {
    font-size: 0.72rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dc-bar {
    height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
    overflow: hidden;
}

.dc-bar-fill {
    height: 100%;
    background: rgba(255,255,255,0.75);
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.dc-metric-val {
    font-size: 0.78rem;
    font-weight: 600;
    text-align: right;
}

.dc-wind-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    opacity: 0.8;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 0.6rem;
    margin-top: 0.3rem;
}

.dc-hint {
    font-size: 0.68rem;
    opacity: 0.45;
    text-align: right;
    margin-top: 0.6rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .locations-container {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dc-temp {
        font-size: 2.75rem;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .modal-content-wide {
        max-width: 95%;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }

    #modalMap {
        height: 260px;
    }

    .map-search-row {
        flex-direction: column;
    }

    .modal-content-detail {
        max-width: 98%;
        border-radius: 1rem;
    }

    .detail-hero {
        padding: 1.75rem 1.25rem 2rem;
        border-radius: 1rem 1rem 0 0;
    }

    .detail-hero-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .detail-hero-right {
        align-items: flex-start;
    }

    .detail-big-temp {
        font-size: 3.5rem;
        text-align: left;
    }

    .detail-big-emoji {
        font-size: 3rem;
        text-align: left;
    }

    .detail-body {
        padding: 1.25rem;
        border-radius: 0 0 1rem 1rem;
    }

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

/* ==================== Detail Modal ==================== */

.modal-content-detail {
    max-width: 860px;
    width: 94%;
    padding: 0;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    background: #0D1F3C;
    border-radius: 1.5rem;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.detail-close-btn {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.18);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.45rem 1rem;
    border-radius: 2rem;
    z-index: 1100;
    transition: background 0.15s;
    letter-spacing: 0.02em;
}

.detail-close-btn:hover {
    background: rgba(0,0,0,0.75);
}

/* Hero section */
.detail-hero {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    padding: 2.5rem 2rem 2.75rem;
    border-radius: 1.5rem 1.5rem 0 0;
    position: relative;
    overflow: hidden;
}

.detail-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -50px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}

.detail-hero::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}

/* Hero gradient themes — same condition classes as dash-card */
.detail-hero.cond-clear   { background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #fda085 100%); }
.detail-hero.cond-sunny   { background: linear-gradient(135deg, #fa8231 0%, #f7b731 100%); }
.detail-hero.cond-cloud   { background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%); }
.detail-hero.cond-rain    { background: linear-gradient(135deg, #373b44 0%, #4286f4 100%); }
.detail-hero.cond-drizzle { background: linear-gradient(135deg, #4b6cb7 0%, #374a63 100%); }
.detail-hero.cond-snow    { background: linear-gradient(135deg, #c9d6ff 0%, #e2e2e2 100%); }
.detail-hero.cond-thunder { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #4a1942 100%); }
.detail-hero.cond-fog     { background: linear-gradient(135deg, #5c677d 0%, #8d9db6 100%); }

.detail-hero-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 1;
}

.detail-hero-location h2 {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin: 0 0 0.3rem;
    text-shadow: 0 1px 8px rgba(0,0,0,0.2);
}

.detail-city {
    display: block;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
}

.detail-hero-desc {
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
    text-transform: capitalize;
    margin-top: 0.6rem;
}

.detail-hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.detail-big-emoji {
    font-size: 4rem;
    line-height: 1;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.3));
    display: block;
    text-align: right;
}

.detail-big-temp {
    font-size: 5rem;
    font-weight: 900;
    color: white;
    line-height: 1;
    display: block;
    text-align: right;
    text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

/* Detail body — dark section */
.detail-body {
    background: #0D1F3C;
    border-radius: 0 0 1.5rem 1.5rem;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* AI weather report */
.detail-ai-text {
    background: rgba(74,158,214,0.15);
    border: 1px solid rgba(74,158,214,0.3);
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
}

.song-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.song-card-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.2rem;
}

.song-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
}

.song-card-artist {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.detail-ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.detail-ai-text h4 {
    color: rgba(255,255,255,0.6);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
}

.tts-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.detail-ai-text p {
    color: rgba(255,255,255,0.88);
    font-size: 1rem;
    line-height: 1.75;
    margin: 0;
}

.detail-ai-text p:empty {
    min-height: 1.2em;
}

.detail-ai-text p[data-loading] {
    opacity: 0.5;
    font-style: italic;
}

/* Metric tiles */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.detail-metric {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    transition: background 0.15s;
}

.detail-metric:hover {
    background: rgba(255,255,255,0.08);
}

.dm-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.dm-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.35rem;
}

.dm-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
}

/* Map */
.detail-map-wrap {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

#detailMap {
    width: 100%;
    height: 240px;
}

.detail-loading {
    display: flex;
    justify-content: center;
    padding: 2rem;
}


/* Settings FAB */
.settings-fab {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 900;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Settings Overlay (backdrop) */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.settings-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Settings Drawer */
.settings-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 380px;
    max-width: 100vw;
    background: var(--card-bg);
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-drawer.open {
    transform: translateX(0);
}

.settings-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-drawer-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.settings-close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.15s, color 0.15s;
}

.settings-close-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Loading state — grey out all clickable elements */
main.is-loading .dash-card,
main.is-loading .location-card {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

main.is-loading button:disabled,
main.is-loading input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==================== Auth ==================== */

.auth-modal-content {
    max-width: 400px;
    width: 94%;
    padding: 2.5rem 2rem;
    border-radius: 1rem;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

#loginForm h3,
#registerForm h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.auth-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.auth-switch {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

/* ==================== User Bar ==================== */

.user-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0;
    flex-shrink: 0;
}

.user-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
