* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-width: 600px;
    width: 100%;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
}

h2 {
    color: #555;
    font-size: 1.1em;
    margin-bottom: 12px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.status-panel,
.control-panel,
.log-panel {
    margin-bottom: 20px;
}

.status-panel p {
    font-size: 0.95em;
    color: #666;
}

#connection-status {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
}

.status-connected {
    color: #28a745;
    background-color: #d4edda;
}

.status-disconnected {
    color: #dc3545;
    background-color: #f8d7da;
}

.status-connecting {
    color: #ffc107;
    background-color: #fff3cd;
}

.btn-primary {
    width: 100%;
    padding: 12px 25px;
    font-size: 1em;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-success,
.btn-danger {
    padding: 12px 25px;
    font-size: 0.95em;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(220, 53, 69, 0.4);
}

.btn-primary:hover:not(:disabled),
.btn-success:active:not(:disabled),
.btn-danger:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled,
.btn-success:disabled,
.btn-danger:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#log-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 12px;
    max-height: 250px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.log-entry {
    padding: 6px;
    margin-bottom: 4px;
    border-radius: 5px;
    background: white;
    border-left: 4px solid #667eea;
}

.log-entry.success {
    border-left-color: #28a745;
}

.log-entry.error {
    border-left-color: #dc3545;
}

.log-entry.info {
    border-left-color: #17a2b8;
}

.log-time {
    color: #6c757d;
    font-size: 0.85em;
    margin-right: 10px;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.1em;
    }
}
