* {
    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: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-indicator.online {
    background: #2ecc71;
    box-shadow: 0 0 10px #2ecc71;
}

.status-indicator.offline {
    background: #e74c3c;
}

.status-indicator.connecting {
    background: #f39c12;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.connection-panel, .control-panel, .logs-panel {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.connection-panel {
    background: #f8f9fa;
}

.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

input[type="text"] {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#connectBtn {
    background: #27ae60;
    color: white;
}

#connectBtn:hover:not(:disabled) {
    background: #219a52;
}

#disconnectBtn {
    background: #e74c3c;
    color: white;
}

#disconnectBtn:hover:not(:disabled) {
    background: #c0392b;
}

#ledOnBtn {
    background: #f39c12;
    color: white;
}

#ledOnBtn:hover:not(:disabled) {
    background: #e67e22;
}

#ledOffBtn {
    background: #7f8c8d;
    color: white;
}

#ledOffBtn:hover:not(:disabled) {
    background: #95a5a6;
}

.controls button {
    background: #3498db;
    color: white;
}

.controls button:hover {
    background: #2980b9;
}

.status-display {
    margin-top: 20px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

#deviceStatus {
    font-family: 'Courier New', monospace;
    background: #2c3e50;
    color: #ecf0f1;
    padding: 10px;
    border-radius: 5px;
    min-height: 40px;
}

.console {
    background: #1a1a1a;
    color: #00ff00;
    padding: 15px;
    border-radius: 8px;
    height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
}

.log-entry {
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 3px;
}

.log-entry:hover {
    background: #2a2a2a;
}

.timestamp {
    color: #888;
    margin-right: 10px;
}

.command { color: #f39c12; }
.response { color: #27ae60; }
.error { color: #e74c3c; }
.connection { color: #3498db; }
.info { color: #ecf0f1; }

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

h3 {
    color: #34495e;
    margin-bottom: 10px;
}