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

.container {
    max-width: 1000px;
    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 20px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

header .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.content {
    padding: 30px;
}

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

.section h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

/* Camera Section */
.camera-section {
    border-left-color: #667eea;
}

.camera-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 15px;
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

canvas {
    display: none;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #5eccc9;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4eb3b0;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(94, 204, 201, 0.4);
}

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

.btn-danger:hover:not(:disabled) {
    background: #e53e3e;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(245, 101, 101, 0.4);
}

/* QR Section */
.qr-section {
    border-left-color: #5eccc9;
}

.data-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: horizontal;
    min-height: 120px;
    max-height: 200px;
    background: white;
}

.file-input {
    display: block;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 100%;
    cursor: pointer;
}

.file-input small {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.info-label {
    font-size: 12px;
    color: #666;
    background: white;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Codec Section */
.codec-section {
    border-left-color: #f6ad55;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Audio Section */
.audio-section {
    border-left-color: #48bb78;
}

.audio-player {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#audioPlayer {
    width: 100%;
    max-width: 500px;
}

.placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
}

/* Status Section */
.status-section {
    border-left-color: #9f7aea;
    margin-bottom: 0;
}

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

.status-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-item .label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
}

.status-item .value {
    font-weight: 700;
    color: #667eea;
    font-size: 13px;
}

.status-item .value.success {
    color: #48bb78;
}

.status-item .value.error {
    color: #f56565;
}

/* Messages */
.status-message {
    margin-top: 10px;
    padding: 12px;
    border-radius: 6px;
    display: none;
    font-size: 13px;
    border-left: 4px solid #667eea;
}

.status-message.show {
    display: block;
}

.status-message.success {
    background: #f0fdf4;
    border-left-color: #48bb78;
    color: #22c55e;
}

.status-message.error {
    background: #fef2f2;
    border-left-color: #f56565;
    color: #ef4444;
}

.status-message.info {
    background: #eff6ff;
    border-left-color: #667eea;
    color: #3b82f6;
}

.status-message.warning {
    background: #fffbeb;
    border-left-color: #f6ad55;
    color: #f59e0b;
}

/* Footer */
footer {
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 12px;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

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

    .content {
        padding: 15px;
    }

    .section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

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

    .info-row {
        flex-direction: column;
    }

    .info-label {
        width: 100%;
    }
}
