/* Weather Page Styles */

[class*="weather-gradient-"] {
    color: #fff;
}

[class*="weather-gradient-"] .text-white {
    color: #fff !important;
}

.weather-page {
    min-height: 100vh;
}

/* Loading Skeleton */
.weather-loading .skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-lg);
}

.dark .weather-loading .skeleton {
    background: linear-gradient(90deg, var(--gray-800) 25%, var(--gray-700) 50%, var(--gray-800) 75%);
    background-size: 200% 100%;
}

.skeleton-current-weather { height: 400px; margin-bottom: 2rem; }
.skeleton-tabs { height: 48px; width: 50%; margin-bottom: 1rem; }
.skeleton-card { height: 96px; }
.skeleton-row { height: 80px; }

/* Current Weather */
.current-weather-section { position: relative; }

.current-weather-card {
    border-radius: var(--radius-2xl);
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.current-weather-inner {
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.current-weather-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .current-weather-layout {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.current-weather-info {
    flex-grow: 1;
}

.current-location-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
    .current-location-name { font-size: 1.875rem; }
}

.current-date {
    font-size: 1.125rem;
    opacity: 0.9;
    color: white;
    margin-bottom: 1rem;
}

.current-temp-row {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.current-weather-icon {
    margin-right: 1rem;
    animation: pulse-slow 3s infinite;
}

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

.temp-value {
    font-size: clamp(3rem, 8vw, 4.5rem);
    font-weight: 200;
    line-height: 1;
    color: white;
    letter-spacing: -0.02em;
}

.temp-unit {
    font-size: 1.5rem;
    margin-top: 0.25rem;
    color: white;
}

.current-description {
    font-size: 1.125rem;
    text-transform: capitalize;
    color: white;
}

.current-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: white;
}

.current-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-stat svg { opacity: 0.9; }

/* Highlight Boxes */
.highlight-boxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1.5rem;
    width: 66%;
}

@media (max-width: 767px) {
    .highlight-boxes { width: 100%; }
}

.highlight-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-expo), border-color 0.3s;
    position: relative;
}

.highlight-box:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.highlight-info-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0.7;
    color: white;
}

.highlight-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.highlight-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
}

.highlight-dot-green { background: var(--green-500); }
.highlight-dot-yellow { background: var(--yellow-500); }
.highlight-dot-orange { background: var(--orange-500); }
.highlight-dot-red { background: var(--red-500); }

.highlight-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.8;
    color: white;
}

.highlight-value {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
    margin-top: 0.25rem;
    color: white;
}

.highlight-number {
    font-size: 1.125rem;
    font-weight: 500;
}

.highlight-text {
    font-size: 0.75rem;
}

/* Wizard Panel */
.current-weather-wizard {
    width: 100%;
}

@media (min-width: 768px) {
    .current-weather-wizard { width: auto; }
}

.wizard-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: center;
}

.wizard-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.wizard-character {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.wizard-ask-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(to right, var(--purple-500), var(--blue-500));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    animation: pulse 2s infinite;
}

.wizard-ask-btn:hover {
    background: linear-gradient(to right, var(--purple-600), var(--blue-600));
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
    animation: none;
}

/* ====== Wizard Chat Modal ====== */
.wizard-chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fade-in 0.2s ease-out;
}

.wizard-chat-modal {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg, 1rem);
    box-shadow: 0 25px 60px rgba(0,0,0,0.3), 0 8px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 440px;
    max-height: min(600px, 80vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: wizard-chat-enter 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes wizard-chat-enter {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.wizard-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    flex-shrink: 0;
}

.wizard-chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wizard-chat-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wizard-chat-avatar .wwb-root {
    transform: scale(0.35);
    transform-origin: center center;
}

.wizard-chat-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    line-height: 1.2;
}

