/**
 * Weather Tools Website - Main Stylesheet
 * Clean, responsive design for all pages
 */

/* ========== CSS Reset & Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
    letter-spacing: -0.01em;
    overflow-x: hidden;
    max-width: 100vw;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
    --shadow-hover: 0 4px 16px rgba(102, 126, 234, 0.15);
    --shadow-lg: 0 10px 20px -3px rgba(102, 126, 234, 0.12);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-dark);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.875rem;
    margin-bottom: 0.875rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    overflow-x: hidden;
}

/* Prevent any element from causing horizontal scroll */
img, 
table, 
pre, 
code,
iframe,
video,
.weather-card,
.ad-banner,
.info-grid,
.tips-grid,
.symptoms-grid,
.pollutants-grid {
    max-width: 100%;
}

img,
video,
iframe {
    height: auto;
}

/* Ensure long text doesn't overflow */
.weather-card,
.daily-item,
.hourly-item,
.highlight-card,
.info-card,
.table-row {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* ========== Header ========== */
.site-header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
    min-height: 60px;
}

.logo,
.main-nav,
.header-search {
    display: flex;
    align-items: center;
}

.logo {
    margin-top: 10px;
}

.logo a {
    text-decoration: none;
    color: var(--text-dark);
}

.logo h1 {
    font-family: 'Space Grotesk', 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.main-nav a:hover::after,
.main-nav .active a::after {
    width: 100%;
}

.main-nav .active a {
    color: var(--primary-color);
    font-weight: 600;
}

.header-search form {
    display: flex;
    gap: 0.5rem;
}

.header-search input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 200px;
}

.header-search button {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.header-search button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* ========== Main Content ========== */
.main-content {
    min-height: calc(100vh - 300px);
    padding: 2rem 0;
}

.breadcrumb {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--primary-color), var(--secondary-color)) 1;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header .subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 400;
}

/* ========== Dashboard Layout ========== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    max-width: 100%;
    overflow: hidden;
}

.main-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    overflow: hidden;
}

/* ========== Weather Cards ========== */
.weather-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.weather-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.weather-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.location-notice,
.location-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    margin-bottom: 10px;
}

.location-notice a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.location-notice a:hover {
    opacity: 0.85;
}

