/* Govee Dashboard - Chart Styles */
/* Styles for Apache ECharts integration */

/* ========================================
   CHART CONTAINERS
   ======================================== */

.charts-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.charts-header {
    text-align: center;
    margin-bottom: 30px;
}

.charts-header h2 {
    font-size: 2rem;
    background: linear-gradient(90deg, #00d9ff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.charts-header p {
    color: #888;
    font-size: 0.9rem;
}

.chart-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
}

.chart-wrapper {
    width: 100%;
    height: 400px;
    position: relative;
}

/* ========================================
   CHART CONTROLS
   ======================================== */

.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.chart-controls select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-controls select:hover {
    border-color: #00d9ff;
    background: rgba(0, 0, 0, 0.5);
}

.chart-controls select:focus {
    outline: none;
    border-color: #00d9ff;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

/* ========================================
   RANGE SELECTOR
   ======================================== */

.range-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

.range-label {
    color: #888;
    font-size: 0.85rem;
    margin-right: 5px;
}

.range-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
}

.range-btn.active {
    border-color: #00d9ff;
    background: rgba(0, 217, 255, 0.1);
    color: #00d9ff;
}

.range-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ========================================
   EXPORT BUTTON
   ======================================== */

.export-btn {
    padding: 10px 20px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
}

.export-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

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

/* ========================================
   LOADING & ERROR STATES
   ======================================== */

.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    z-index: 10;
}

.chart-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 217, 255, 0.2);
    border-top-color: #00d9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.chart-loading-text {
    color: #888;
    margin-top: 15px;
    font-size: 0.9rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.chart-error {
    padding: 40px 20px;
    text-align: center;
    color: #ff6b6b;
    font-size: 1rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ========================================
   STATISTICS CARDS
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.stat-label {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #00d9ff;
}

.stat-value.temperature {
    color: #ff6b6b;
}

.stat-value.humidity {
    color: #00d9ff;
}

.stat-value.dewpoint {
    color: #00ff88;
}

.stat-value.positive {
    color: #00ff88;
}

.stat-value.negative {
    color: #ff6b6b;
}

.stat-secondary {
    color: #666;
    font-size: 0.75rem;
    margin-top: 5px;
}

/* ========================================
   CHART TABS
   ======================================== */

.chart-tabs {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.chart-tab {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.chart-tab.active {
    background: linear-gradient(90deg, #00d9ff, #00ff88);
    color: #1a1a2e;
}

.chart-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ========================================
   DEVICE SELECTOR
   ======================================== */

.device-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.device-selector label {
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
}

.device-selector select {
    flex: 1;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

/* ========================================
   RESPONSIVE - MOBILE & SMARTWATCH
   ======================================== */

@media (max-width: 768px) {
    .chart-wrapper {
        height: 300px;
    }

    .chart-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .chart-tabs {
        flex-direction: column;
    }

    .range-selector {
        justify-content: space-between;
    }

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

@media (max-width: 450px) {
    .chart-wrapper {
        height: 250px;
    }

    .device-selector {
        flex-direction: column;
        align-items: stretch;
    }

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

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* ========================================
   ANIMATION UTILITIES
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-container {
    animation: fadeIn 0.5s ease-out;
}

.chart-container:nth-child(2) {
    animation-delay: 0.1s;
}

.chart-container:nth-child(3) {
    animation-delay: 0.2s;
}

/* ========================================
   CHART INFO BOX
   ======================================== */

.chart-info {
    background: rgba(0, 217, 255, 0.1);
    border-left: 3px solid #00d9ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #aaa;
}

.chart-info strong {
    color: #00d9ff;
}

/* ========================================
   NO DATA STATE
   ======================================== */

.no-data {
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.no-data-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-data-text {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.no-data-hint {
    font-size: 0.9rem;
    color: #555;
}
