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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.status-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.label {
    font-weight: 600;
    color: #555;
}

.status {
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.status.connected {
    background: #4caf50;
    color: white;
}

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

.status-value {
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-weight: 600;
}

.control-panel {
    display: flex;
    gap: 15px;
    padding: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.btn-test {
    background: #ff9800;
    color: white;
    font-size: 0.9em;
    padding: 10px 20px;
}

.btn-test:hover:not(:disabled) {
    background: #fb8c00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

.info-panel {
    padding: 30px;
    display: grid;
    gap: 30px;
}

.info-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.info-section h3 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.3em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    font-weight: 600;
}

.stat-value {
    color: #667eea;
    font-size: 1.8em;
    font-weight: 700;
}

.log-container {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.6;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-timestamp {
    color: #858585;
    margin-right: 10px;
}

.log-event {
    color: #4ec9b0;
    font-weight: 600;
    margin-right: 10px;
}

.log-data {
    color: #ce9178;
}

.log-error {
    color: #f48771;
}

.log-success {
    color: #89d185;
}

.log-user {
    color: #569cd6;
}

.log-agent {
    color: #c586c0;
}

.test-panel {
    padding: 30px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.test-panel h3 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.3em;
}

.test-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.footer {
    background: #333;
    color: white;
    padding: 20px;
    text-align: center;
}

.footer p {
    margin: 5px 0;
}

.footer #serverUrl {
    color: #667eea;
    font-weight: 600;
}

.hint {
    opacity: 0.7;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Scrollbar styling */
.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status.connected {
    animation: pulse 2s infinite;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .control-panel {
        padding: 20px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
