/* ===== Temperature & Humidity Page Styles ===== */

/* Current Reading Cards */
.current-reading-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.current-reading-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.current-reading-card.temperature-card {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, white 100%);
}

.current-reading-card.humidity-card {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, white 100%);
}

.reading-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.reading-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.temperature-card .reading-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.humidity-card .reading-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.reading-info {
    flex: 1;
}

.reading-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.reading-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.reading-trend {
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.reading-trend.positive {
    color: #10b981;
}

.reading-trend.negative {
    color: #ef4444;
}

.reading-chart-mini {
    height: 80px;
    margin-top: 1rem;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

/* ApexCharts specific enhancements */
.apexcharts-canvas {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.apexcharts-tooltip {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

.apexcharts-tooltip-title {
    background: transparent !important;
    border: none !important;
    color: #374151 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    margin-bottom: 4px !important;
}

.apexcharts-tooltip-series-group {
    background: transparent !important;
    color: #6b7280 !important;
}

.apexcharts-tooltip-marker {
    width: 8px !important;
    height: 8px !important;
    margin-right: 8px !important;
}

.apexcharts-legend {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    margin: 8px !important;
}

.apexcharts-legend-series {
    margin: 0 8px !important;
}

.apexcharts-legend-marker {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    margin-right: 6px !important;
}

.apexcharts-legend-text {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #374151 !important;
}

.apexcharts-toolbar {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 8px !important;
    padding: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.apexcharts-toolbar svg {
    fill: #6b7280 !important;
    transition: fill 0.2s ease !important;
}

.apexcharts-toolbar svg:hover {
    fill: #374151 !important;
}

.apexcharts-gridline {
    stroke: #e5e7eb !important;
    stroke-dasharray: 3 !important;
    opacity: 0.7 !important;
}

.apexcharts-xaxis-label,
.apexcharts-yaxis-label {
    fill: #6b7280 !important;
    font-size: 11px !important;
    font-weight: 400 !important;
}

.apexcharts-xaxis-title-text,
.apexcharts-yaxis-title-text {
    fill: #374151 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

/* Statistics Container */
.stats-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.stats-header h5 {
    margin: 0;
    font-weight: 600;
    color: #1f2937;
}

.time-range-selector {
    display: flex;
    gap: 0.5rem;
}

.time-range-selector .btn {
    border-radius: 6px;
    font-size: 0.875rem;
}

.stat-group {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.25rem;
    height: 100%;
}

.stat-group-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mini-stat-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.mini-stat-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mini-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* Analysis Cards */
.analysis-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
}

.analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.analysis-card.temperature-analysis {
    border-top: 3px solid #f59e0b;
}

.analysis-card.humidity-analysis {
    border-top: 3px solid #3b82f6;
}

.analysis-card.data-stats {
    border-top: 3px solid #10b981;
}

.analysis-card.environmental-status {
    border-top: 3px solid #8b5cf6;
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.analysis-header i {
    font-size: 1.25rem;
    color: #6b7280;
}

.analysis-header h6 {
    margin: 0;
    font-weight: 600;
    color: #1f2937;
}

.analysis-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.analysis-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.metric-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.metric-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.metric-value.trend-positive {
    color: #10b981;
}

.metric-value.trend-negative {
    color: #ef4444;
}

.analysis-note {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* Status Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.optimal {
    color: #10b981;
}

.status-indicator.above-average {
    color: #f59e0b;
}

.status-indicator.good {
    color: #3b82f6;
}

.status-indicator i {
    font-size: 1rem;
}

/* Insights Section */
.insights-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.insights-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.insights-header h5 {
    margin: 0;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.insight-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1.25rem;
    height: 100%;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.insight-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.insight-icon {
    margin-bottom: 1rem;
}

.insight-icon i {
    font-size: 2rem;
}

.insight-content h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.insight-content p {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* Chart Containers - Enhanced for ApexCharts */
.chart-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    height: 100%;
    max-height: 500px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.chart-container:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #FF6B35, #4ECDC4);
    border-radius: 16px 16px 0 0;
}

/* ApexCharts specific container adjustments */
.chart-container .apexcharts-canvas {
    background: transparent !important;
}

.chart-container .apexcharts-svg {
    background: transparent !important;
    border-radius: 8px;
}

/* Individual chart sizing */
#temperatureTrendChart,
#humidityTrendChart {
    min-height: 350px;
    max-height: 350px;
}

#combinedEnvironmentalChart {
    min-height: 400px;
    max-height: 400px;
}

#tempMiniChart,
#humidityMiniChart {
    min-height: 80px;
    max-height: 80px;
}

/* Chart container specific enhancements */
.row .col-12 .chart-container {
    max-height: 520px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 250, 251, 0.9) 100%);
    backdrop-filter: blur(10px);
}

/* Enhanced mini chart containers */
.current-reading-card .reading-chart-mini {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 8px;
    margin-top: 1rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.chart-title {
    margin: 0;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.chart-controls .btn {
    border-radius: 6px;
    font-size: 0.875rem;
}

.chart-controls .btn-group .btn {
    position: relative;
}

.chart-controls .btn-group .btn:hover {
    z-index: 2;
}

.chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Zoom control specific styling */
.chart-controls .btn-outline-primary {
    color: #3b82f6;
    border-color: #3b82f6;
}

.chart-controls .btn-outline-primary:hover {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.chart-controls .btn i {
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .reading-header {
        flex-direction: column;
        text-align: center;
    }
    
    .reading-icon {
        align-self: center;
    }
    
    .analysis-metric {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .insight-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .current-reading-card,
    .stats-container,
    .analysis-card,
    .chart-container,
    .insights-container {
        padding: 1rem;
    }
    
    .reading-value {
        font-size: 1.875rem;
    }
    
    .mini-stat-card {
        padding: 0.75rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

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

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }