/* Hourly Graph Styles */

/* Tab Container */
.hourly-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid rgba(148, 163, 184, 0.3);
}

.hourly-tab {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: rgba(100, 116, 139, 0.8);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hourly-tab:hover {
    color: rgba(56, 189, 248, 0.9);
    background: rgba(56, 189, 248, 0.05);
}

.hourly-tab.active {
    color: #38bdf8;
    border-bottom-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}

.hourly-tab svg {
    width: 1rem;
    height: 1rem;
}

.dark-theme .hourly-tab {
    color: rgba(203, 213, 225, 0.7);
}

.dark-theme .hourly-tab:hover {
    color: rgba(56, 189, 248, 0.9);
}

.dark-theme .hourly-tab.active {
    color: #38bdf8;
}

/* Tab Content */
.hourly-tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hourly-tab-content.active {
    display: block;
    opacity: 1;
}

/* Graph Scroll Wrapper (enables horizontal scroll on mobile) */
.hourly-graph-scroll-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
    margin-top: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.hourly-graph-scroll-wrapper::-webkit-scrollbar {
    height: 6px;
}

.hourly-graph-scroll-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.hourly-graph-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 3px;
}

/* Scroll hint indicator */
.scroll-hint {
    display: none;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(56, 189, 248, 0.15);
    /* No backdrop-filter: this element also runs an infinite pulse animation, so the
       blur was being recomputed every frame, permanently, on every mobile visit. */
    border-radius: 1rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.6875rem;
    color: rgba(56, 189, 248, 0.9);
    pointer-events: none;
    z-index: 10;
    animation: scrollHintPulse 2s ease-in-out infinite;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.scroll-hint svg {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes scrollHintPulse {
    0%, 100% { opacity: 0.7; transform: translateY(-50%) translateX(0); }
    50% { opacity: 1; transform: translateY(-50%) translateX(3px); }
}

.scroll-hint.hidden {
    display: none !important;
}

/* Graph Container */
#hourly-graph-container {
    position: relative;
    width: 100%;
    height: 340px;
    overflow: hidden;
}

#hourly-graph-svg {
    width: 100%;
    height: 100%;
}

