:root {
    --primary-color: #0b4f6c;
    --primary-dark: #083d54;
    --primary-light: #20a4f3;
    --success-color: #2d8659;
    --warning-color: #f57c00;
    --danger-color: #c62828;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --score-red: #c62828;
    --score-orange: #f57c00;
    --score-yellow: #fbc02d; /* Darker yellow-orange for better visibility */
    --score-light-green: #7cb342;
    --score-green: #43a047;
    --score-dark-green: #2d8659;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    /* Better touch scrolling on mobile */
    -webkit-overflow-scrolling: touch;
}

/* Mobile touch optimizations */
@media (max-width: 768px) {
    /* Prevent text size adjustment on orientation change */
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }

    /* Improve tap highlighting */
    * {
        -webkit-tap-highlight-color: rgba(11, 79, 108, 0.1);
        -webkit-touch-callout: none;
    }

    /* Better button touch targets */
    button, .btn, a {
        -webkit-tap-highlight-color: rgba(11, 79, 108, 0.2);
    }
}

/* ========================================
   ACCESSIBILITY & FOCUS STYLES
   ======================================== */

/* Skip to main content link - only visible when focused */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

.skip-to-content:focus {
    top: 0;
}

/* Enhanced focus indicators for all interactive elements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* Focus visible polyfill for modern browsers */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* Remove focus outline for mouse users but keep for keyboard */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    position: relative;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Mobile menu toggle - hidden by default */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
}

.hamburger-icon span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.brand:hover {
    opacity: 0.9;
    color: white;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 0.875rem;
    font-weight: 400;
    opacity: 0.9;
}

.app-nav {
    display: flex;
    gap: 1.5rem;
    flex-direction: row;
}

.nav-link-item {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
    padding: 0.5rem 0;
    display: inline-block;
}

.nav-link-item:hover {
    opacity: 0.8;
    color: white;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.375rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.language-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.flag-img {
    width: 24px;
    height: 18px;
    border-radius: 0.125rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    flex-shrink: 0;
    object-fit: cover;
}

.language-button .flag-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    letter-spacing: 0.05em;
}

.language-button:hover {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
    transform: translateY(-1px);
}

.language-button:hover .flag-img {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.language-button.active {
    background: white;
    opacity: 1;
}

.language-button.active .flag-img {
    border-color: var(--primary-color);
}

.language-button.active .flag-text {
    color: var(--primary-color);
}

/* Main */
.app-main {
    flex: 1;
}

/* Footer */
.app-footer {
    background-color: var(--primary-color);
    color: white;
    margin-top: 3rem;
    font-size: 0.875rem;
}

/* Page Headers */
.page-header h1 {
    color: var(--primary-color);
}

/* Location Selector - Large Prominent Style */
.location-header-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.location-title-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.location-label {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 500;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.location-dropdown {
    position: relative;
    display: inline-block;
}

.location-dropdown-button {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    padding: 1rem 2rem;
    font-size: 2.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(11, 79, 108, 0.3);
    position: relative;
    min-width: 300px;
    justify-content: center;
}

.location-dropdown-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 79, 108, 0.4);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.location-dropdown-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(11, 79, 108, 0.3);
}

.location-name-display {
    flex: 1;
    text-align: center;
}