.wizard-chat-status {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.wizard-chat-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.wizard-chat-close:hover {
    background: hsl(var(--accent));
    color: hsl(var(--foreground));
}

/* Messages Area */
.wizard-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 200px;
    background: hsl(var(--background));
}

.wizard-chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg, 1rem);
    font-size: 0.875rem;
    line-height: 1.6;
    animation: wizard-msg-in 0.25s ease-out;
}

@keyframes wizard-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.wizard-chat-bubble p {
    margin: 0;
}

.wizard-chat-bubble-bot {
    align-self: flex-start;
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
    border-bottom-left-radius: 4px;
}

.wizard-chat-bubble-user {
    align-self: flex-end;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-bottom-right-radius: 4px;
}

.wizard-chat-bubble-loading {
    align-self: flex-start;
    background: hsl(var(--muted));
    padding: 0.75rem 1.25rem;
    border-bottom-left-radius: 4px;
}

.wizard-chat-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.wizard-chat-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: hsl(var(--muted-foreground));
    opacity: 0.5;
    animation: wizard-dot-bounce 1.4s infinite;
}
.wizard-chat-dots span:nth-child(2) { animation-delay: 0.2s; }
.wizard-chat-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wizard-dot-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Input Area */
.wizard-chat-input-area {
    padding: 0.75rem 1rem;
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    flex-shrink: 0;
}

.wizard-chat-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-chat-input {
    flex: 1;
    height: 2.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: 9999px;
    padding: 0 1rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wizard-chat-input:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.12);
}

.wizard-chat-input::placeholder {
    color: hsl(var(--muted-foreground));
}

.wizard-chat-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}

.wizard-chat-send:hover {
    filter: brightness(1.1);
}

.wizard-chat-send:active {
    transform: scale(0.92);
}

/* Wizard response (kept for JS compatibility) */
.wizard-response {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 639px) {
    .wizard-chat-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .wizard-chat-modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: var(--radius-lg, 1rem) var(--radius-lg, 1rem) 0 0;
        animation: slide-up-sheet 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    }

    @keyframes slide-up-sheet {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}

/* Weather Timeline */
.section-title-sm {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.dark .section-title-sm { color: white; }

.section-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.weather-timeline-container {
    position: relative;
    overflow: hidden;
}

.timeline-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem 0;
    gap: 0.5rem;
    scrollbar-width: none;
}

.timeline-scroll::-webkit-scrollbar { display: none; }

.timeline-item {
    flex: 0 0 auto;
    min-width: 120px;
    scroll-snap-align: center;
    padding: 1rem;
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    background: white;
    position: relative;
    border: 1px solid transparent;
    box-shadow: var(--shadow-card);
}

