/**
 * Modern Minimalist Camera UI Styles
 * Enhanced camera interface with better focus on usability
 */

.camera-container {
    position: relative;
    margin-top: 15px;
    margin-bottom: 25px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 15px;
    background-color: #fafafa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.camera-container:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.12);
}

/* Make the camera view fill the container width with rounded corners */
#camera, #back-camera, #business-camera, #business-back-camera, #business-doc-camera {
    width: 100%;
    max-height: 450px;
    background-color: #000;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Add subtle border to active camera */
.camera-container video:not(.d-none) {
    border: 2px solid rgba(255, 107, 0, 0.6);
}

/* Modern button layout with better spacing */
.camera-container .btn-group {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 15px;
    gap: 8px;
    justify-content: center;
}

/* Minimalist button styling */
.camera-container .btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: none;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.camera-container .btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.camera-container .btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.camera-container .btn-secondary:hover {
    background-color: #e2e8f0;
    color: #334155;
}

/* Take Photo button */
.camera-container .btn-primary {
    background-color: #ff6b00;
    color: white;
}

.camera-container .btn-primary:hover {
    background-color: #e56000;
}

/* Switch camera button */
.btn-info {
    background-color: #f1f5f9;
    color: #0891b2;
    border-color: transparent;
}

.btn-info:hover {
    background-color: #e0f2fe;
    color: #0e7490;
}

/* Retake button */
.camera-container .btn-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

.camera-container .btn-danger:hover {
    background-color: #fecaca;
    color: #991b1b;
}

/* Improved preview container */
.preview-container {
    width: 100%;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 12px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.2s ease;
}

.preview-container img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Touch-to-focus indicator */
.focus-indicator {
    position: absolute;
    width: 70px;
    height: 70px;
    margin-left: -35px;
    margin-top: -35px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: focus-pulse 1s cubic-bezier(0, 0.2, 0.8, 1) forwards;
    pointer-events: none;
}

@keyframes focus-pulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    70% {
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .camera-container {
        margin-bottom: 30px;
        padding: 10px;
    }

    #camera, #back-camera, #business-camera, #business-back-camera, #business-doc-camera {
        max-height: 350px;
    }

    .camera-container .btn-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .camera-container .btn {
        flex: 1 0 140px;
        margin: 4px;
        border-radius: 6px;
        font-size: 13px;
    }

    .preview-container {
        padding: 8px;
    }

    .preview-container img {
        max-height: 350px;
    }
}

/* Camera feedback message */
.camera-feedback {
    text-align: center;
    font-size: 0.8rem;
    margin: 10px 0;
    padding: 6px 10px;
    border-radius: 6px;
    color: #64748b;
    background-color: rgba(241, 245, 249, 0.7);
    transition: all 0.2s ease;
}

.camera-feedback.text-danger {
    color: #b91c1c;
    background-color: #fee2e2;
}

