/* ==================== UPLOAD OPTIONS MODAL ==================== */
.upload-options-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.upload-options-modal.active {
    display: flex;
}

.upload-options-content {
    background: white;
    border-radius: 16px;
    padding: 30px 20px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

.upload-options-content h3 {
    text-align: center;
    margin: 0 0 30px 0;
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
}

.upload-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* When QR option is present (3 buttons), make it span full width */
.upload-options-grid .qr-option {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 14px;
    padding: 18px 24px;
    justify-content: center;
    border-color: #c4a94a;
}
.upload-options-grid .qr-option:hover {
    border-color: #e6c84e;
    background: #fefce8;
}
.upload-options-grid .qr-option i {
    font-size: 22px;
    color: #c4a94a;
    margin-bottom: 0;
}
.upload-options-grid .qr-option small {
    display: none;
}

.upload-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.upload-option-btn:hover {
    border-color: #bd4346;
    background: #fef2f2;
}

.upload-option-btn i {
    font-size: 32px;
    margin-bottom: 12px;
    color: #bd4346;
}

.upload-option-btn span {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 4px;
}

.upload-option-btn small {
    color: #6b7280;
    font-size: 12px;
    text-align: center;
}

.upload-options-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #6b7280;
    transition: all 0.3s ease;
}

.upload-options-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* ==================== CAMERA MODAL STYLES ==================== */
.camera-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.camera-modal.active {
    display: flex;
}

.camera-modal-content {
    width: 90vw;
    height: 90vh;
    max-width: 90vw;
    background: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.camera-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    z-index: 100;
    transition: background 0.3s ease;
}

.camera-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.camera-container {
    position: relative;
    width: 100%;
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    
}

.camera-preview-section {
    width: 100%;
    flex: 1;
    background: #000;
    min-height: 0;
}

.preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#capturedPreview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.camera-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 50;
}

.camera-control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.camera-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

.camera-actions {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: #2a2a2a;
    justify-content: center;
    flex-shrink: 0;
    z-index: 50;
}

.camera-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.cancel-btn {
    background: #555;
    color: white;
}

.cancel-btn:hover {
    background: #666;
}

.capture-btn {
    background: #bd4346;
    color: white;
    flex: 2;
}

.capture-btn:hover {
    background: #a03638;
}

.capture-btn:active {
    transform: scale(0.95);
}

/* .upload-btn {
    background: #10b981;
    color: white;
    flex: 1;
}

.upload-btn:hover {
    background: #059669;
} */

.camera-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#toggleFacingMode span {
    display: none;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .camera-modal-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        border-radius: 0;
    }

    .camera-container,
    .camera-preview-section {
        flex: 1;
    }

    #toggleFacingMode span {
        display: none;
    }
}

@media (max-width: 480px) {
    .upload-options-content {
        padding: 25px 15px;
    }

    .upload-option-btn {
        padding: 25px 15px;
    }

    .upload-option-btn i {
        font-size: 28px;
    }
}