.scanner-container {
    max-width: 900px;
    margin: 0 auto;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.heading-scanner header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.heading-scanner h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 400;
    text-align: center;
}

.content-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    overflow: hidden;
    margin-bottom: 20px;
}

.media-container {
    width: 100%;
    min-height: 400px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.media-container.empty {
    min-height: 300px;
}

.placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.placeholder-text {
    font-size: 1.1rem;
    font-weight: 500;
}

video,
img {
    display: block;
    max-width: 100%;
    max-height: 62vh;
    width: auto;
    height: auto;
    margin: 0 auto;
}

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

canvas {
    display: none;
}

.btn-container {
    padding: 24px;
    background: white;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

button,
.btn {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

button:hover:not(:disabled),
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

button:active:not(:disabled),
.btn:active {
    transform: translateY(0);
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.btn-download {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-share {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-ocr {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.message-container {
    width: 100%;
    max-width: 900px;
    padding: 0 20px;
}

.message {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-loading {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #2563eb;
}

.message-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.message-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-actions {
    display: none;
    padding: 24px;
    background: #f9fafb;
    border-top: 2px solid #e5e7eb;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.result-actions.show {
    display: flex;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
}

/* OCR Result Modal */
.ocr-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.ocr-modal.show {
    display: flex;
}

.ocr-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ocr-header {
    padding: 24px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ocr-header h2 {
    font-size: 1.5rem;
    color: #1f2937;
    margin: 0;
}

.ocr-close {
    background: #ef4444;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ocr-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.ocr-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.ocr-text {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.ocr-footer {
    padding: 20px 24px;
    border-top: 2px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Improved Cropper Styles */
.cropper-point {
    width: 12px !important;
    height: 12px !important;
    background-color: #2563eb !important;
    border: 2px solid white !important;
    opacity: 1 !important;
}

.cropper-point.point-se {
    width: 16px !important;
    height: 16px !important;
}

.cropper-line {
    background-color: #2563eb !important;
    opacity: 0.3 !important;
}

.cropper-view-box {
    outline: 2px solid #2563eb !important;
    outline-color: rgba(37, 99, 235, 0.75) !important;
}

.cropper-face {
    background-color: rgba(37, 99, 235, 0.1) !important;
}

@media (max-width: 640px) {
    .scanner-container {
        padding: 12px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    button,
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }

    .btn-container {
        padding: 16px;
    }

    .media-container {
        min-height: 300px;
    }

    img {
        max-height: 50vh;
    }

    .cropper-point {
        width: 18px !important;
        height: 18px !important;
    }

    .ocr-content {
        max-height: 90vh;
    }

    .ocr-header h2 {
        font-size: 1.2rem;
    }
}