/**
 * Tempest Weather Page Styles
 * Version: 2.0.0
 * 
 * Two-panel layout for comprehensive weather display
 * Follows Equipment Fleet and Art Gallery design patterns
 */

/* ============================================================================
   GUEST NOTICE BANNER
   ============================================================================ */

.tw-guest-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.40);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: #1e293b;
    flex-wrap: wrap;
}

.tw-guest-notice strong {
    color: #0f172a;
}

.tw-guest-notice a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.tw-guest-notice a:hover {
    text-decoration: underline;
}

/* ============================================================================
   MAIN CONTAINER & TWO-PANEL LAYOUT
   ============================================================================ */

.tw-weather-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    min-height: 700px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================================================
   LEFT PANEL (Selection)
   ============================================================================ */

.tw-selection-panel {
    background: var(--astroutah-bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--astroutah-border-light);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.tw-selection-content {
    overflow-y: auto;
    flex: 1;
    padding: 0;
}

/* Custom Scrollbar */
.tw-selection-content::-webkit-scrollbar {
    width: 8px;
}

.tw-selection-content::-webkit-scrollbar-track {
    background: var(--astroutah-bg-secondary);
}

.tw-selection-content::-webkit-scrollbar-thumb {
    background: var(--astroutah-border-light);
    border-radius: 4px;
}

.tw-selection-content::-webkit-scrollbar-thumb:hover {
    background: var(--astroutah-border-medium);
}

/* ============================================================================
   SELECTION GROUPS (Collapsible)
   ============================================================================ */

.tw-group {
    border-bottom: 1px solid var(--astroutah-border-dark);
}

.tw-group:last-child {
    border-bottom: none;
}

.tw-group-header {
    padding: 14px 20px;
    background: var(--astroutah-bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    transition: background 0.2s;
}

.tw-group-header:hover {
    background: var(--astroutah-bg-hover);
}

.tw-group-toggle {
    color: var(--astroutah-accent-blue);
    font-size: 12px;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.tw-group.expanded .tw-group-toggle {
    transform: rotate(90deg);
}

.tw-group-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--astroutah-text-primary);
}

.tw-group-icon {
    color: var(--astroutah-text-secondary);
    display: flex;
    align-items: center;
}

/* Group Items (Hidden when collapsed) */
.tw-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.tw-group.expanded .tw-group-items {
    max-height: 500px;
}

/* ============================================================================
   SELECTION ITEMS
   ============================================================================ */

.tw-item {
    padding: 12px 20px 12px 50px;
    background: var(--astroutah-bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.tw-item:hover {
    background: var(--astroutah-bg-hover);
    border-left-color: var(--astroutah-accent-blue);
}

.tw-item.selected {
    background: var(--astroutah-bg-selected);
    border-left-color: var(--astroutah-accent-blue-strong);
}

.tw-item-icon {
    color: var(--astroutah-text-secondary);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.tw-item.selected .tw-item-icon {
    color: var(--astroutah-accent-blue);
}

.tw-item-label {
    flex: 1;
    font-size: 14px;
    color: var(--astroutah-text-primary);
    font-weight: 500;
}

.tw-item.selected .tw-item-label {
    color: var(--astroutah-text-heading);
}

/* ============================================================================
   RIGHT PANEL (Display)
   ============================================================================ */

.tw-display-panel {
    background: var(--astroutah-bg-primary);
    border-radius: 12px;
    border: 1px solid var(--astroutah-border-light);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tw-display-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Custom Scrollbar for display */
.tw-display-container::-webkit-scrollbar {
    width: 10px;
}

.tw-display-container::-webkit-scrollbar-track {
    background: var(--astroutah-bg-primary);
}

.tw-display-container::-webkit-scrollbar-thumb {
    background: var(--astroutah-border-light);
    border-radius: 5px;
}

.tw-display-container::-webkit-scrollbar-thumb:hover {
    background: var(--astroutah-border-medium);
}

/* ============================================================================
   WELCOME MESSAGE
   ============================================================================ */

.tw-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    padding: 40px;
}

.tw-welcome-icon {
    color: var(--astroutah-accent-blue);
    margin-bottom: 20px;
}

.tw-welcome h3 {
    color: var(--astroutah-text-primary);
    font-size: 24px;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.tw-welcome p {
    color: var(--astroutah-text-secondary);
    font-size: 15px;
    line-height: 1.6;
    max-width: 500px;
    margin: 0;
}

/* ============================================================================
   CURRENT WEATHER DISPLAY
   ============================================================================ */

.tw-current-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, var(--astroutah-bg-selected) 0%, var(--astroutah-accent-blue-strong) 100%);
    border-radius: 12px;
    margin-bottom: 24px;
}

.tw-current-icon-large {
    flex-shrink: 0;
}

.tw-current-main {
    flex: 1;
}

.tw-current-temp {
    font-size: 48px;
    font-weight: 700;
    color: var(--astroutah-text-heading);
    margin: 0 0 8px 0;
}

.tw-current-condition {
    font-size: 18px;
    color: var(--astroutah-text-primary);
    margin: 0 0 4px 0;
}

.tw-current-feels-like {
    font-size: 14px;
    color: var(--astroutah-text-primary);
    margin: 0;
}


/* ============================================================================
   FORECAST DISPLAYS
   ============================================================================ */

/* Forecast Container */
.tw-forecast-container {
    background: var(--astroutah-bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--astroutah-border-light);
    padding: 24px;
}

.tw-forecast-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--astroutah-accent-blue-strong);
}

.tw-forecast-header h3 {
    color: var(--astroutah-accent-blue);
    font-size: 22px;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.tw-forecast-subtitle {
    color: var(--astroutah-text-secondary);
    font-size: 13px;
    margin: 0;
}

/* ============================================================================
   HOURLY FORECAST - LINE GRAPH
   ============================================================================ */

.tw-temp-graph-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 0;
}

/* Temperature Scale (Y-axis) */
.tw-temp-scale {
    position: absolute;
    left: 0;
    top: 20px;
    width: 40px;
    height: 200px;
    z-index: 1;
}

.tw-temp-scale-label {
    position: absolute;
    right: 8px;
    font-size: 12px;
    color: var(--astroutah-text-secondary);
    font-weight: 600;
    transform: translateY(-50%);
}

/* Graph Area */
.tw-temp-graph {
    position: relative;
    height: 200px;
    margin-left: 50px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 10px;
}

/* Grid Lines */
.tw-temp-grid-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

/* Temperature Line (SVG) */
.tw-temp-line-svg {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    overflow: visible;
}

.tw-temp-line {
    filter: drop-shadow(0 3px 6px rgba(59, 130, 246, 0.5));
}

/* Time Axis (X-axis) */
.tw-temp-time-axis {
    position: relative;
    height: 24px;
    margin-left: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
}

.tw-temp-time-label {
    position: absolute;
    top: 8px;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--astroutah-text-secondary);
    font-weight: 500;
}

/* Weather Icons Row */
.tw-temp-icons-row {
    position: relative;
    min-height: 50px;
    margin-left: 50px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tw-temp-icon-marker {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Legend */
.tw-temp-legend {
    display: flex;
    gap: 20px;
    padding-top: 16px;
    margin-left: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tw-temp-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--astroutah-text-secondary);
}

.tw-temp-legend-line {
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, var(--astroutah-error), var(--astroutah-accent-gold), var(--astroutah-accent-blue-strong));
    border-radius: 2px;
}

/* ============================================================================
   7-DAY FORECAST - TEMPERATURE RANGES
   ============================================================================ */

/* Forecast List */
.tw-forecast-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Forecast Row */
.tw-forecast-row {
    display: grid;
    grid-template-columns: 120px 50px 1fr 220px;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    background: var(--astroutah-bg-tertiary);
    border-radius: 8px;
    transition: all 0.2s;
}

.tw-forecast-row:hover {
    background: var(--astroutah-bg-hover);
    transform: translateX(4px);
}

/* Period Column */
.tw-forecast-period {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tw-forecast-period-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--astroutah-text-primary);
}

.tw-forecast-period-date {
    font-size: 11px;
    color: var(--astroutah-text-secondary);
}

/* Icon Column */
.tw-forecast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Daily Temperature Container */
.tw-daily-temp-container {
    position: relative;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    overflow: visible;
}

/* Temperature Range Bar */
.tw-forecast-range-bar {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--astroutah-accent-blue-strong) 0%, var(--astroutah-accent-gold) 100%);
    border-radius: 6px;
    transition: all 0.3s ease;
    z-index: 1;
    min-width: 40px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tw-forecast-range-bar:hover {
    filter: brightness(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Temperature Markers */
.tw-daily-temp-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: 700;
    color: var(--astroutah-text-heading);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    z-index: 3;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 4px;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tw-daily-temp-marker span {
    display: block;
}

.tw-daily-temp-low {
    background: rgba(59, 130, 246, 0.95);
    border: 1px solid rgba(96, 165, 250, 1);
}

.tw-daily-temp-high {
    background: rgba(251, 191, 36, 0.95);
    border: 1px solid rgba(252, 211, 77, 1);
}

/* Details Column */
.tw-forecast-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tw-forecast-condition {
    font-size: 13px;
    color: var(--astroutah-text-primary);
    font-weight: 500;
}

.tw-forecast-precip {
    font-size: 11px;
    color: var(--astroutah-accent-blue);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================================
   ASTRONOMY WIDGET
   ============================================================================ */
.tw-astronomy-widget-container {
    style="width: 100%; 
    min-height: 800px; 
    border: none; 
    border-radius: 12px; 
    background: var(--astroutah-bg-secondary);"    
}


   SATELLITE IMAGE
   ============================================================================ */

.tw-satellite-container {
    background: var(--astroutah-bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--astroutah-border-light);
    padding: 24px;
    margin-bottom: 20px;
}

.tw-satellite-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--astroutah-accent-blue-strong);
}

.tw-satellite-header h4 {
    color: var(--astroutah-accent-blue);
    font-size: 18px;
    margin: 0;
    font-weight: 600;
}

.tw-satellite-time {
    font-size: 12px;
    color: var(--astroutah-text-secondary);
}

.tw-satellite-image {
    border-radius: 8px;
    overflow: hidden;
    background: var(--astroutah-bg-tertiary);
}

.tw-satellite-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.tw-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--astroutah-text-secondary);
    font-size: 14px;
}

