/* Quagga2Text.css */
.Quagga2Text-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: 'Inter', sans-serif;
    text-align: center;
}

.Quagga2Text-container h2 {
    color: #333;
    margin-bottom: 20px;
}

.viewport {
    width: 100%;
    height: 400px; /* Adjust as needed */
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden; /* Ensure video stays within bounds */
    position: relative; /* For QuaggaJS overlay */
    margin-bottom: 20px;
}

/* QuaggaJS specific styles for the video and canvas */
.viewport > video, .viewport > canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures video covers the area without distortion */
    border-radius: 8px;
}

.controls {
    margin-bottom: 20px;
}

.button {
    background-color: #0073aa;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 0 5px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.button:hover {
    background-color: #005177;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

.button-secondary {
    background-color: #666;
}

.button-secondary:hover {
    background-color: #444;
}

.results {
    background: #e9e9e9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    text-align: left;
    margin-top: 20px;
}

.results p {
    margin: 5px 0;
    color: #555;
}

.results strong {
    color: #333;
}

#barcode-result {
    font-weight: bold;
    color: #0073aa;
}

#Quagga2Text-status {
    font-style: italic;
    color: #888;
}

.messages {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
}

.messages p {
    margin: 0;
}

.info-message {
    background-color: #e0f7fa;
    color: #006064;
    border: 1px solid #b2ebf2;
}

.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .Quagga2Text-container {
        margin: 10px;
        padding: 15px;
    }

    .viewport {
        height: 300px;
    }

    .button {
        padding: 8px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .viewport {
        height: 250px;
    }

    .button {
        display: block;
        width: calc(100% - 10px);
        margin: 10px auto;
    }
}

