* {
    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;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 10px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Control Panel Section */
.control-panel {
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;

}

.control-panel h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.switches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.switch-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.3s ease;
}

.switch-card:hover {
    transform: translateY(-5px);
}

.switch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.switch-header h3 {
    font-size: 1.5rem;
    color: #333;
}

.status-badge {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.active {
    background: #ef4444;
    color: white;
    animation: pulse 2s infinite;
}

.status-badge.inactive {
    background: #10b981;
    color: white;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.toggle-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    background: #10b981;
}

.toggle-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.toggle-btn.active {
    background: #ef4444;
}

.toggle-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.last-update {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

/* Device Monitor Section */
.device-monitor {
    border-radius: 15px;
    padding: 20px;
}

.device-monitor h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 30px !important;
}

.device-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.device-status.online {
    background: #d1fae5;
    color: #065f46;
}

.device-status.offline {
    background: #fee2e2;
    color: #991b1b;
}

.refresh-info {
    margin-top: 15px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .switches {
        grid-template-columns: 1fr;
    }
    
    .control-panel, .device-monitor {
        padding: 10px;
    }
    
    th, td {
        padding: 5px;
        font-size: 0.9rem;
    }
}
