* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.status-bar {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-label {
    font-weight: 600;
    margin-right: 10px;
}

.status {
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status.connected {
    background: #10b981;
    color: white;
}

.status.disconnected {
    background: #ef4444;
    color: white;
}

.status.connecting {
    background: #f59e0b;
    color: white;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #667eea;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input:disabled,
.form-group textarea:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
    margin-left: 10px;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.subscriptions-list {
    margin-top: 15px;
}

.subscription-item {
    background: #f3f4f6;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subscription-topic {
    font-family: monospace;
    font-weight: 600;
}

.messages-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.messages-log {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px;
    background: #f9fafb;
}

.message-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-topic {
    font-family: monospace;
    font-weight: 600;
    color: #667eea;
}

.message-time {
    font-size: 0.75rem;
    color: #6b7280;
}

.message-payload {
    font-family: monospace;
    background: #f3f4f6;
    padding: 8px;
    border-radius: 4px;
    word-break: break-all;
}

.empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 40px 20px;
    font-style: italic;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.75rem;
    }

    .container {
        padding: 0;
    }

    .btn-secondary {
        margin-left: 0;
        margin-top: 10px;
    }
}
