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

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

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

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

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

.mode-switcher {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 30px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.mode-btn {
    flex: 1;
    padding: 15px 30px;
    border: none;
    background: #f8f9fa;
    color: #666;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.mode-btn:hover:not(.active) {
    background: #e9ecef;
}

.mode-content {
    display: none;
    min-height: 600px;
}

.mode-content.active {
    display: block;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

.input-section, .results-section {
    padding: 30px;
}

.input-section {
    border-right: 1px solid #eee;
    background: #f8f9fa;
}

.section-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-method {
    margin-bottom: 30px;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: #4facfe;
    background: #f0f8ff;
}

.radio-option.active {
    border-color: #4facfe;
    background: #4facfe;
    color: white;
}

.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #4facfe;
    background: #f0f8ff;
}

.file-upload-area.dragover {
    border-color: #4facfe;
    background: #e8f4f8;
}

.webcam-section {
    display: none;
}

.webcam-section.active {
    display: block;
}

video {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.recording-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

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

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

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

.btn-danger:hover {
    background: #c82333;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.text-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

.text-input:focus {
    outline: none;
    border-color: #4facfe;
}

.hint-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

.hint-input:focus {
    outline: none;
    border-color: #4facfe;
}

.options-group {
    margin-bottom: 20px;
}

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

.select-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    margin-bottom: 15px;
}

.status-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

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

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

.status-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4facfe;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.result-text {
    font-size: 1.2em;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.result-meta {
    font-size: 0.9em;
    color: #666;
}

.sign-video-result {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.download-btn {
    background: #28a745;
    color: white;
    margin-top: 10px;
}

.download-btn:hover {
    background: #218838;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .input-section {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .radio-group {
        flex-direction: column;
    }

    .mode-switcher {
        flex-direction: column;
        margin: 20px;
    }
}