.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.connection-section {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 20px;
}

.auth-section {
    display: flex;
    gap: 10px;
    grid-column: 1 / -1;
    margin: 10px 0;
}

.subscribe-section,
.publish-section {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 20px;
}

input {
    padding: 8px;
    margin-right: 10px;
    width: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#broker-url {
    width: 250px;
}

#broker-port {
    width: 60px;
}

select {
    padding: 8px;
    margin-right: 10px;
    width: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    background: #007bff;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

button:hover:not(:disabled) {
    background: #0056b3;
}

#connection-status {
    margin-top: 10px;
    font-weight: bold;
}

.messages-section {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #ccc;
    height: 400px;
    display: flex;
    flex-direction: column;
}

.messages-container {
    background: white;
    border-radius: 6px;
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
}

#messages {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.message {
    margin: 5px 0;
    padding: 5px;
    background-color: #f0f0f0;
    font-family: monospace;
    word-break: break-all;
}

.message.error {
    background-color: #ffebee;
    color: #c62828;
}

.message.warn {
    background-color: #fff3e0;
    color: #ef6c00;
}

.message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.message.info {
    background-color: #e3f2fd;
    color: #1565c0;
}

.message.message {
    background-color: #f5f5f5;
    color: #333;
}

.messages-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.control-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.control-item label {
    margin: 0;
    cursor: pointer;
}

#log-filter {
    padding: 5px;
    min-width: 120px;
    margin: 0;
}

.hidden {
    display: none;
}

.footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 0.9em;
    text-align: right;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link img {
    width: 24px;
    height: 24px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.social-link:hover img {
    opacity: 1;
}

.button-group {
    display: inline-flex;
    gap: 10px;
}

.subscribe-section input {
    width: 250px;
}

.stats-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    margin-top: 10px;
}

.stats-panel div {
    font-size: 0.9em;
    color: #666;
}

.stats-panel span {
    font-weight: bold;
    color: #333;
}

#subscribe-qos,
#publish-qos {
    width: 100px;
}