/* Camera button icons */
.camera-container .btn i {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.camera-container .btn:hover i {
    transform: scale(1.1);
}

/* Error message for photos */
.photo-error-message {
    font-size: 0.75rem;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: #fee2e2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-top: 8px;
    border-left: 3px solid #b91c1c;
}

/* Add hint text for tap to focus */
.camera-container video:not(.d-none)::after {
    content: "Tap to focus";
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Enhanced Focus Indicator Styles */

/* Focus ring animation */
.focus-indicator {
    position: absolute;
    width: 80px;
    height: 80px;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    z-index: 10;
    pointer-events: none;
    animation: focus-animation 1s ease-out;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

@keyframes focus-animation {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 1;
    }
    70% {
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Focus hint text */
.camera-container:after {
    content: "Tap to focus";
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.camera-container:hover:after {
    opacity: 0.8;
}

/* Make camera container position relative to anchor the focus elements */
.camera-container {
    position: relative !important;
}

/* Add focus capability indicator dot */
.camera-feedback.focus-enabled:before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981; /* Green dot */
    border-radius: 50%;
    margin-right: 6px;
}

/**
 * Refined Camera UI Styles
 * With improved focus indicator and conditional styling
 */

/* Camera container base styles */
.camera-container {
    position: relative;
    margin-top: 15px;
    margin-bottom: 25px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 15px;
    background-color: #fafafa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.camera-container:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.12);
}

/* Video styles */
#camera, #back-camera, #business-camera, #business-back-camera, #business-doc-camera {
    width: 100%;
    max-height: 450px;
    background-color: #000;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Button styles */
.camera-container .btn-group {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 15px;
    gap: 8px;
    justify-content: center;
}

.camera-container .btn {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: none;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.camera-container .btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Button colors */
.camera-container .btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.camera-container .btn-secondary:hover {
    background-color: #e2e8f0;
    color: #334155;
}

.camera-container .btn-primary {
    background-color: #ff6b00;
    color: white;
}

.camera-container .btn-primary:hover {
    background-color: #e56000;
}

.btn-info {
    background-color: #f1f5f9;
    color: #0891b2;
    border-color: transparent;
}

.btn-info:hover {
    background-color: #e0f2fe;
    color: #0e7490;
}

.camera-container .btn-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

.camera-container .btn-danger:hover {
    background-color: #fecaca;
    color: #991b1b;
}

/* Preview container */
.preview-container {
    width: 100%;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 12px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.2s ease;
}

.preview-container img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Focus indicator - only shows when camera is active */
.focus-indicator {
    position: absolute;
    width: 80px;
    height: 80px;
    margin-left: -40px;
    margin-top: -40px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: focus-animation 1s ease-out;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

@keyframes focus-animation {
    0% {
        transform: scale(0.3);
        opacity: 1;
    }
    70% {
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Tap to focus hint - only shows when camera is active */
.camera-container:after {
    content: "";
    display: none; /* Hidden by default */
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    pointer-events: none;
    z-index: 50;
}

/* Only show the focus hint when camera is active */
.camera-container.camera-active:after {
    content: "Tap to focus";
    display: block;
    animation: fade-in 1s forwards;
    animation-delay: 1s;
    opacity: 0;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 0.8; }
}

/* Fade out the hint after 4 seconds */
.camera-container.camera-active:hover:after {
    animation: fade-out 1s forwards;
    animation-delay: 4s;
}

@keyframes fade-out {
    from { opacity: 0.8; }
    to { opacity: 0; }
}

/* Feedback message */
.camera-feedback {
    text-align: center;
    font-size: 0.8rem;
    margin: 10px 0;
    padding: 6px 10px;
    border-radius: 6px;
    color: #64748b;
    background-color: rgba(241, 245, 249, 0.7);
    transition: all 0.2s ease;
}

.camera-feedback.text-danger {
    color: #b91c1c;
    background-color: #fee2e2;
}

/* Button icons */
.camera-container .btn i {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.camera-container .btn:hover i {
    transform: scale(1.1);
}

/* Error message */
.photo-error-message {
    font-size: 0.75rem;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: #fee2e2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-top: 8px;
    border-left: 3px solid #b91c1c;
}

/* Handle cancel button positioning */
#cancelPhoto, #cancelBackPhoto, #cancelBusinessPhoto, 
#cancelBusinessBackPhoto, #cancelBusinessDocPhoto {
    background-color: #f8fafc;
    color: #64748b;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#cancelPhoto:hover, #cancelBackPhoto:hover, #cancelBusinessPhoto:hover, 
#cancelBusinessBackPhoto:hover, #cancelBusinessDocPhoto:hover {
    background-color: #f1f5f9;
    color: #475569;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .camera-container {
        margin-bottom: 30px;
        padding: 10px;
    }

    #camera, #back-camera, #business-camera, #business-back-camera, #business-doc-camera {
        max-height: 350px;
    }

    .camera-container .btn-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .camera-container .btn {
        flex: 1 0 40%;
        margin: 4px;
        font-size: 13px;
        padding: 6px 10px;
    }

    .camera-container:after {
        bottom: 50px;
        font-size: 11px;
    }

    .preview-container {
        padding: 8px;
    }

    .preview-container img {
        max-height: 350px;
    }
}