/* Camera Button Container */
.dac-ocr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 10px 0;
}

/* Camera Button */
.dac-ocr-camera-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding-right: 8px;
    transition: transform 0.2s ease;
    margin: 0 auto;
    display: inline-block; /* Changed from block to inline-block */
}

.dac-ocr-camera-btn:hover {
    transform: scale(1.1);
}

.dac-ocr-camera-btn img {
    width: 40px;
    height: 40px;
}


/* Modal */
.dac-ocr-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.dac-ocr-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh; /* Limit height to 80% of viewport height */
    overflow-y: auto; /* Enable vertical scrolling */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Close Button */
.dac-ocr-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: sticky; /* Keep close button visible when scrolling */
    top: 0;
    background-color: #fefefe;
    z-index: 1;
}

.dac-ocr-close:hover,
.dac-ocr-close:focus {
    color: black;
    text-decoration: none;
}

/* Camera Container */
.dac-ocr-camera-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

#dac-ocr-video, #dac-ocr-canvas {
    width: 100%;
    max-width: 100%;
    background-color: #333;
    border-radius: 4px;
}

/* Controls */
.dac-ocr-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 5px 0;
}

.dac-ocr-controls button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.dac-ocr-controls button.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
    padding-left: 35px; /* Make space for the spinner */
}

.dac-ocr-controls button.loading:before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url('../images/loading-spinner.gif');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

#dac-ocr-capture-btn {
    background-color: #4CAF50;
    color: white;
}

#dac-ocr-retake-btn {
    background-color: #f44336;
    color: white;
}

#dac-ocr-scan-btn {
    background-color: #2196F3;
    color: white;
}

.dac-ocr-controls button:hover {
    opacity: 0.9;
}

/* Result */
.dac-ocr-result {
    margin: 15px 0;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

.dac-ocr-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 10px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
}

.dac-ocr-error {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
}

/* Loading */
.dac-ocr-loading {
    text-align: center;
    margin: 15px 0;
    color: #666;
}

/* Preserve existing styles from the existing CSS file */
#canvas {
    border: 1px dashed #ccc;
}

#image-preview {
    clip-path: rectangle(0 0 0 0);
    position: absolute;
}

.ui-resizable-handle {
    background-color: #fff;
    border: 1px solid #ddd;
    width: 5px;
    height: 5px;
}

.ui-resizable-handle.ui-resizable-se {
    bottom: -5px;
    right: -5px;
}

/* Responsive */
@media (max-width: 768px) {
    .dac-ocr-modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

.input-container {
	position: relative;
}
#message_value {
	padding-right: 40px; /* Dành không gian cho nút */
}