body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 900px;
    width: 100%;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.config-section {
    margin-bottom: 30px;
    text-align: center;
    padding: 20px;
    background-color: #eef2f7;
    border-radius: 6px;
}

.config-section input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 200px;
}

.panels {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.panel {
    flex: 1;
    min-width: 300px;
    padding: 20px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
}

.subscriber {
    background-color: #fff;
    border-top: 4px solid #3498db;
}

h2 {
    margin-top: 0;
    color: #444;
}

button {
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#connectBtn {
    background-color: #3498db;
    color: white;
}

#connectBtn:hover {
    background-color: #2980b9;
}

#disconnectBtn {
    background-color: #e74c3c;
    color: white;
}

#disconnectBtn:hover {
    background-color: #c0392b;
}

#disconnectBtn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.status-indicator {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    background-color: #f8f9fa;
    color: #7f8c8d;
}

.status-indicator.connected {
    background-color: #d4edda;
    color: #155724;
}

.qr-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    min-height: 128px; /* Reserve space */
}

.content-box {
    margin-top: 15px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px dashed #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1.2em;
    word-break: break-all;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#historyList {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid #eee;
}

#historyList li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
    color: #666;
}

.status-message {
    margin-top: 10px;
    font-size: 0.9em;
    min-height: 20px;
}

.success {
    color: #27ae60;
}

.error {
    color: #e74c3c;
}

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}
