/* === DESIGN TOKENS === */
:root {
    /* Colors */
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-secondary: #6b7280;
    --color-secondary-hover: #4b5563;
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-purple: #8b5cf6;
    --color-purple-hover: #7c3aed;
    --color-cyan: #0891b2;
    --color-cyan-hover: #0e7490;

    /* Backgrounds */
    --bg-dark: #1f2937;
    --bg-darker: #111827;
    --bg-light: #f3f4f6;
    --bg-white: #ffffff;
    --bg-sidebar: #ffffff;

    /* Text */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-light: #f9fafb;

    /* Borders */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;

    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Sidebar */
    --sidebar-width: 380px;
    --sidebar-z-index: 2000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f3f4f6;
}

header {
    background-color: #1f2937;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Control bar using design tokens (T024) */
.controls {
    background-color: var(--bg-white);
    padding: var(--space-md) var(--space-xl);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.controls-spacer {
    flex: 1;
}

/* Active filters summary in header */
.active-filters-summary {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-primary-light, #eff6ff);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

.active-filters-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.filter-group label {
    font-weight: 500;
    color: #374151;
}

select {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

/* Buttons using design tokens (T022) */
.refresh-btn {
    padding: var(--space-sm) var(--space-lg);
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-normal), transform var(--transition-fast);
}

.refresh-btn:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.refresh-btn:active {
    transform: translateY(0);
}

/* Legacy buttons - hidden but kept for compatibility */
.weights-btn {
    padding: var(--space-sm) var(--space-lg);
    background-color: var(--color-purple);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-normal);
    display: none; /* Hidden - superseded by unified settings button */
}

.weights-btn:hover {
    background-color: var(--color-purple-hover);
}

/* Legacy filter button - hidden */
.filter-btn {
    padding: var(--space-sm) var(--space-lg);
    background-color: var(--color-cyan);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-normal);
    display: none; /* Hidden - superseded by unified settings button */
}

.filter-btn:hover {
    background-color: var(--color-cyan-hover);
}

.filter-btn.filter-active {
    background-color: var(--color-success);
}

/* Filter Modal */
.filter-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 3000;
    padding-top: 80px;
    overflow-y: auto;
}

.filter-modal {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 95%;
    max-height: calc(100vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f8fafc;
}

.filter-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2937;
}

.filter-modal-actions {
    display: flex;
    gap: 0.5rem;
}

.filter-modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.filter-modal .filter-group {
    display: block;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.filter-modal .filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-modal .filter-group h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.filter-description {
    margin: 0 0 1rem 0;
    font-size: 0.8125rem;
    color: #6b7280;
    font-style: italic;
}

.filter-row {
    margin-bottom: 0.75rem;
}

.filter-row label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: #374151;
}

.filter-value {
    font-weight: 600;
    color: #0891b2;
}

.filter-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #e5e7eb, #0891b2);
    border-radius: 3px;
    outline: none;
}

.filter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f8fafc;
}

.apply-filters-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background-color: #059669;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.apply-filters-btn:hover {
    background-color: #047857;
}

/* Greyed out cells in table */
.cell-greyed-out {
    opacity: 0.4;
    position: relative;
}

.cell-greyed-out::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(156, 163, 175, 0.2) 3px,
        rgba(156, 163, 175, 0.2) 6px
    );
    pointer-events: none;
}

/* Weight panel */
.weight-panel {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    max-width: 500px;
    width: 90%;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.weight-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.weight-panel-header h3 {
    font-size: 1.125rem;
    color: #1f2937;
    margin: 0;
}

.weight-panel .reset-btn {
    padding: 0.4rem 0.8rem;
    background-color: #6b7280;
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.weight-panel .reset-btn:hover {
    background-color: #4b5563;
}

.weight-panel .close-btn {
    padding: 0.2rem 0.6rem;
    background-color: transparent;
    color: #6b7280;
    border: none;
    border-radius: 0.25rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    line-height: 1;
}

.weight-panel .close-btn:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.weight-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.weight-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.weight-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #374151;
}

.weight-label {
    font-weight: 500;
}

.weight-value {
    font-weight: 600;
    color: #8b5cf6;
    min-width: 45px;
    text-align: right;
}

.panel-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.weight-description {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
    line-height: 1.3;
    font-style: italic;
}

.weight-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e5e7eb, #8b5cf6);
    outline: none;
    cursor: pointer;
}

.weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.weight-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.weight-total {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px solid #e5e7eb;
    text-align: center;
}

.weight-total strong {
    font-size: 1.125rem;
    color: #1f2937;
}

.weight-warning {
    display: block;
    margin-top: 0.5rem;
    color: #f59e0b;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Golf Weight Section */
.golf-weight-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #6ee7b7;
    background-color: #ecfdf5;
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
}

.golf-weight-section h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #065f46;
}

.golf-weight-description {
    margin: 0 0 1rem 0;
    font-size: 0.8125rem;
    color: #059669;
    font-style: italic;
}

.golf-slider {
    background: linear-gradient(to right, #d1fae5, #059669) !important;
}

.golf-slider::-webkit-slider-thumb {
    background: #059669 !important;
}

/* Safety Thresholds Section */
.safety-thresholds {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
}

.safety-thresholds h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.threshold-description {
    margin: 0 0 1rem 0;
    font-size: 0.8125rem;
    color: #6b7280;
    font-style: italic;
}

.threshold-group {
    margin-bottom: 0.75rem;
}

.threshold-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.threshold-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.threshold-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #dc2626;
    min-width: 80px;
    text-align: right;
}

.threshold-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e5e7eb, #dc2626);
    outline: none;
    cursor: pointer;
}

.threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc2626;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.threshold-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc2626;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.legend {
    position: absolute;
    top: 70px;
    right: 20px;
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 200px;
}

.legend h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
}

.legend-item span:last-child {
    font-size: 0.875rem;
    color: #4b5563;
}

#map {
    height: calc(100vh - 70px);
    width: 100%;
}

.loading, .error {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    z-index: 2000;
}

.loading {
    color: #3b82f6;
    font-weight: 500;
}

.error {
    color: #ef4444;
    font-weight: 500;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
    max-height: calc(100vh - 120px);
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 1rem;
    min-width: 440px;
    max-width: 500px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.popup-content h3 {
    margin-bottom: 0.25rem;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
}

.popup-content .region-name {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.popup-content .score-main {
    background-color: #f3f4f6;
    padding: 0.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    text-align: center;
}

.popup-content .score-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #059669;
}

.popup-content .weather-section,
.popup-content .tips-section,
.popup-content .attributes-section {
    margin-bottom: 0.75rem;
}

.popup-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.25rem;
}

.popup-content p {
    margin: 0.25rem 0;
    color: #4b5563;
    font-size: 0.875rem;
}

.detailed-popup .leaflet-popup-content-wrapper {
    padding: 0.5rem;
}

/* Travel tips styling */
.popup-content .tips-section {
    background-color: #fef3c7;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border-left: 3px solid #f59e0b;
}

