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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s;
}

.modal-close:hover,
.modal-close:focus {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.modal-body .form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s;
}

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

.modal-body .form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.85em;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

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

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

.modal-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.modal-actions .btn-secondary:hover {
    background: #5a6268;
}

.error-message {
    padding: 12px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    font-size: 0.9em;
}

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: 12px;
    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: 30px;
    text-align: center;
}

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

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

.connection-status {
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6c757d;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background: #28a745;
}

.status-indicator.disconnected {
    background: #dc3545;
    animation: none;
}

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

.main-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    padding: 30px;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.test-mode-toggle {
    padding: 12px 15px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.slider {
    position: relative;
    width: 38px;
    height: 20px;
    background: #ccc;
    border-radius: 20px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.slider:before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

input[type="checkbox"]:checked + .slider {
    background: #28a745;
}

input[type="checkbox"]:checked + .slider:before {
    transform: translateX(18px);
}

.toggle-label {
    font-weight: 500;
    color: #333;
    font-size: 0.9em;
}

.conversion-options h3 {
    margin-bottom: 15px;
    color: #333;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9em;
}

.checkbox-label:hover {
    background: #e9ecef;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

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

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

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

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
    flex: none;
}

.results-panel h3 {
    margin-bottom: 20px;
    color: #333;
}

.conversion-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.item-icon {
    font-size: 1.5em;
}

.item-name {
    font-weight: 600;
    flex: 1;
}

.item-status {
    font-size: 0.9em;
    padding: 4px 12px;
    border-radius: 12px;
    background: #6c757d;
    color: white;
}

.item-status.running {
    background: #17a2b8;
    animation: pulse 2s infinite;
}

.item-status.completed {
    background: #28a745;
}

.item-status.failed {
    background: #dc3545;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
    border-radius: 12px;
}

.item-stats {
    font-size: 0.9em;
    color: #6c757d;
}

.logs-panel {
    border-top: 1px solid #e9ecef;
    padding: 20px 30px;
    background: #1e1e1e;
    color: #d4d4d4;
    max-height: 300px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

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

.logs-header h3 {
    color: #fff;
}

.logs-content {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    white-space: pre-wrap;
}

.log-entry {
    margin-bottom: 4px;
}

.log-entry.success {
    color: #4ec9b0;
}

.log-entry.error {
    color: #f48771;
}

.log-entry.info {
    color: #9cdcfe;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2em;
    }
}

