* {
    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;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

h1 {
    background: linear-gradient(135deg, #4e54c8 0%, #8f94fb 100%);
    color: white;
    text-align: center;
    padding: 30px;
    margin: 0;
    font-size: 2.2rem;
    font-weight: 300;
}

.status-panel {
    background: #f8f9fa;
    padding: 25px;
    border-bottom: 1px solid #e9ecef;
}

.status-panel h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 500;
}

#status-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.status-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4e54c8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-item .label {
    display: block;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.status-item span:last-child {
    font-size: 1.1rem;
    color: #495057;
    font-weight: 500;
}

.controls {
    padding: 30px;
}

.control-group {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.control-group h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 500;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    min-width: 100px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ef7df9 0%, #f3455a 100%);
}

.btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #3d9afc 0%, #00e0fc 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #495057;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #96e6e2 0%, #fcc4d1 100%);
}

.btn-success {
    background: linear-gradient(135deg, #81fbb6 0%, #28d5ea 100%);
    color: white;
    width: 100%;
    font-size: 1.1rem;
    padding: 15px;
}

.btn-success:hover {
    background: linear-gradient(135deg, #6ff9a4 0%, #16c3d8 100%);
}

input[type="number"],
input[type="date"] {
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.95rem;
    flex: 1;
    min-width: 150px;
    transition: border-color 0.3s ease;
}

input[type="number"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: #4e54c8;
    box-shadow: 0 0 0 3px rgba(78, 84, 200, 0.1);
}

.message {
    margin: 20px 30px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

.message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.message-info {
    background: #cce7ff;
    border: 1px solid #99d5ff;
    color: #004085;
}

/* Debug Panel Styles */
.debug-panel {
    background: #1e1e1e;
    border-radius: 10px;
    margin: 20px 30px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #333;
}

.debug-panel.hidden {
    display: none;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2d2d2d;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
}

.debug-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

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

.debug-connection-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

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

.debug-connection-status.disconnected {
    background: #721c24;
    color: #f8d7da;
}

.debug-connection-status.error {
    background: #856404;
    color: #fff3cd;
}

.debug-messages {
    max-height: 400px;
    overflow-y: auto;
    background: #1e1e1e;
    color: #f8f8f2;
}

.debug-messages::-webkit-scrollbar {
    width: 6px;
}

.debug-messages::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.debug-messages::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.debug-messages::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.no-messages {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

.debug-message {
    border-bottom: 1px solid #333;
    transition: background-color 0.3s ease;
}

.debug-message.newest {
    background: #2a2a2a;
    border-left: 3px solid #4e54c8;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px 5px;
    background: #252525;
    font-size: 0.85rem;
}

.message-timestamp {
    color: #61dafb;
    font-weight: 500;
}

.message-number {
    color: #999;
    background: #333;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.message-content {
    padding: 0 15px 15px;
}

.message-content pre {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 12px;
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #f8f8f2;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }

    h1 {
        font-size: 1.8rem;
        padding: 20px;
    }

    .status-panel,
    .controls {
        padding: 20px;
    }

    #status-content {
        grid-template-columns: 1fr;
    }

    .button-row,
    .input-row {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    input[type="number"],
    input[type="date"] {
        width: 100%;
        min-width: auto;
    }

    .debug-panel {
        margin: 20px 10px;
        border-radius: 8px;
    }

    .debug-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 15px;
    }

    .debug-header h3 {
        font-size: 1rem;
    }

    .debug-messages {
        max-height: 300px;
    }

    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 8px 12px 5px;
    }

    .message-content pre {
        font-size: 0.75rem;
        padding: 8px;
    }
}