/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.1rem;
    color: #666;
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.sensor-selection, .chart-controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.sensor-selection h3, .chart-controls h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

/* Sensor list */
.sensor-list {
    max-height: 300px;
    overflow-y: auto;
}

.sensor-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sensor-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.sensor-item.selected {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

.sensor-checkbox {
    margin-right: 12px;
    transform: scale(1.2);
}

.sensor-name {
    font-weight: 600;
    flex: 1;
}

.sensor-value {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-left: 10px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Chart controls */
.chart-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.time-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-range label {
    font-weight: 600;
    color: #333;
}

.time-range select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.time-range select:focus {
    outline: none;
    border-color: #667eea;
}

/* Chart container */
.chart-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
    min-height: 600px;
}

#sensor-chart {
    max-height: 700px;
    min-height: 500px;
}

/* Sensor info */
.sensor-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.sensor-info h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.sensor-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.sensor-detail:last-child {
    border-bottom: none;
}

.sensor-detail-name {
    font-weight: 600;
    color: #333;
}

.sensor-detail-value {
    color: #667eea;
    font-weight: 600;
}

.sensor-detail-timestamp {
    font-size: 0.9rem;
    color: #666;
}

/* Responsywność */
@media (max-width: 768px) {
    .controls {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 10px;
    }
    
    .sensor-selection, .chart-controls, .chart-container, .sensor-info {
        padding: 20px;
    }
    
    .chart-container {
        min-height: 400px;
    }
    
    #sensor-chart {
        max-height: 500px;
        min-height: 350px;
    }
}

/* Animacje */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sensor-item, .sensor-detail {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar styling */
.sensor-list::-webkit-scrollbar {
    width: 8px;
}

.sensor-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.sensor-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.sensor-list::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}