.tw-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--astroutah-border-light);
    border-top-color: var(--astroutah-accent-blue-strong);
    border-radius: 50%;
    animation: tw-spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes tw-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   ERROR STATE
   ============================================================================ */

.tw-error {
    background: #7f1d1d;
    border: 1px solid var(--astroutah-error);
    border-left: 3px solid var(--astroutah-error);
    border-radius: 8px;
    padding: 16px;
    color: #fecaca;
    font-size: 14px;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */




/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

.tw-group-header:focus,
.tw-item:focus {
    outline: 2px solid var(--astroutah-accent-blue);
    outline-offset: -2px;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .tw-weather-container {
        display: block;
    }
    
    .tw-selection-panel {
        display: none;
    }
    
    .tw-display-panel {
        background: white;
        color: black;
    }
}
/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
    .tw-weather-container {
        grid-template-columns: 320px 1fr;
    }
    
    .tw-forecast-row {
        grid-template-columns: 100px 45px 1fr 200px;
        gap: 12px;
        padding: 12px 14px;
    }
    
    .tw-temp-graph {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .tw-weather-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .tw-selection-panel {
        max-height: 400px;
    }
    
    .tw-current-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tw-forecast-row {
        grid-template-columns: 90px 40px 1fr;
        gap: 10px;
    }
    
    .tw-forecast-details {
        grid-column: 1 / -1;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 8px;
    }
    
    .tw-temp-graph {
        height: 150px;
        margin-left: 35px;
    }
    
    .tw-temp-scale {
        width: 30px;
    }
    
    .tw-temp-scale-label {
        font-size: 11px;
    }
    
    .tw-temp-time-axis,
    .tw-temp-icons-row,
    .tw-temp-legend {
        margin-left: 35px;
    }
}

@media (max-width: 480px) {
    .tw-display-container {
        padding: 16px;
    }
    
    .tw-current-temp {
        font-size: 36px;
    }
    
    .tw-forecast-container,
    .tw-satellite-container {
        padding: 16px;
    }
    
    .tw-forecast-row {
        grid-template-columns: 80px 35px 1fr;
        gap: 8px;
        padding: 10px 12px;
    }
    
    .tw-forecast-icon {
        transform: scale(0.85);
    }
    
    .tw-daily-temp-container {
        height: 32px;
    }
    
    .tw-daily-temp-marker {
        font-size: 12px;
        padding: 1px 4px;
    }
    
    .tw-temp-graph {
        height: 120px;
        margin-left: 25px;
    }
    
    .tw-temp-scale {
        width: 25px;
    }
    
    .tw-temp-scale-label {
        font-size: 10px;
    }
    
    .tw-temp-time-axis,
    .tw-temp-icons-row,
    .tw-temp-legend {
        margin-left: 25px;
    }
    
    .tw-temp-icon-marker {
        transform: translateX(-50%) scale(0.8);
    }
    
    .tw-temp-legend {
        flex-direction: column;
        gap: 8px;
    }
}
/* ============================================================
   Location Switcher -- custom dropdown inside .au-weather-location-bar
   ============================================================ */

.au-loc-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid rgba(255,255,255,0.25);
    padding-bottom: 1px;
    transition: border-color 0.15s ease;
}

.au-loc-switcher:hover,
.au-loc-switcher:focus { border-bottom-color: rgba(255,255,255,0.6); outline: none; }

.au-loc-switcher.is-switching { opacity: 0.6; pointer-events: none; }

.au-loc-arrow {
    color: rgba(255,255,255,0.55);
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.au-loc-switcher.is-open .au-loc-arrow { transform: rotate(180deg); }

/* Dropdown menu panel */
.au-loc-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    max-width: 280px;
    background: #1a2133;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 999;
}

.au-loc-switcher.is-open .au-loc-menu { display: block; }

/* Menu items — explicit light text on dark background */
.au-loc-item {
    padding: 10px 16px;
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.1s ease;
}

.au-loc-item:hover { background: rgba(255,255,255,0.08); color: #ffffff; }

.au-loc-item.is-active {
    color: #ffffff;
    font-weight: 600;
    background: rgba(96,165,250,0.15);
}

.au-loc-item.is-active::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #60a5fa;
    margin-right: 8px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}