.dropdown-arrow {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.location-dropdown-button:hover .dropdown-arrow {
    transform: translateY(2px);
}

.location-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    padding: 0.5rem;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.location-dropdown-item {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: #333;
    font-size: 1.25rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.location-dropdown-item:hover {
    background: var(--light-bg);
    color: var(--primary-color);
    transform: translateX(4px);
}

.location-dropdown-item.active {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
}

.location-dropdown-item.active:hover {
    background: var(--primary-dark);
    transform: translateX(0);
}

/* Responsive adjustments for location selector */
@media (max-width: 768px) {
    .location-dropdown-button {
        font-size: 2rem;
        padding: 0.875rem 1.5rem;
        min-width: 250px;
        gap: 0.75rem;
    }

    .dropdown-arrow {
        font-size: 1.25rem;
    }

    .location-label {
        font-size: 1rem;
    }

    .location-dropdown-menu {
        min-width: 240px;
    }

    .location-dropdown-item {
        font-size: 1.1rem;
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .location-dropdown-button {
        font-size: 1.75rem;
        padding: 0.75rem 1.25rem;
        min-width: 220px;
        gap: 0.5rem;
    }

    .dropdown-arrow {
        font-size: 1rem;
    }

    .location-label {
        font-size: 0.9rem;
    }

    .location-dropdown-menu {
        min-width: 200px;
    }

    .location-dropdown-item {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
}

/* Location Cards (Home) */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.location-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    border: 1px solid rgba(0,0,0,0.06);
}

.location-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    border-color: var(--primary-light);
}

.location-card-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
}

.location-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.location-name a {
    color: var(--primary-color);
    text-decoration: none;
}

.location-card-body {
    padding: 1.5rem;
}

.location-card-footer {
    padding: 1rem 1.5rem;
    background-color: var(--light-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.today-summary {
    margin-bottom: 1rem;
}

.summary-text {
    line-height: 1.5;
}

.best-window {
    background: #f0f9ff;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-light);
}

.time-window {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.conditions-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Score Badge */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.score-badge-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
}

.score-badge-md {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
}

.score-badge-lg {
    width: 4rem;
    height: 4rem;
    font-size: 1.5rem;
}

.score-number {
    font-weight: 700;
}

.score-scale {
    font-size: 0.65em;
    opacity: 0.9;
    margin-left: 0.1em;
}

.score-red {
    background-color: var(--score-red);
}

.score-orange {
    background-color: var(--score-orange);
}

.score-yellow {
    background-color: var(--score-yellow);
    color: #333 !important; /* Dark text for yellow background */
}

.score-light-green {
    background-color: var(--score-light-green);
}

.score-green {
    background-color: var(--score-green);
}

.score-dark-green {
    background-color: var(--score-dark-green);
}

/* Rating Badge */
.rating-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
}

/* Condition Stat */
.condition-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 100px;
}

.condition-icon {
    font-size: 1.25rem;
}

.condition-body {
    display: flex;
    flex-direction: column;
}

.condition-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

.condition-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
}

/* Forecast Days Grid (Location Page) */
.forecast-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.forecast-day-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.06);
}

.forecast-day-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    border-color: var(--primary-light);
}

.day-card-header {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.day-date {
    flex: 1;
}

.day-name {
    font-size: 1.125rem;
    font-weight: 600;
}

.day-date-text {
    font-size: 0.875rem;
    opacity: 0.9;
}

.day-card-body {
    padding: 1.25rem;
}

.fishing-windows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.window-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
}

.best-window-item {
    background-color: #f0f9ff;
    border-left: 3px solid var(--success-color);
}

.secondary-window-item {
    background-color: #fff8e1;
    border-left: 3px solid var(--warning-color);
}

.window-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
}

.window-time {
    font-weight: 600;
    margin-left: auto;
}

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* Make sea temp and pressure less prominent */
.conditions-grid .condition-stat:nth-child(3),
.conditions-grid .condition-stat:nth-child(4) {
    opacity: 0.7;
}

.conditions-grid .condition-stat:nth-child(3) .condition-value,
.conditions-grid .condition-stat:nth-child(4) .condition-value {
    font-size: 0.75rem;
}

.conditions-grid .condition-stat:nth-child(3) .condition-icon,
.conditions-grid .condition-stat:nth-child(4) .condition-icon {
    font-size: 1rem;
}

.moon-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
}

.moon-icon {
    font-size: 1.5rem;
}

.moon-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.sun-times {
    display: flex;
    gap: 1rem;
    font-size: 1rem;
    color: #6c757d;
}

.sun-time {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
}

/* Day Details Page */
.day-details-header {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.windows-detail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.window-detail-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
}

.best-window-detail {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border-left: 4px solid var(--success-color);
}

.secondary-window-detail {
    background: linear-gradient(135deg, #fff8e1 0%, #fff9c4 100%);
    border-left: 4px solid var(--warning-color);
}

.window-detail-icon {
    font-size: 2rem;
}

.window-detail-content {
    flex: 1;
}

.window-detail-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.window-detail-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.detail-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-stat-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.moon-icon {
    font-size: 2rem;
    line-height: 1;
    min-width: 2rem;
    text-align: center;
}

.detail-stat-content {
    flex: 1;
}

.detail-stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.detail-stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
}

