/* City Forecast Widget Styles */
.city-forecast-container {
    background: linear-gradient(to bottom, #2b7bb5, #1e669e);
    color: #fff;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    position: relative;
}

.cf-loader-overlay {
    padding: 4rem 2rem;
    text-align: center;
    background: #1e669e;
}

.cf-spinner {
    border: 4px solid rgba(255,255,255,0.2);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: cf-spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes cf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cf-error-message {
    padding: 3rem;
    text-align: center;
    background: #c0392b;
    color: white;
}

.cf-top-section {
    padding: 2rem 2rem 1.5rem;
    position: relative;
    z-index: 2;
    /* Optional: add a faint cloud background image here if desired */
}

.cf-current {
    margin-bottom: 1rem;
}

.cf-temp-huge {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.cf-desc-large {
    font-size: 1.8rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.cf-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cf-badge {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* 7-Day Grid */
.cf-daily-grid {
    display: flex;
    background: #1a5682;
    border-top: 1px solid #144468;
    border-bottom: 1px solid #144468;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #236c9e transparent;
}
.cf-daily-grid::-webkit-scrollbar {
    height: 6px;
}
.cf-daily-grid::-webkit-scrollbar-thumb {
    background: #236c9e;
    border-radius: 3px;
}

.cf-day-col {
    flex: 1;
    text-align: center;
    padding: 1.2rem 0.5rem;
    border-right: 1px solid #236c9e;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}
.cf-day-col:last-child {
    border-right: none;
}

.cf-day-col:hover {
    background: #206191;
}

.cf-day-col.cf-active {
    background: #1e4b70;
}
.cf-day-col.cf-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #eab308; /* Yellow top border */
}

.cf-day-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.cf-day-icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.cf-day-temps {
    font-size: 1.05rem;
    font-weight: 600;
}

.cf-temp-min {
    color: #a3c2d1;
    margin-left: 0.4rem;
}

/* Hourly Slider Section */
.cf-hourly-section {
    background: #113f61;
    padding: 1rem 0;
}

.cf-hourly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem 0.5rem;
}

.cf-hourly-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.cf-hourly-nav {
    display: flex;
    gap: 0.5rem;
}

.cf-nav-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 0.5rem;
}
.cf-nav-btn:hover {
    opacity: 1;
}

.cf-hourly-slider-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1.5rem 0.5rem 1rem;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}
.cf-hourly-slider-wrap::-webkit-scrollbar {
    display: none; /* Hide scrollbar Safari/Chrome */
}

.cf-hourly-slider {
    display: flex;
    width: 100%;
}

.cf-hour-col {
    /* Desktop: 10 to 12 hours (10% = 10 items per view) */
    flex: 0 0 10%;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem; /* Compact spacing */
    border-right: 1px solid rgba(255,255,255,0.1);
    scroll-snap-align: start;
    padding: 0 0.25rem;
}
.cf-hour-col:focus-visible {
    outline: 2px solid #eab308;
    outline-offset: -2px;
    border-radius: 4px;
}

.cf-hour-col.cf-day-separator {
    border-right: 1px solid rgba(255,255,255,0.4);
    position: relative;
}

.cf-hour-time {
    font-weight: 700;
    font-size: 0.9rem;
}

.cf-hour-icon {
    font-size: 1.25rem; /* Smaller icons */
    line-height: 1;
}

.cf-hour-temp {
    font-weight: 600;
    font-size: 0.95rem;
}

.cf-hour-rain {
    font-size: 0.75rem;
    color: #a3c2d1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.cf-hour-rain::before {
    content: '💧';
    font-size: 0.6rem;
    opacity: 0.7;
}

.cf-hour-wind {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    gap: 0.1rem;
}

.cf-wind-arrow {
    font-size: 1rem;
    display: inline-block;
}

.cf-attribution {
    font-size: 0.75rem;
    text-align: right;
    padding: 0.5rem 1rem;
    background: #0d2f4a;
    color: #6a95b5;
}
.cf-attribution a {
    color: #8bbce0;
    text-decoration: none;
}
.cf-attribution a:hover {
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .cf-hour-col {
        /* Tablet: Show 6 to 8 hours (14.28% = 7 items) */
        flex: 0 0 14.28%;
    }
}

@media (max-width: 768px) {
    .cf-temp-huge { font-size: 3.5rem; }
    .cf-desc-large { font-size: 1.4rem; }
    .cf-daily-grid { overflow-x: auto; }
    .cf-day-col { min-width: 80px; }
    
    .cf-hour-col {
        /* Mobile: Show 4 to 5 hours (20% = 5 items) */
        flex: 0 0 20%;
    }
}
