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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: none;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.left-column {
    flex: 1;
    min-width: 0;
}

.right-column {
    flex: 1;
    min-width: 0;
}

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

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

#librarySelect,
#cameraSelect {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

#librarySelect:hover:not(:disabled),
#cameraSelect:hover:not(:disabled) {
    border-color: #667eea;
}

#librarySelect:disabled,
#cameraSelect:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.button-group {
    display: flex;
    gap: 10px;
}

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

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

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

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

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

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

.scanner-container {
    position: relative;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    aspect-ratio: 4/3;
    max-height: 500px;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#video.mirrored {
    transform: scaleX(-1);
}

.scanner-container.scanning .scan-line {
    display: block;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

.status {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.status-text {
    font-weight: 600;
    color: #667eea;
}

.status.scanning .status-text {
    color: #4caf50;
}

.results {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.results h2 {
    margin-bottom: 20px;
    color: #667eea;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.result-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.result-item.success {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

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

.result-label {
    font-weight: 700;
    color: #555;
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-label:first-child {
    margin-top: 0;
}

.result-value {
    font-size: 18px;
    color: #333;
    word-break: break-all;
    padding: 10px;
    background: white;
    border-radius: 5px;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.barcode-type {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
}

.info-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.info-box h4 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 16px;
}

.info-box p {
    color: #856404;
    line-height: 1.6;
    margin-bottom: 8px;
}

.info-box ul {
    margin-left: 20px;
    color: #856404;
}

.info-box ul li {
    margin-bottom: 5px;
}

.info-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.info-section h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.barcode-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .scanner-container {
        max-height: 400px;
    }
}

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

.scanning-indicator {
    animation: pulse 1.5s ease-in-out infinite;
}