.detail-stat-subtext {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Loading State */
.loading-state {
    padding: 3rem 0;
}

/* Chart Wrapper - Desktop */
.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Day Details Page */
.day-details-page .card {
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
}

.day-details-page .card-header {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.day-details-page .card-header h5 {
    font-weight: 700;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .locations-grid {
        grid-template-columns: 1fr;
    }

    .forecast-days-grid {
        grid-template-columns: 1fr;
    }

    .brand-subtitle {
        display: none;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block !important;
    }

    /* Mobile menu - initially hidden */
    .header-right {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 280px !important;
        height: 100vh !important;
        background: var(--primary-dark) !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding: 5rem 1.5rem 2rem !important;
        box-shadow: -4px 0 20px rgba(0,0,0,0.3) !important;
        transition: right 0.3s ease !important;
        z-index: 999 !important;
    }

    .header-right.mobile-menu-open {
        right: 0 !important;
    }

    .app-nav {
        flex-direction: column !important;
        gap: 0 !important;
        margin-bottom: 2rem !important;
    }

    .nav-link-item {
        padding: 1rem 1.5rem !important;
        font-size: 1.1rem !important;
        display: block !important;
        border-radius: 0.5rem !important;
        margin-bottom: 0.5rem !important;
        background: rgba(255,255,255,0.05) !important;
        transition: all 0.2s !important;
    }

    .nav-link-item:hover {
        background: rgba(255,255,255,0.15) !important;
        transform: translateX(4px) !important;
    }

    /* Language switcher in mobile menu */
    .language-switcher {
        flex-direction: column !important;
        width: 100% !important;
        padding: 0.5rem !important;
    }

    .language-button {
        width: 100% !important;
        justify-content: center !important;
        padding: 1rem !important;
    }

    .conditions-grid {
        grid-template-columns: 1fr;
    }
}

/* Desktop-specific overrides to ensure mobile menu is hidden */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    .header-right {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        flex-direction: row !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .app-nav {
        flex-direction: row !important;
        gap: 1.5rem !important;
    }

    .nav-link-item {
        padding: 0.5rem 0 !important;
    }
}

/* Utilities */
.text-orange {
    color: var(--warning-color);
}

/* Solunar Periods */
.solunar-periods {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.solunar-period-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.solunar-period-item.highlight-overlap {
    background: linear-gradient(135deg, #fff9e6 0%, #ffe8b3 100%);
    border-color: #ffc107;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.solunar-period-icon {
    font-size: 2rem;
    line-height: 1;
    min-width: 2rem;
    text-align: center;
}

.solunar-period-content {
    flex: 1;
}

.solunar-period-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.solunar-period-time {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.solunar-overlap-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #f57c00;
}

.solunar-overlap-badge svg {
    color: #f57c00;
}

/* ========================================
   SMOOTH TRANSITIONS & ANIMATIONS
   ======================================== */

/* Card hover effects */
.forecast-day-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.forecast-day-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Dropdown item transitions */
.location-dropdown-item {
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.location-dropdown-item:hover {
    transform: translateX(4px);
}

/* Button transitions */
.btn {
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
    transform: scale(0.98);
}

/* Language switcher smooth transitions */
.language-btn {
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.language-btn:hover {
    transform: translateY(-2px);
}

/* Fade-in animation for new content */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.forecast-days-grid {
    animation: fadeIn 0.3s ease;
}

.location-forecast-page {
    animation: fadeIn 0.4s ease;
}

/* Loading state pulse */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-state {
    animation: fadeIn 0.3s ease;
}

/* Score badge subtle scale on hover */
.score-badge {
    transition: transform 0.2s ease;
}

.score-badge:hover {
    transform: scale(1.05);
}

/* Chart container fade-in */
.chart-container {
    animation: fadeIn 0.5s ease;
}

/* Solunar section smooth reveal */
.solunar-section {
    animation: fadeIn 0.4s ease 0.2s backwards;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    /* Hide interactive elements */
    .app-header,
    .language-switcher,
    .location-dropdown-button,
    .dropdown-toggle,
    .btn,
    .location-dropdown-menu,
    nav,
    .app-nav {
        display: none !important;
    }

    /* Optimize cards for printing */
    .forecast-day-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 2px solid #000;
        margin-bottom: 1rem;
        box-shadow: none !important;
        transform: none !important;
    }

    /* Simplify score badges */
    .score-badge {
        border: 2px solid #000 !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .score-dark-green {
        font-weight: bold;
    }

    .score-red {
        border-style: dashed !important;
    }

    /* Remove backgrounds for ink savings */
    body {
        background: white !important;
    }

    .forecast-day-card,
    .day-card-header,
    .best-window-badge,
    .rating-badge {
        background: white !important;
    }

    /* Make text printer-friendly */
    * {
        color: #000 !important;
    }

    /* Show location name prominently */
    .page-header {
        border-bottom: 2px solid #000;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    /* Optimize spacing */
    .forecast-days-grid {
        gap: 1rem;
    }

    /* Add print timestamp */
    .page-header::after {
        content: "Printed: " attr(data-print-time);
        display: block;
        font-size: 0.75rem;
        margin-top: 0.5rem;
        color: #666 !important;
    }

    /* Hide charts (complex to print) */
    .chart-container {
        display: none !important;
    }

    /* Simplify table formatting */
    .hourly-details-table {
        border-collapse: collapse;
        width: 100%;
    }

    .hourly-details-table th,
    .hourly-details-table td {
        border: 1px solid #000;
        padding: 0.25rem;
    }

    /* Page breaks */
    .day-details-page {
        page-break-before: always;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* ========================================
   RESPONSIVE / MOBILE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
    /* Compact header for mobile */
    .app-header {
        padding: 0;
    }

    .brand-title {
        font-size: 1.1rem;
    }

    .brand-subtitle {
        font-size: 0.75rem;
    }

    /* Location cards on mobile */
    .location-card {
        margin-bottom: 1.25rem;
        box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    }

    /* Better mobile grid - single column */
    .forecast-days-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }

    /* Optimized day cards for mobile */
    .forecast-day-card {
        padding: 0;
        border-radius: 0.875rem;
        margin-bottom: 1rem;
        box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    }

    .day-card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 1rem;
    }

    .day-date {
        flex: 1;
    }

    .day-name {
        font-size: 1.05rem;
        font-weight: 700;
        margin-bottom: 0.125rem;
    }

    .day-date-text {
        font-size: 0.75rem;
        opacity: 0.95;
    }

    /* Better score badge on mobile */
    .score-badge {
        min-width: 65px;
    }

    .day-card-body {
        padding: 1rem;
        background: white;
    }

    /* Rating badge - more compact */
    .rating-badge {
        font-size: 0.875rem;
        padding: 0.5rem 0.875rem;
        text-align: center;
        width: 100%;
        display: block;
        border-radius: 0.5rem;
    }

    /* Better fishing windows on mobile */
    .fishing-windows {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .window-item {
        padding: 0.625rem 0.75rem;
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 0.625rem;
        align-items: center;
        border-radius: 0.5rem;
    }

    .window-label {
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.025em;
        text-transform: uppercase;
    }

    .window-time {
        font-size: 0.95rem;
        font-weight: 700;
    }

    /* Improved conditions grid - 2 columns, compact */
    .conditions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .condition-stat {
        flex-direction: row;
        align-items: center;
        padding: 0.625rem 0.75rem;
        background: #f8f9fa;
        border-radius: 0.5rem;
        min-width: 0;
        gap: 0.5rem;
    }

    .condition-icon {
        font-size: 1.5rem;
        line-height: 1;
        flex-shrink: 0;
    }

    .condition-body {
        display: flex;
        flex-direction: column;
        gap: 0.125rem;
        min-width: 0;
    }

    .condition-label {
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #6c757d;
        line-height: 1;
    }

    .condition-value {
        font-size: 0.875rem;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
    }

    /* Make all conditions equally visible on mobile */
    .conditions-grid .condition-stat:nth-child(3),
    .conditions-grid .condition-stat:nth-child(4) {
        opacity: 1;
    }

    .conditions-grid .condition-stat:nth-child(3) .condition-value,
    .conditions-grid .condition-stat:nth-child(4) .condition-value {
        font-size: 1rem;
    }

    .conditions-grid .condition-stat:nth-child(3) .condition-icon,
    .conditions-grid .condition-stat:nth-child(4) .condition-icon {
        font-size: 1.5rem;
    }

    /* Moon info - more compact */
    .moon-info {
        padding: 0.625rem 0.75rem;
        background: #f8f9fa;
        border-radius: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .moon-icon {
        font-size: 1.5rem;
        line-height: 1;
    }

    .moon-text {
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.3;
    }

    /* Sun times - inline and compact */
    .sun-times {
        display: flex;
        justify-content: space-between;
        padding: 0.625rem 0.75rem;
        background: #fff8e1;
        border-radius: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .sun-time {
        font-size: 0.8rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    /* Better button on mobile */
    .btn-sm {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
        font-weight: 600;
        border-radius: 0.5rem;
    }

    /* Location dropdown - make it bigger and easier to tap */
    .location-header-wrapper {
        margin-bottom: 1.5rem;
    }

    .location-dropdown-button {
        font-size: 1.5rem;
        padding: 0.75rem 1.25rem;
        min-height: 60px;
        width: 100%;
    }

    .location-label {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }

    /* Location dropdown menu - full width on mobile */
    .location-dropdown-menu {
        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
    }

    .location-dropdown-item {
        padding: 1rem;
        font-size: 1.1rem;
    }

    /* Language switcher - make it more mobile friendly */
    .language-switcher {
        padding: 0.375rem;
        gap: 0.5rem;
    }

    .language-button {
        padding: 0.625rem 1rem;
        min-width: 80px;
        justify-content: center;
    }

    .flag-img {
        width: 28px;
        height: 21px;
    }

    .language-button .flag-text {
        font-size: 0.9rem;
    }

    /* Chart wrapper for better mobile control */
    .chart-wrapper {
        position: relative;
        height: 250px;
        width: 100%;
    }

    .chart-wrapper canvas {
        max-height: 250px;
    }

    /* Reduce chart heights on mobile */
    .chart-container {
        height: 280px !important;
        margin: 1rem 0;
    }

    /* Compact detail stats */
    .detail-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .detail-stat-item {
        padding: 1rem;
    }

    /* Detail page cards */
    .day-details-page .card {
        margin-bottom: 1rem;
        border-radius: 0.75rem;
    }

    .day-details-page .card-header {
        padding: 0.875rem 1rem;
        background: #f8f9fa;
        border-bottom: 1px solid #dee2e6;
    }

    .day-details-page .card-header h5 {
        font-size: 1rem;
        font-weight: 700;
    }

    .day-details-page .card-body {
        padding: 1rem;
    }

    /* Better hourly table on mobile */
    .hourly-details-table {
        font-size: 0.875rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hourly-details-table th,
    .hourly-details-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    .hourly-details-table th {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    /* Forecast footer */
    .forecast-footer {
        padding: 1.5rem 1rem;
    }

    /* Compact empty state */
    .empty-state .display-1 {
        font-size: 3.5rem !important;
    }

    .empty-state h3 {
        font-size: 1.35rem;
    }

    .empty-state p {
        font-size: 0.95rem;
    }

    /* Loading state */
    .loading-state {
        padding: 3rem 1rem !important;
    }

    /* Responsive footer */
    .app-footer {
        font-size: 0.875rem;
        padding: 1.25rem 1rem;
        text-align: center;
    }

    /* Alert improvements */
    .alert {
        padding: 1rem;
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    /* Page header */
    .page-header {
        margin-bottom: 1.5rem;
    }
}

/* Extra small devices (phones in portrait, < 480px) */
@media (max-width: 480px) {
    /* Stack navigation vertically on very small screens */
    .app-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .nav-link-item {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        text-align: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 0.375rem;
    }

    /* Single column conditions on very small screens */
    .conditions-grid {
        grid-template-columns: 1fr;
    }

    /* Larger touch targets */
    .forecast-day-card {
        margin-bottom: 1.25rem;
    }

    .btn, .btn-sm {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }

    /* Hide less critical columns on very small screens */
    .hourly-details-table .desktop-only {
        display: none;
    }

    /* Full width language switcher on tiny screens */
    .language-switcher {
        width: 100%;
    }

    .language-button {
        flex: 1;
    }

    /* Smaller brand on very small screens */
    .brand-title {
        font-size: 0.95rem;
    }

    .brand-subtitle {
        font-size: 0.7rem;
    }

    .brand-mark {
        font-size: 1.5rem;
    }

    /* Compact score badge */
    .score-badge {
        min-width: 60px;
    }

    .score-badge-value {
        font-size: 1.25rem;
    }

    .score-badge-label {
        font-size: 0.65rem;
    }
}

/* Landscape orientation optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .day-card-header {
        padding: 0.75rem 1rem;
    }

    .day-card-body {
        padding: 0.75rem 1rem;
    }

    .chart-container {
        height: 220px !important;
    }

    .loading-state,
    .empty-state {
        padding: 2rem 1rem !important;
    }
}

/* High resolution mobile displays */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    /* Ensure crisp text */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Better touch targets on retina */
    .location-dropdown-button,
    .language-button,
    .btn {
        min-height: 48px;
    }
}