/* ========== Current Weather ========== */
.current-weather-main {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.weather-icon-large img {
    width: 120px;
    height: 120px;
}

.weather-temp-large .temp {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.weather-temp-large .condition {
    font-size: 1.5rem;
    color: var(--text-light);
    text-transform: capitalize;
}

.weather-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.detail-item .label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.detail-item .value {
    font-size: 1.25rem;
    font-weight: 600;
}

.sun-times {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 8px;
}

.sun-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.sun-item .icon {
    font-size: 2rem;
}

.sun-item .time {
    font-weight: 600;
    font-size: 1.1rem;
}

/* ========== Forecast Sections ========== */
.hourly-forecast-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.hourly-forecast-scroll::-webkit-scrollbar {
    height: 8px;
}

.hourly-forecast-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
    flex-shrink: 0;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.hourly-item img {
    width: 50px;
    height: 50px;
}

.hour-time {
    font-weight: 600;
}

.hour-temp {
    font-size: 1.1rem;
    font-weight: 600;
}

.hour-pop {
    font-size: 0.85rem;
    color: var(--primary-color);
}

.daily-forecast {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.daily-forecast::-webkit-scrollbar {
    height: 8px;
}

.daily-forecast::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.daily-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    flex-shrink: 0;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.daily-item:hover {
    transform: translateY(-2px);
    background: #f3f4f6;
}

.daily-item img {
    width: 60px;
    height: 60px;
}

.day-name {
    font-weight: 600;
    font-size: 1rem;
}

.day-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.day-condition {
    font-size: 0.9rem;
    color: var(--text-light);
}

.day-temps {
    display: flex;
    gap: 0.5rem;
    font-weight: 600;
}

.temp-max {
    color: var(--danger-color);
}

.temp-min {
    color: var(--primary-color);
}

/* ========== City Page Styles ========== */
.city-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.city-header h1 {
    margin-bottom: 0.5rem;
}

.weather-summary {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.last-updated {
    font-size: 0.9rem;
    opacity: 0.9;
}

.weather-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.highlight-content {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.highlight-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.highlight-icon {
    width: 100px;
    height: 100px;
}

.highlight-temp {
    font-size: 4rem;
    font-weight: 700;
}

.highlight-right h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.highlight-details p {
    margin-bottom: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.info-icon {
    font-size: 2rem;
}

.info-content {
    flex: 1;
}

.info-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ========== AQI Styles ========== */
.aqi-main-card {
    background: white;
}

.aqi-display {
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.aqi-number {
    font-size: 5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.aqi-category {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
}

.aqi-description {
    text-align: center;
    font-size: 1.1rem;
}

.aqi-scale h3 {
    margin-bottom: 1rem;
}

.scale-bar {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
}

.scale-item {
    flex: 1;
    padding: 1rem;
    text-align: center;
    color: white;
}

.scale-label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.scale-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.aqi-components {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.component {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    text-align: center;
}

.component-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.component-value {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.safety-notice {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    background: var(--bg-light);
}

.safety-notice .safe {
    color: var(--success-color);
}

.safety-notice .moderate {
    color: var(--warning-color);
}

.safety-notice .warning {
    color: var(--danger-color);
}

.safety-card .safety-status {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    background: var(--bg-light);
}

.status-icon {
    font-size: 3rem;
}

.status-content ul {
    margin-top: 1rem;
    margin-left: 1.5rem;
}

.status-content li {
    margin-bottom: 0.5rem;
}

.pollutants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1.5rem;
}

.pollutant-card {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.pollutant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.pollutant-name {
    font-size: 0.9rem;
    color: var(--text-light);
}

.pollutant-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.pollutant-info {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.pollutant-health {
    font-size: 0.85rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
}

/* ========== UV Index Styles ========== */
.uv-display {
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.uv-gauge {
    margin-bottom: 1.5rem;
}

.uv-number {
    font-size: 5rem;
    font-weight: 700;
}

.uv-level {
    font-size: 2rem;
    font-weight: 600;
}

.uv-recommendation {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.uv-protection {
    font-size: 1rem;
}

.scale-bar-horizontal {
    display: flex;
    gap: 0.5rem;
}

.scale-segment {
    flex: 1;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    color: white;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.scale-segment[data-active="true"] {
    opacity: 1;
    transform: scale(1.05);
}

.scale-range {
    font-size: 0.85rem;
    opacity: 0.9;
}

.protection-grid {
    margin-bottom: 2rem;
}

.protection-item {
    padding: 1.5rem;
    border-radius: 8px;
    background: var(--bg-light);
}

.protection-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.measures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 1rem;
}

.measure-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    text-align: center;
}

.measure-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.exposure-table {
    margin-top: 1rem;
}

.exposure-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.exposure-row.header {
    font-weight: 600;
    background: var(--bg-light);
    border-radius: 8px 8px 0 0;
}

.exposure-row.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 1rem;
}

.fact-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.fact-item h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* ========== Pollen Styles ========== */
.pollen-risk-display {
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.risk-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.pollen-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
}

.pollen-type-card {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 12px;
}

.pollen-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.pollen-type-card h3 {
    text-align: center;
    margin-bottom: 1rem;
}

.pollen-level-bar {
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.pollen-bar-fill {
    height: 100%;
    transition: width 0.3s;
}

.pollen-level-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.level-value {
    font-weight: 600;
}

.pollen-sources,
.pollen-season {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.symptoms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 1rem;
}

.symptom-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.symptom-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tips-section {
    margin-bottom: 2rem;
}

.tips-list {
    margin-left: 1.5rem;
}

.tips-list li {
    margin-bottom: 0.75rem;
}

.medical-note {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
}

.times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 1.5rem;
}

.time-card {
    padding: 1.5rem;
    border-radius: 8px;
}

.time-card.worst {
    background: #fee2e2;
    border-left: 4px solid var(--danger-color);
}

.time-card.best {
    background: #d1fae5;
    border-left: 4px solid var(--success-color);
}

.time-card ul {
    margin-top: 1rem;
    margin-left: 1.5rem;
}

/* ========== Flu Map Styles ========== */
.flu-legend {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.flu-map-visual {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1rem;
}

.flu-region-card {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.region-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.region-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

.countries-table {
    display: flex;
    flex-direction: column;
}

.table-header,
.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    max-width: 100%;
    overflow-wrap: break-word;
}

.table-header {
    font-weight: 600;
    background: var(--bg-light);
}

.level-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    color: white;
    font-size: 0.85rem;
}

.trend-increasing {
    color: var(--danger-color);
}

.trend-decreasing {
    color: var(--success-color);
}

.trend-stable {
    color: var(--text-light);
}

.prevention-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 1rem;
}

.prevention-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.prevention-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.warning-symptoms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.risk-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.risk-group-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

/* ========== Sidebar ========== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.widget {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.widget h3 {
    margin-bottom: 1rem;
}

.search-widget input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.search-widget button {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.search-widget button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.tool-links,
.popular-cities {
    list-style: none;
}

.tool-links li,
.popular-cities li {
    margin-bottom: 0.75rem;
}

.tool-links a,
.popular-cities a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s;
}

.tool-links a:hover,
.popular-cities a:hover {
    color: var(--primary-color);
}

/* ========== Ad Banners ========== */
.ad-banner {
    margin: 1.5rem 0;
}

/* ========== Footer ========== */
.site-footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.city-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.city-list li {
    flex: 0 0 auto;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ========== Utilities ========== */
.error-message {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 12px;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn:hover {
    background: var(--secondary-color);
}

.alert-box {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.high-alert {
    background: #fee2e2;
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.note {
    padding: 1rem;
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* ========== Responsive Design ========== */
@media (max-width: 968px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sidebar {
        order: -1;
        max-width: 100%;
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .logo {
        flex: 1;
    }
    
    .header-search {
        order: 3;
        width: 100%;
    }
    
    .header-search form {
        width: 100%;
    }
    
    .header-search input {
        flex: 1;
        min-width: 0;
    }
    
    .main-nav {
        display: none;
        width: 100%;
        order: 4;
        background: var(--bg-light);
        padding: 1rem;
        border-radius: 8px;
        margin-top: 0.5rem;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .main-nav a {
        display: block;
        padding: 0.5rem;
    }
    
    .mobile-menu-toggle {
        display: block;
        padding: 0.5rem;
        color: var(--text-dark);
    }
    
    .page-header h1 {
        font-size: 2rem;
        word-wrap: break-word;
    }
    
    .current-weather-main {
        flex-direction: column;
        text-align: center;
    }
    
    .weather-temp-large .temp {
        font-size: 3rem;
    }
    
    .weather-details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .highlight-content {
        flex-direction: column;
        text-align: center;
    }
    
    .daily-forecast {
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .daily-item {
        min-width: 100px;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .table-header {
        display: none;
    }
    
    /* Fix container overflow on mobile */
    .container {
        padding: 0 10px;
        width: 100%;
    }
    
    .weather-card {
        padding: 1rem;
    }
    
    /* Fix horizontal scrolling elements */
    .hourly-forecast-scroll {
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 480px) {
    .header-search input {
        min-width: 120px;
        width: 100%;
        max-width: 100%;
    }
    
    .weather-details-grid {
        grid-template-columns: 1fr;
    }
    
    .hourly-forecast-scroll {
        gap: 0.5rem;
    }
    
    .hourly-item {
        min-width: 70px;
        padding: 0.75rem;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
        word-wrap: break-word;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .container {
        padding: 0 10px;
        width: 100%;
    }
    
    .dashboard-layout {
        gap: 1rem;
    }
    
    .main-column {
        gap: 1rem;
    }
    
    /* Ensure tables and grids don't overflow */
    .info-grid,
    .tips-grid,
    .symptoms-grid,
    .pollutants-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Fix any remaining wide elements */
    pre,
    code {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    
    .weather-temp-large .temp {
        font-size: 2.25rem;
    }
    
    .daily-forecast {
        grid-template-columns: 1fr;
    }
}

/* ========== Print Styles ========== */
@media print {
    .site-header,
    .sidebar,
    .ad-banner,
    .site-footer {
        display: none;
    }
    
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}