.popup-content .tip-pro {
    color: #047857;
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.popup-content .tip-con {
    color: #b91c1c;
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.popup-content .tips-section h4 {
    color: #92400e;
    margin-bottom: 0.5rem;
}

/* Safety warning styling */
.popup-content .safety-warning {
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.popup-content .safety-warning.severe {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.popup-content .safety-warning.moderate {
    background-color: #fed7aa;
    border-left: 4px solid #f97316;
    color: #9a3412;
}

.popup-content .safety-warning strong {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* Toggle breakdown button */
.toggle-breakdown-btn {
    width: 100%;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
}

.toggle-breakdown-btn:hover {
    background-color: #2563eb;
}

.toggle-breakdown-btn:active {
    background-color: #1d4ed8;
}

/* Score breakdown styling */
.popup-content .score-breakdown {
    background-color: #f0f9ff;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border: 1px solid #bfdbfe;
}

.popup-content .score-breakdown h4 {
    color: #1e40af;
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}

.popup-content .breakdown-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: white;
    border-radius: 0.25rem;
}

.popup-content .breakdown-item strong {
    color: #1f2937;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.popup-content .sub-items {
    margin-top: 0.25rem;
    margin-left: 0.5rem;
}

.popup-content .sub-items small {
    display: block;
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.popup-content .breakdown-calculation {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid #bfdbfe;
    text-align: center;
}

.popup-content .breakdown-calculation strong {
    display: block;
    color: #1e40af;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.popup-content .capped-notice {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #fef3c7;
    border-radius: 0.25rem;
    color: #92400e;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Region selector styling */
.popup-content .region-selector {
    background-color: #f9fafb;
    padding: 0.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}

.popup-content .region-selector h4 {
    font-size: 0.875rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #374151;
}

.popup-content .region-option {
    padding: 0.4rem 0.6rem;
    margin: 0.25rem 0;
    cursor: pointer;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.popup-content .region-option:hover {
    background-color: #e5e7eb;
}

.popup-content .region-option.active {
    background-color: #3b82f6;
    color: white;
}

.popup-content .region-option.active strong {
    color: white;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    /* Reduce popup width on mobile */
    .leaflet-popup-content-wrapper {
        max-height: calc(100vh - 100px);
        overflow: hidden;
    }

    .leaflet-popup-content {
        margin: 0.75rem;
        min-width: 320px;
        max-width: calc(100vw - 60px);
        max-height: calc(100vh - 140px);
    }

    /* Reduce font sizes slightly */
    .popup-content h3 {
        font-size: 1rem;
    }

    .popup-content .score-value {
        font-size: 1.125rem;
    }

    .popup-content h4 {
        font-size: 0.8125rem;
    }

    .popup-content p {
        font-size: 0.8125rem;
    }

    /* Reduce padding in sections */
    .popup-content .safety-warning {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }

    .popup-content .tips-section {
        padding: 0.4rem;
    }

    .popup-content .score-main {
        padding: 0.4rem;
        margin-bottom: 0.75rem;
    }

    /* Make legend smaller and repositionable */
    .legend {
        top: 100px;
        right: 10px;
        padding: 0.75rem;
        min-width: 160px;
        font-size: 0.875rem;
    }

    .legend h3 {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }

    .legend-item {
        margin-bottom: 0.4rem;
    }

    .legend-color {
        width: 24px;
        height: 16px;
    }

    .legend-item span:last-child {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens - even more compact */
    .leaflet-popup-content-wrapper {
        max-height: calc(100vh - 80px);
        overflow: hidden;
    }

    .leaflet-popup-content {
        margin: 0.5rem;
        min-width: 200px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 120px);
    }

    .popup-content h3 {
        font-size: 0.9375rem;
    }

    /* Make popup more compact */
    .popup-content .weather-section,
    .popup-content .tips-section,
    .popup-content .attributes-section {
        margin-bottom: 0.5rem;
    }

    .popup-content h4 {
        margin-top: 0.4rem;
        margin-bottom: 0.4rem;
    }
}

/* Pro/Con Travel Tips Styling */
.pro-con-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.75rem;
}

.pro-item,
.con-item {
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.pro-item {
    background-color: #f0fdf4;
    border-left-color: #22c55e;
}

.con-item {
    background-color: #fef2f2;
    border-left-color: #ef4444;
}

.pro-header,
.con-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pro-header .icon {
    font-size: 1.125rem;
}

.con-header .icon {
    font-size: 1.125rem;
}

.pro-header strong {
    color: #16a34a;
    font-size: 0.9375rem;
    font-weight: 600;
}

.con-header strong {
    color: #dc2626;
    font-size: 0.9375rem;
    font-weight: 600;
}

.pro-item p,
.con-item p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
}

.tips-section h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

/* Responsive adjustments for pro/con */
@media (max-width: 768px) {
    .pro-con-container {
        gap: 0.75rem;
    }

    .pro-item,
    .con-item {
        padding: 0.75rem;
    }

    .pro-item p,
    .con-item p {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .pro-con-container {
        gap: 0.625rem;
    }

    .pro-item,
    .con-item {
        padding: 0.625rem;
    }

    .pro-item p,
    .con-item p {
        font-size: 0.75rem;
    }
}

/* Travel Conditions Grid */
.travel-conditions {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.travel-conditions h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #1e293b;
    font-size: 1rem;
}

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

.condition-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: white;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
}

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

.condition-label {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
}

.condition-value {
    font-size: 0.875rem;
    color: #1e293b;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
    min-width: max-content;
}

.conditions-note {
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
    text-align: right;
}

/* Toggle Attributes Button */
.toggle-attributes-btn {
    width: 100%;
    padding: 0.5rem;
    margin: 0.75rem 0 0.5rem 0;
    background-color: #64748b;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
}

.toggle-attributes-btn:hover {
    background-color: #475569;
}

/* Attributes Section */
.attributes-section {
    margin-top: 0.5rem;
    padding: 1rem;
    background-color: #f1f5f9;
    border-radius: 0.375rem;
}

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

.attribute-item {
    font-size: 0.875rem;
    color: #334155;
    padding: 0.5rem;
    background-color: white;
    border-radius: 0.25rem;
    border: 1px solid #e2e8f0;
}

/* Responsive adjustments for grids */
@media (max-width: 768px) {
    .conditions-grid,
    .attribute-grid {
        gap: 0.5rem;
    }

    .condition-item,
    .attribute-item {
        padding: 0.375rem;
        font-size: 0.8125rem;
    }

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

@media (max-width: 480px) {
    .conditions-grid {
        grid-template-columns: 1fr;
    }

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

    .condition-value {
        font-size: 0.8125rem;
    }
}

/* Star ratings using Font Awesome */
.star-rating {
    display: inline-block;
    white-space: nowrap;
    line-height: 1;
    letter-spacing: -0.1em;
}

.star-rating i {
    color: #f59e0b; /* Gold color for all stars */
    font-size: 0.9rem;
    margin: 0;
}

/* Simplified Tips Section */
.tips-section-simple {
    margin: 1rem 0;
    padding: 0;
}

.recommendation-text {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.summary-text {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #4b5563;
    font-size: 0.9375rem;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insight-item {
    line-height: 1.6;
    color: #374151;
    font-size: 0.875rem;
}

.insight-item strong {
    color: #1f2937;
    font-weight: 600;
}

/* Simplified Travel Conditions */
.travel-conditions-simple {
    margin: 1rem 0;
    padding: 0;
}

.travel-conditions-simple h4 {
    margin: 0 0 0.75rem 0;
    color: #1f2937;
    font-size: 0.9375rem;
    font-weight: 600;
}

.conditions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.condition-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: #374151;
    font-size: 0.875rem;
}

.condition-row > span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Info tooltip for golf score breakdown */
.info-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
}

.info-icon {
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.info-icon:hover {
    opacity: 1;
}

.info-tooltip {
    display: none !important;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

/* Show tooltip on hover (desktop) */
.info-tooltip-wrapper:hover .info-tooltip {
    display: block !important;
}

/* Show tooltip on focus/click (mobile) */
.info-tooltip-wrapper:focus-within .info-tooltip,
.info-tooltip-wrapper.active .info-tooltip {
    display: block !important;
}

/* === TABLE VIEW STYLES (T017, T018) === */

/* View toggle button using design tokens (T024) */
.view-toggle-btn {
    padding: var(--space-sm) var(--space-lg);
    background-color: var(--color-success);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-normal), transform var(--transition-fast);
}

.view-toggle-btn:hover {
    background-color: var(--color-success-hover);
    transform: translateY(-1px);
}

.view-toggle-btn:active {
    transform: translateY(0);
}

/* Column selector */
.column-selector {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #f3f4f6;
    border-radius: 0.375rem;
}

.column-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.column-toggle input[type="checkbox"] {
    width: 0.875rem;
    height: 0.875rem;
}

.column-toggle input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Table container */
.table-container {
    height: calc(100vh - 70px);
    width: 100%;
    overflow: auto;
    background-color: #f9fafb;
}

.table-wrapper {
    overflow: auto;
    max-height: calc(100% - 60px); /* Account for table controls bar */
}

.table-loading,
.table-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 1.125rem;
    color: #6b7280;
}

/* Destination table */
.destination-table {
    width: max-content;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

/* Fixed header (FR-013) */
.destination-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #1f2937;
}

/* Fixed first column (FR-014) */
.destination-table th.destination-header,
.destination-table td.destination-cell {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: #1f2937;
    color: white;
    width: 180px;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 500;
    border-right: 2px solid #374151;
}

.destination-table td.destination-cell {
    background-color: #374151;
    color: #f9fafb;
    font-weight: 400;
}

/* Month header row */
.month-header-row th {
    color: white;
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid #4b5563;
}

.month-header {
    border-left: 2px solid #4b5563;
}

/* Score type header row */
.score-type-header-row th {
    color: #d1d5db;
    padding: 0.375rem 0.25rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.6875rem;
    cursor: pointer;
    transition: background-color 0.15s;
    white-space: nowrap;
}

.score-type-header-row th:hover {
    background-color: #374151;
}

.score-type-header-row th.sorted {
    background-color: #4b5563;
    color: #fbbf24;
}

/* Score cells with color coding (T018) */
.score-cell {
    padding: 0.375rem 0.25rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.75rem;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    width: 48px;
    transition: transform 0.1s;
}

.score-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
    position: relative;
}

/* Weather cells with temperature display */
.weather-cell .score-value {
    display: block;
}

.weather-cell .temp-display {
    display: block;
    font-size: 0.6rem;
    font-weight: 400;
    opacity: 0.8;
    line-height: 1;
}

/* Alternating row colors for readability */
.destination-table tbody tr:nth-child(even) td.destination-cell {
    background-color: #4b5563;
}

.destination-table tbody tr:nth-child(odd) td.destination-cell {
    background-color: #374151;
}

/* Responsive table adjustments */
@media (max-width: 768px) {
    .destination-table {
        font-size: 0.75rem;
    }

    .destination-table th.destination-header,
    .destination-table td.destination-cell {
        width: 120px;
        padding: 0.375rem 0.5rem;
    }

    .score-cell {
        width: 36px;
        padding: 0.25rem 0.125rem;
        font-size: 0.6875rem;
    }

    .column-selector {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .controls {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .view-toggle-btn {
        width: 100%;
    }

    .column-selector {
        justify-content: center;
    }
}

/* Table popup modal */
.table-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.table-popup-modal {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    margin: 1rem;
}

.table-popup-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    z-index: 10;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.table-popup-close:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.table-popup-content {
    padding: 1rem;
}

.table-popup-content .popup-content {
    font-size: 0.875rem;
}

.table-popup-content .popup-content h3 {
    margin-bottom: 0.25rem;
    padding-right: 2rem;
}

/* Clickable table cells */
.clickable-cell {
    cursor: pointer;
    transition: filter 0.15s ease;
}

.clickable-cell:hover {
    filter: brightness(0.9);
}

.destination-cell {
    cursor: pointer;
}

.destination-cell:hover {
    background-color: #2d3748 !important;
}

/* === UNIFIED SETTINGS SIDEBAR (T003-T005) === */

/* Sidebar overlay backdrop */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--sidebar-z-index) - 1);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.settings-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Sidebar container */
.settings-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-sidebar);
    box-shadow: var(--shadow-xl);
    z-index: var(--sidebar-z-index);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-sidebar.open {
    transform: translateX(0);
}

/* Sidebar header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background-color: var(--bg-dark);
    color: var(--text-light);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
}

.sidebar-header-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.sidebar-close-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-xs);
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.sidebar-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-reset-btn {
    padding: var(--space-xs) var(--space-sm);
    background-color: var(--color-secondary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.sidebar-reset-btn:hover {
    background-color: var(--color-secondary-hover);
}

/* Sidebar content area */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

/* Help button */
.help-btn {
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.help-btn:hover {
    background-color: var(--color-primary);
    color: white;
}

/* Help overlay */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.help-modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    max-width: 650px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.help-modal h2 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.help-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.help-close:hover {
    color: var(--text-primary);
}

.help-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.help-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.help-section p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.help-section.help-tip {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-bottom: none;
}

.help-tip strong {
    color: var(--color-primary);
}

.help-category {
    margin: 1.5rem 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.25rem;
}

.help-category:first-of-type {
    margin-top: 0.5rem;
}

.help-category-desc {
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.score-type {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.score-type.absolute {
    background-color: #dbeafe;
    color: #1e40af;
}

.score-type.relative {
    background-color: #fef3c7;
    color: #92400e;
}

/* Show more button for filters */
.show-more-btn {
    width: 100%;
    padding: var(--space-sm);
    margin-top: var(--space-sm);
    background: transparent;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
}

.show-more-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.secondary-filters {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-light);
}

/* Filter month selector */
.filter-month-selector {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.filter-month-selector label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.filter-month-dropdown {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    width: 100%;
}

.filter-month-dropdown:hover {
    border-color: var(--color-primary);
}

.filter-month-dropdown:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Filter presets */
.filter-presets {
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.presets-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.preset-btn {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.preset-btn:hover {
    border-color: var(--color-primary);
    background-color: rgba(59, 130, 246, 0.05);
}

.preset-btn.active {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: white;
}

/* Collapsible sections */
.settings-section {
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background-color: var(--bg-light);
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast);
}

.section-header:hover {
    background-color: #e5e7eb;
}

.section-header h3 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-toggle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
}

.section-header.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-content {
    padding: var(--space-md);
    max-height: 1000px;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition-slow);
}

.section-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Weight/filter controls inside sections */
.setting-row {
    margin-bottom: var(--space-md);
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.setting-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.setting-value {
    font-weight: 600;
    color: var(--color-primary);
    min-width: 45px;
    text-align: right;
}

.setting-description {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
    font-style: italic;
}

.setting-subheader {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-light);
}

.setting-subheader:first-of-type {
    margin-top: var(--space-sm);
}

/* Slider styling for settings */
.setting-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--border-light), var(--color-primary));
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-md);
}

.setting-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-md);
}

/* Golf-specific slider */
.setting-slider.golf-slider {
    background: linear-gradient(to right, #d1fae5, var(--color-success));
}

.setting-slider.golf-slider::-webkit-slider-thumb {
    background: var(--color-success);
}

.setting-slider.golf-slider::-moz-range-thumb {
    background: var(--color-success);
}

/* Safety threshold slider */
.setting-slider.safety-slider {
    background: linear-gradient(to right, var(--border-light), var(--color-danger));
}

.setting-slider.safety-slider::-webkit-slider-thumb {
    background: var(--color-danger);
}

.setting-slider.safety-slider::-moz-range-thumb {
    background: var(--color-danger);
}

/* Column visibility toggles */
.column-toggles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.column-toggle-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.column-toggle-item:hover {
    background-color: #e5e7eb;
}

.column-toggle-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.column-toggle-item label {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
    flex: 1;
}

/* Display options in column settings */
.display-options {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.display-option-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
}

.display-option-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.display-option-item label {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
}

/* Weight total display */
.weight-total-display {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 2px solid var(--border-light);
    text-align: center;
}

.weight-total-display strong {
    font-size: var(--font-size-lg);
    color: var(--text-primary);
}

.weight-warning-text {
    display: block;
    margin-top: var(--space-sm);
    color: var(--color-warning);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* Settings and Filters buttons */
.settings-btn,
.filters-btn {
    position: relative;
    padding: var(--space-sm) var(--space-lg);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-normal), box-shadow var(--transition-normal);
}

.settings-btn {
    background-color: var(--color-purple);
}

.filters-btn {
    background-color: #2563eb;
}

.settings-btn:hover {
    background-color: var(--color-purple-hover);
}

.filters-btn:hover {
    background-color: #1d4ed8;
}

.settings-btn.active,
.filters-btn.active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--color-success);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Responsive sidebar (T005) */
@media (max-width: 767px) {
    .settings-sidebar {
        width: 100%;
    }

    .settings-overlay.visible {
        display: block;
    }

    .sidebar-content {
        padding: var(--space-sm);
    }

    .column-toggles {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .settings-overlay {
        display: none;
    }
}

/* === TABLE SEARCH AND COLLAPSIBLE GROUPS === */

/* Table controls bar */
.table-controls {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 20;
}

/* Search input wrapper */
.table-search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.table-search-input {
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
    padding-right: 2.5rem;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.table-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.table-search-input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--text-muted);
    color: white;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.search-clear:hover {
    background-color: var(--text-secondary);
}

/* Group control buttons */
.table-group-controls {
    display: flex;
    gap: var(--space-sm);
}

.group-btn {
    padding: var(--space-xs) var(--space-md);
    background-color: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.group-btn:hover {
    background-color: var(--border-light);
    color: var(--text-primary);
}

.group-btn.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.group-btn.active:hover {
    background-color: var(--color-primary-hover);
}

/* Table stats */
.table-stats {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

/* Country header row (expandable multi-region countries) */
.country-header-row {
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.country-header-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Single-region country rows (styled same as country headers) */
.single-region-row {
    transition: background-color var(--transition-fast);
}

.single-region-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.single-region-cell {
    background-color: #374151 !important;
}

.country-header-cell {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: #374151;
    color: white;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 500;
    border-right: 2px solid #4b5563;
    min-width: 180px;
    white-space: nowrap;
}

.expand-icon {
    display: inline-block;
    transition: transform var(--transition-fast);
    font-size: 0.625rem;
    color: #9ca3af;
    margin-right: 0.5rem;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.country-name {
    font-weight: 500;
}

.region-count {
    font-size: var(--font-size-xs);
    color: #9ca3af;
    font-weight: 400;
    margin-left: 0.375rem;
}

/* Country score cells (summary row) */
.country-score-cell {
    font-weight: 500 !important;
}

/* Region rows (indented under expanded countries) */
.region-row {
    background-color: transparent;
}

.region-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.region-cell {
    padding-left: 1.75rem !important;
    background-color: #3d4654 !important;
    font-weight: 400 !important;
    font-size: 0.8125rem;
    color: #d1d5db !important;
}

.region-row:nth-child(even) .region-cell {
    background-color: #434d5c !important;
}

/* Responsive adjustments for table controls */
@media (max-width: 768px) {
    .table-controls {
        flex-wrap: wrap;
        gap: var(--space-md);
        padding: var(--space-sm) var(--space-md);
    }

    .table-search-wrapper {
        max-width: none;
        width: 100%;
        order: 1;
    }

    .table-group-controls {
        order: 2;
    }

    .table-stats {
        order: 3;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .group-btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--font-size-xs);
    }

    .country-header-cell {
        min-width: 140px;
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }

    .region-cell {
        padding-left: 1rem !important;
        font-size: 0.75rem;
    }
}

/* === TOGGLE SWITCH === */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.2s ease;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* === FLIGHT TIME TABLE COLUMN === */
.flight-header {
    position: sticky;
    left: 180px;
    z-index: 12;
    background-color: #2d3748;
    color: white;
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-weight: 500;
    border-right: 2px solid #4b5563;
    min-width: 80px;
    white-space: nowrap;
    cursor: pointer;
}

.flight-header:hover {
    background-color: #3d4a5c;
}

.flight-header.sorted {
    background-color: #1a202c;
}

.flight-cell {
    position: sticky;
    left: 180px;
    z-index: 4;
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 0.375rem 0.5rem;
    text-align: center;
    font-size: 0.8125rem;
    border-right: 2px solid #4b5563;
    min-width: 80px;
    white-space: nowrap;
}

.flight-transfers {
    font-size: 0.6875rem;
    color: #9ca3af;
}

.country-flight-cell {
    background-color: #374151;
    font-weight: 500;
}

.region-flight-cell {
    background-color: #3d4654;
}

.region-row:nth-child(even) .region-flight-cell {
    background-color: #434d5c;
}
