html, body {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    background: #f0f4f8;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Emoji support – use system fonts for proper rendering */
body, button, input, select, textarea, .overlay-activity, .stat-cell {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
}

/* Make sure emojis render consistently */
[style*="emoji"], .stat-emoji, .overlay-activity {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif !important;
}

h1:focus { outline: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Error UI */
#blazor-error-ui {
    background: #fef3c7;
    color: #92400e;
    bottom: 0;
    box-shadow: 0 -1px 8px rgba(0,0,0,0.1);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Loading */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem;
}
.loading-progress circle {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: #6366f1;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    color: #475569;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* Card */
.weather-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    padding: 1rem;
    border: 1px solid #f1f5f9;
}

/* Stat cell (2x2 grid inside stats card) */
.stat-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
}
.stat-cell:nth-child(2n) { border-right: none; }
.stat-cell:nth-child(n+3) { border-bottom: none; }
.stat-emoji { font-size: 1.2rem; margin-bottom: 0.15rem; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif; }
.stat-value { font-size: 0.95rem; font-weight: 700; color: #1e293b; }
.stat-label { font-size: 0.58rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 1px; }

/* Bar animation */
.weather-bar {
    border-radius: 6px 6px 0 0;
    transition: height 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* Tab buttons */
.tab-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
    border-radius: 8px;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.tab-btn:hover { background: #f1f5f9; color: #475569; }
.tab-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

/* Google-style chart tabs */
.chart-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #94a3b8;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-bottom: -2px;
}
.chart-tab:hover { color: #475569; }
.chart-tab.active {
    color: #1e293b;
    border-bottom-color: #f59e0b;
    font-weight: 600;
}

/* Day pill buttons */
.day-pill {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.45rem 0.4rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 0;
}
.day-pill:hover {
    border-color: #a5b4fc;
    background: #f5f3ff;
    transform: translateY(-2px);
}
.day-pill.selected {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,0.25);
    transform: translateY(-2px);
}
.day-pill .day-label { color: #475569; }
.day-pill .day-high { color: #1e293b; }
.day-pill .day-low { color: #94a3b8; }
.day-pill.selected .day-label,
.day-pill.selected .day-high,
.day-pill.selected .day-low {
    color: #fff !important;
}

/* Hourly scroll */
.hourly-scroll {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-behavior: smooth;
}
.hourly-scroll > div {
    flex: 0 0 48px;
}

/* Fade in */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease forwards; }
.fade-in-d1 { animation: fadeIn 0.4s 0.05s ease forwards; opacity: 0; }
.fade-in-d2 { animation: fadeIn 0.4s 0.1s ease forwards; opacity: 0; }
.fade-in-d3 { animation: fadeIn 0.4s 0.15s ease forwards; opacity: 0; }

/* ======= Planner / MyDay ======= */

/* MyDay subtle link next to tabs */
.myday-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6366f1;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    margin-bottom: -2px;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
}
.myday-link:hover { background: #f5f3ff; }
.myday-count {
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
}

/* Overlay backdrop */
.overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.2s ease;
}
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Overlay panel */
.overlay-panel {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.08);
    padding: 1.5rem 1.75rem;
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.overlay-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}
.overlay-close:hover { background: #f1f5f9; color: #475569; }

.overlay-activity {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    border: 1px solid #f1f5f9;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
}

/* Location autocomplete dropdown */
.location-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 50;
    overflow: hidden;
}
.location-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.15s;
}
.location-option:hover { background: #f5f3ff; }

/* Date chip (planner date nav) */
.date-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}
.date-chip:hover { background: #f1f5f9; }
.date-chip.today { color: #6366f1; font-weight: 700; }
.date-chip.selected {
    background: #6366f1;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

/* Nav arrows */
.nav-arrow {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    font-family: inherit;
}
.nav-arrow:hover { background: #f1f5f9; color: #475569; }

/* Add activity button */
.add-btn {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.65rem 1.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}
.add-btn:hover {
    box-shadow: 0 4px 16px rgba(99,102,241,0.35);
    transform: translateY(-1px);
}

/* Form inputs */
.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color 0.2s;
    outline: none;
}
.form-input:focus { border-color: #6366f1; background: #fff; }
.form-input::placeholder { color: #cbd5e1; }

/* Checkbox toggle label */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #475569;
    cursor: pointer;
}
.toggle-label input[type="checkbox"] {
    accent-color: #6366f1;
    width: 16px;
    height: 16px;
}
