/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: #2c3e50;
}

.platform-container {
    min-height: 100vh;
    padding: 20px;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Styles */
header {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Instructions Section */
.instructions-section {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.instructions-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #3498db;
    color: white;
    transition: background-color 0.3s ease;
    user-select: none;
}

.instructions-header:hover {
    background-color: #2980b9;
}

.instructions-header h2 {
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.toggle-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.instructions-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 20px;
}

.instructions-content.expanded {
    max-height: 1000px;
    padding: 20px;
}

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

.instruction-card {
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.instruction-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.instruction-icon {
    width: 50px;
    height: 50px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: #3498db;
    font-size: 24px;
}

.instruction-card h3 {
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 600;
}

.instruction-card p {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.6;
}

.color-legend {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.color-legend h3 {
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #2c3e50;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-block;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-control span {
    color: #2c3e50;
    font-weight: 500;
}

.header-left h1 {
    color: #2c3e50;
    font-size: 24px;
}

/* Sensor Values Section */
.sensor-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.sensor-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    min-height: 120px;
}

.sensor-card:hover {
    transform: translateY(-5px);
}

.sensor-card.disabled {
    opacity: 0.6;
}

.sensor-card.disabled .sensor-value {
    color: #999;
}

.sensor-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 50%;
    color: #3498db;
    margin-right: 15px;
    transition: all 0.3s ease;
}

.sensor-card:hover .sensor-icon {
    transform: scale(1.1);
    background-color: rgba(52, 152, 219, 0.2);
}

.sensor-info {
    flex: 1;
}

.sensor-info h3 {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 500;
}

.sensor-value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    display: block;
    line-height: 1.2;
}

.sensor-value span {
    font-size: 28px;
    font-weight: bold;
}

/* Charts Section */
.charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.chart-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    height: 300px;
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.chart-container {
    flex: 1;
    min-height: 0;
    position: relative;
}

/* Data Table Section */
.data-table-section {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Buttons */
.btn-secondary {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

.btn-secondary:hover {
    background-color: #2980b9;
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-left: 15px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sensor-values {
        grid-template-columns: 1fr;
    }
    
    .charts {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }

    .sensor-card {
        padding: 15px;
    }

    .sensor-icon {
        font-size: 32px;
        width: 50px;
        height: 50px;
    }

    .sensor-value {
        font-size: 24px;
    }
}

/* Update platform container for disabled state */
.platform-container.disabled {
    opacity: 0.6;
}

.platform-container.disabled .sensor-value,
.platform-container.disabled .chart-card,
.platform-container.disabled .data-table {
    pointer-events: none;
}

/* Alerts Section */
.alerts-section {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.alert-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.alerts-container {
    max-height: 200px;
    overflow-y: auto;
}

.alert-item {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

.alert-item.critical {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
}

.alert-item.warning {
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
}

.alert-item.info {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-icon {
    font-size: 20px;
}

.alert-message {
    font-size: 14px;
}

.alert-timestamp {
    font-size: 12px;
    color: #666;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Add to existing responsive design */
@media (max-width: 768px) {
    .alerts-section {
        padding: 15px;
    }
    
    .alert-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .alert-timestamp {
        align-self: flex-end;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
    }
    
    .instructions-header h2 {
        font-size: 16px;
    }
    
    .instructions-content.expanded {
        max-height: 1200px;
    }
}

/* Statistics Section */
.statistics-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.statistics-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    height: 300px;
}

.statistics-content {
    display: flex;
    height: calc(100% - 30px);
    gap: 20px;
}

.gauge-container {
    flex: 1;
    min-height: 0;
    position: relative;
}

.gauge {
    width: 100%;
    height: 100%;
}

.stats-values {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 120px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

/* Add to existing responsive design */
@media (max-width: 768px) {
    .statistics-section {
        grid-template-columns: 1fr;
    }
    
    .statistics-content {
        flex-direction: column;
    }
    
    .stats-values {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
        margin-top: 15px;
    }
    
    .stat-item {
        flex: 1;
        min-width: 100px;
    }
} 