* {
    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 {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #333;
    font-size: 28px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    transition: background-color 0.3s;
}

.status-dot.connected {
    background-color: #4caf50;
    box-shadow: 0 0 10px #4caf50;
}

#statusText {
    font-weight: 500;
    color: #666;
}

.button-container {
    padding: 15px 0;
}

.action-button {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #667eea;
    color: white;
}

.action-button:hover:not(:disabled) {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.action-button:active:not(:disabled) {
    transform: translateY(0);
}

.action-button:disabled {
    background-color: #ddd;
    cursor: not-allowed;
    opacity: 0.6;
}

.interfaces-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.interface-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.interface-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.interface-header {
    margin-bottom: 15px;
}

.interface-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.interface-info {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.switch-label {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.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;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4caf50;
}

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

input:disabled + .slider {
    background-color: #ddd;
    cursor: not-allowed;
}

.channel-status {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.channel-status-title {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.channel-values {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.channel-value {
    background-color: #f5f5f5;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.channel-value.active {
    background-color: #4caf50;
    color: white;
}

/* Loading Animation */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.interface-card {
    position: relative;
}

.interface-card.loading .switch,
.interface-card.loading .action-button {
    pointer-events: none;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .interfaces-container {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: column;
        gap: 15px;
    }
}
