/**
 * MEO v6-mini - Tempest Weather Station Styles
 * File: assets/tempest.css
 * 
 * Original tempest.php styling - consistent sizing
 */

/* Base - consistent size throughout */
body {
    font-size: 0.95em;
    line-height: 1.4;
}

/* Sensor Navigation - proper size */
.sensor-selector {
    background: #2a2a2a;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
}

.sensor-selector a {
    margin: 0 5px;
    padding: 5px 10px;
    color: #4a9eff;
    text-decoration: none;
}

.sensor-selector a:hover {
    text-decoration: underline;
}

.sensor-selector a.active {
    color: #4aff4a;
}

/* Clean up refactored styles */
.sensor-nav {
    background: #2a2a2a;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
}

.sensor-nav a {
    display: inline-block;
    margin: 0 5px;
    padding: 5px 10px;
    color: #4a9eff;
    text-decoration: none;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    font-weight: normal;
}

.sensor-nav a:hover {
    background: none;
    text-decoration: underline;
    border: none;
}

.sensor-nav a.active {
    color: #4aff4a;
    background: none;
    border: none;
    box-shadow: none;
    font-weight: normal;
    text-shadow: none;
}

.sensor-nav .icon {
    font-size: 1.1em;
    filter: none;
}

/* Time selector - proper size */
.time-selector {
    background: #2a2a2a;
    padding: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.time-selector label {
    display: none;
}

.time-selector a {
    color: #4a9eff;
    text-decoration: none;
    margin: 0 10px;
    padding: 5px 10px;
    display: inline-block;
}

.time-selector a:hover {
    text-decoration: underline;
}

.time-selector a.active {
    color: #4aff4a;
}

/* Universal Mini Sensor Display System - Modern Sci-Fi */
.sensor-mini {
    max-width: 2000px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}

/* Main temperature display */
.sensor-mini .hero-temp {
    text-align: center;
    margin: 20px 0 50px 0;
    position: relative;
}

.sensor-mini .hero-temp .value {
    font-size: 7em;
    font-weight: 100;
    line-height: 1;
    color: #fff;
    letter-spacing: -0.02em;
}

.sensor-mini .hero-temp .label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 10px;
}

/* Time range pills (moved above hero) */
.sensor-mini .time-pills {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.sensor-mini .time-pills a {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 0.75em;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

.sensor-mini .time-pills a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #999;
    border-color: rgba(255, 255, 255, 0.15);
}

.sensor-mini .time-pills a.active {
    background: rgba(74, 158, 255, 0.15);
    color: #4a9eff;
    border-color: rgba(74, 158, 255, 0.3);
}

/* Updated Statistics Row for 5 items */
.sensor-mini .stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin: 40px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sensor-mini .stat {
    text-align: center;
}

.sensor-mini .stat .value {
    font-size: 1.8em;
    font-weight: 300;
    color: #fff;
    line-height: 1.2;
}

.sensor-mini .stat .label {
    font-size: 0.7em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 5px;
}

/* Responsive adjustment for smaller screens */
@media (max-width: 768px) {
    .sensor-mini .stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    /* Make the last two items span properly on mobile */
    .sensor-mini .stats-row .stat:nth-child(4) {
        grid-column: 1 / 2;
    }
    
    .sensor-mini .stats-row .stat:nth-child(5) {
        grid-column: 2 / 4;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .sensor-mini .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .sensor-mini .stats-row .stat:nth-child(5) {
        grid-column: 1 / 3;
        text-align: center;
    }
}

/* Temperature indices row */
.sensor-mini .indices-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 40px 0;
}

.sensor-mini .index {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.sensor-mini .index:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.sensor-mini .index .value {
    font-size: 2em;
    font-weight: 200;
    color: #4a9eff;
}

.sensor-mini .index .label {
    font-size: 0.7em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 8px;
}

/* Accent line */
.sensor-mini .accent-line {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(74, 158, 255, 0.3) 50%, transparent 100%);
    margin: 50px auto;
    max-width: 600px;
}

/* Chart container responsive height */
.sensor-mini .chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    margin: 30px 0;
    padding-bottom: 20px; /* Extra space for rotated labels */
}

/* Canvas should fill container */
.sensor-mini .chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Adjust chart height for mobile */
@media (max-width: 768px) {
    .sensor-mini .chart-container {
        height: 250px;
    }
}

/* Date Range Modal Styles */
.date-range-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-content h3 {
    margin: 0 0 20px 0;
    color: #4a9eff;
    font-size: 1.2em;
    font-weight: 400;
}

.date-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.date-inputs label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #999;
    font-size: 0.9em;
}

.date-inputs input[type="date"] {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: inherit;
    width: 60%;
    font-size: 0.9em;
}

.date-inputs input[type="date"]:focus {
    outline: none;
    border-color: #4a9eff;
    background: rgba(255,255,255,0.08);
}

/* Date Picker Modal Styles */
.date-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.date-picker-content {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
}

.date-picker-content h3 {
    margin: 0 0 20px 0;
    color: #4a9eff;
    font-size: 1.2em;
}

.date-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.date-inputs label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #999;
}

.date-inputs input[type="date"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: inherit;
    width: 200px;
}

.date-picker-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.date-picker-actions button {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.date-picker-actions button:first-child {
    background: #4a9eff;
    color: #000;
}

.date-picker-actions button:first-child:hover {
    background: #6ab4ff;
}

.date-picker-actions button:last-child {
    background: rgba(255, 255, 255, 0.1);
    color: #999;
}

.date-picker-actions button:last-child:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Quick range buttons */
.quick-ranges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.quick-ranges button {
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #999;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-ranges button:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.modal-actions button {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #999;
}

.cancel-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.apply-btn {
    background: #4a9eff;
    border: 1px solid #4a9eff;
    color: #000;
}

.apply-btn:hover {
    background: #5ab0ff;
    border-color: #5ab0ff;
}

/* Navigation - minimal */
.sensor-mini .nav-minimal {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.sensor-mini .nav-minimal a {
    color: #666;
    text-decoration: none;
    font-size: 0.8em;
    transition: color 0.2s;
}

.sensor-mini .nav-minimal a:hover {
    color: #4a9eff;
}

/* Responsive for mini displays */
@media (max-width: 600px) {
    .sensor-mini .hero-temp .value {
        font-size: 5em;
    }
    
    .sensor-mini .indices-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sensor-mini .stats-row {
        padding: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .sensors-grid,
    .status-grid,
    .summary-grid,
    .correlation-grid {
        grid-template-columns: 1fr;
    }
    
    .nav a {
        display: block;
        margin: 5px 0;
    }
}

.lightning-distance {
    text-align: center; 
    margin: -10px 0 20px 0; 
    color: #ff6b6b; 
    font-size: 1.1em;
}

.wind-gust-display {
    text-align: center; 
    margin: -10px 0 20px 0; 
    color: #999; 
    font-size: 1.1em;
}

.stats-row-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* ========== TEMPEST STATUS COLORS ========== */
/* Clean status colors - no overrides, just proper colors */

.system-status .stat .value.status-online {
    color: #4aff4a; /* Bright green for ONLINE */
}

.system-status .stat .value.status-warning {
    color: #f39c12; /* Orange for warnings */
}

.system-status .stat .value.status-offline {
    color: #ff4a4a; /* Red for offline */
}