.dark .timeline-item {
    background: var(--gray-800);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.timeline-item:hover {
    background: var(--blue-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.dark .timeline-item:hover {
    background: var(--gray-700);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.timeline-item.active {
    background: var(--blue-100);
    border-color: hsl(var(--primary) / 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: scale(1.08) translateY(-4px);
    z-index: 10;
}

.dark .timeline-item.active {
    background: var(--blue-900);
    border-color: hsl(var(--primary) / 0.4);
}

.timeline-now-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--blue-500);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.timeline-day {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.dark .timeline-day { color: var(--gray-300); }

.timeline-time {
    font-size: 0.875rem;
    font-weight: 700;
}

.dark .timeline-time { color: white; }

.timeline-icon {
    margin: 0.5rem auto;
    display: flex;
    justify-content: center;
}

.timeline-temp {
    font-size: 1.5rem;
    font-weight: 700;
}

.dark .timeline-temp { color: white; }

.timeline-feels {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.timeline-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.75rem;
}

.dark .timeline-stats { color: var(--gray-400); }

.timeline-precip {
    font-size: 0.75rem;
    color: var(--blue-600);
    margin-top: 0.5rem;
}

.dark .timeline-precip { color: var(--blue-400); }

.timeline-details-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.timeline-details-btn:hover { color: var(--blue-500); }

.timeline-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark .timeline-nav {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--gray-700);
}

.timeline-nav-prev { left: 0; }
.timeline-nav-next { right: 0; }

/* Tabs */
.weather-tabs { margin-top: 2rem; }

.tabs-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    margin-bottom: 1rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 0.25rem;
}

.dark .tabs-list { background: var(--gray-800); }

.tab-trigger {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: calc(var(--radius) - 2px);
    color: var(--gray-600);
    transition: all 0.2s;
    white-space: nowrap;
}

.dark .tab-trigger { color: var(--gray-400); }

.tab-trigger:hover { color: var(--gray-900); }
.dark .tab-trigger:hover { color: white; }

.tab-trigger.active {
    background: white;
    color: var(--gray-900);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .tab-trigger.active {
    background: var(--gray-700);
    color: white;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Daily Forecast */
.daily-forecast-grid { display: grid; gap: 1rem; }

.daily-forecast-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
    border: 2px solid transparent;
}

.dark .daily-forecast-item {
    background: var(--gray-800);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.daily-forecast-item:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px) scale(1.01);
}

.daily-forecast-item.best-day { border-color: var(--green-500); }
.daily-forecast-item.worst-day { border-color: var(--red-500); }

.daily-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.daily-badge svg {
    width: 1rem;
    height: 1rem;
}

.daily-badge-best { color: var(--green-500); }
.daily-badge-worst { color: var(--red-500); }

/* Desktop daily forecast row */
.daily-desktop {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 640px) {
    .daily-desktop { display: flex; }
    .daily-mobile { display: none; }
}

.daily-day-col { width: 6rem; }
.daily-day-col p:first-child { font-weight: 500; }
.daily-day-col p:last-child { font-size: 0.875rem; color: var(--gray-500); }

.daily-weather-col {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.daily-weather-desc {
    font-size: 0.875rem;
    display: none;
}

@media (min-width: 768px) {
    .daily-weather-desc { display: inline; }
}

.daily-precip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.daily-precip svg { color: var(--blue-400); }

.daily-uv {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.daily-uv svg { color: var(--yellow-500); }

.daily-temp-col {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.daily-temp-max { font-weight: 500; }
.daily-temp-min { color: var(--gray-500); }

.temp-range-bar {
    width: 5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: linear-gradient(to right, var(--blue-100), var(--red-100));
    overflow: hidden;
}

.dark .temp-range-bar {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.2), rgba(239, 68, 68, 0.2));
}

.temp-range-fill {
    background: linear-gradient(to right, var(--blue-400), var(--yellow-400), var(--red-400));
    border-radius: 2px;
    height: 100%;
    min-width: 4px;
}

/* Mobile daily forecast */
.daily-mobile { display: block; }

.daily-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.daily-mobile-weather {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--gray-100);
    padding-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.dark .daily-mobile-weather { border-color: var(--gray-700); }

.daily-mobile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
    padding-bottom: 0.5rem;
}

.dark .daily-mobile-stats { border-color: var(--gray-700); }

.daily-mobile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
}

.daily-mobile-stat svg {
    margin-bottom: 0.25rem;
}

.daily-mobile-range {
    margin-top: 0.5rem;
}

.daily-mobile-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.daily-mobile-range-bar {
    width: 100%;
    height: 0.75rem;
    border-radius: 9999px;
    background: linear-gradient(to right, var(--blue-100), var(--red-100));
    overflow: hidden;
}

.dark .daily-mobile-range-bar {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.2), rgba(239, 68, 68, 0.2));
}

/* Saved Locations */
.saved-locations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

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

.saved-location-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
}

.dark .saved-location-card {
    background: var(--gray-800);
}

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

.saved-location-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
}

.saved-location-delete:hover { color: var(--red-500); }

/* Responsive tab text */
@media (max-width: 639px) {
    .tab-trigger {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
}