/* Sun Arc */
.sun-arc {
    fill: none;
    stroke: url(#sunGradient);
    stroke-width: 3;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

/* Moon Arc */
.moon-arc {
    fill: none;
    stroke: url(#moonGradient);
    stroke-width: 2.5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(148, 163, 184, 0.4));
}

/* Horizon Line */
.horizon-line {
    stroke: rgba(100, 116, 139, 0.5);
    stroke-width: 1.5;
    stroke-dasharray: 6, 4;
}

/* Sky Background */
.sky-background {
    pointer-events: none;
}

.sky-column {
    transition: fill 0.3s ease;
}

.ground-area {
    pointer-events: none;
}

.dark-theme .ground-area {
    fill: rgba(30, 41, 59, 0.7);
}

/* Time Markers */
.time-marker {
    font-size: 11px;
    fill: rgba(100, 116, 139, 0.8);
    text-anchor: middle;
    font-family: 'Inter', sans-serif;
}

.dark-theme .time-marker {
    fill: rgba(203, 213, 225, 0.7);
}

/* Temperature Band */
.temp-band {
    opacity: 0.7;
}

/* Temperature Line */
.temp-line {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
    stroke-linejoin: round;
}

/* Temperature Labels */
.temp-label {
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-anchor: middle;
}

.temp-label.high {
    fill: #f97316;
}

.temp-label.low {
    fill: #3b82f6;
}

.temp-label.current {
    fill: #22c55e;
}

/* Temperature Value Labels */
.temp-value-label {
    font-size: 12px;
    font-weight: bold;
    fill: #334155;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.dark-theme .temp-value-label {
    fill: #e2e8f0;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
}

/* Temperature Dots */
.temp-dot {
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* Temperature Grid Lines */
.temp-grid-line {
    pointer-events: none;
}

/* Sunrise/Sunset Labels */
.celestial-label {
    font-size: 10px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    fill: rgba(251, 191, 36, 0.9);
}

.celestial-label.moon {
    fill: rgba(148, 163, 184, 0.8);
}

/* Precipitation Bars */
.precip-bar {
    fill: rgba(59, 130, 246, 0.3);
    transition: fill 0.2s ease;
}

.precip-bar:hover {
    fill: rgba(59, 130, 246, 0.5);
}

/* Weather Icons in Graph */
.weather-icon-group {
    pointer-events: none;
}

.weather-icon-group .cloud-shape {
    transition: opacity 0.2s ease;
}

.weather-icon-group:hover .cloud-shape {
    opacity: 0.85;
}

/* Cloud SVG */
.cloud-shape {
    fill: rgba(180, 190, 205, 0.85);
    filter: blur(3px) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.dark-theme .cloud-shape {
    fill: rgba(140, 155, 175, 0.7);
    filter: blur(3px) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* Rain Drops */
@keyframes rainFall {
    0% {
        transform: translateY(-10px);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translateY(30px);
        opacity: 0;
    }
}

.rain-drop {
    fill: #60a5fa;
    animation: rainFall 0.8s linear infinite;
}

.rain-drop:nth-child(2n) {
    animation-delay: 0.2s;
}

.rain-drop:nth-child(3n) {
    animation-delay: 0.4s;
}

/* Snow Flakes */
@keyframes snowFall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translateY(30px) rotate(180deg);
        opacity: 0;
    }
}

.snow-flake {
    fill: #e0f2fe;
    animation: snowFall 1.5s linear infinite;
}

.snow-flake:nth-child(2n) {
    animation-delay: 0.3s;
}

.snow-flake:nth-child(3n) {
    animation-delay: 0.6s;
}

/* Hover Indicator */
.hover-indicator {
    display: none;
    position: absolute;
    pointer-events: none;
}

.hover-indicator.visible {
    display: block;
}

.hover-line {
    stroke: rgba(56, 189, 248, 0.6);
    stroke-width: 1;
    stroke-dasharray: 4, 3;
}

/* Tooltip */
.graph-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    font-size: 0.8125rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 99999;
    min-width: 160px;
    backdrop-filter: blur(8px);
    will-change: transform;
}

.graph-tooltip.visible {
    opacity: 1;
}

.tooltip-anim-wrapper {
    transition: transform 0.15s ease;
    transform: translateY(5px);
}

.graph-tooltip.visible .tooltip-anim-wrapper {
    transform: translateY(0);
}

.dark-theme .graph-tooltip {
    background: rgba(51, 65, 85, 0.95);
    color: #e2e8f0;
}

.tooltip-time {
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 0.375rem;
    color: #0f172a;
}

.dark-theme .tooltip-time {
    color: #f1f5f9;
}

.tooltip-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.tooltip-temp {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ea580c;
}

.tooltip-condition {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.dark-theme .tooltip-condition {
    color: #94a3b8;
}

.tooltip-details {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 0.75rem;
    font-size: 0.6875rem;
}

.tooltip-detail-label {
    color: #94a3b8;
}

.tooltip-detail-value {
    font-weight: 500;
    text-align: right;
}

/* Info Labels (High/Low, Sunrise/Sunset) */
.info-label-group {
    pointer-events: none;
}

.info-label-bg {
    fill: rgba(255, 255, 255, 0.9);
    rx: 4;
}

.dark-theme .info-label-bg {
    fill: rgba(51, 65, 85, 0.9);
}

.info-label-text {
    font-size: 10px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

/* Current Time Indicator */
.current-time-line {
    stroke: #22c55e;
    stroke-width: 2;
    stroke-dasharray: none;
}

.current-time-dot {
    fill: #22c55e;
    filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.6));
}

/* Responsive */
@media (max-width: 640px) {
    .scroll-hint {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    #hourly-graph-container {
        height: 280px;
        min-width: 900px;
        touch-action: pan-x;
    }

    .hourly-tab {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .time-marker {
        font-size: 10px;
    }

    .temp-label {
        font-size: 10px;
    }

    .temp-value-label {
        font-size: 11px;
    }

    .graph-tooltip {
        font-size: 0.75rem;
        min-width: 140px;
    }
}