/* GFCam Frontend Styles */

.gfcam-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
}

/* Desktop Upload Styles */
.gfcam-desktop-upload {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* FilePond Customization - Minimal overrides */

/* Mobile Camera Styles */
.gfcam-mobile-camera {
    width: 100%;
}

.gfcam-mobile-camera .gfcam-start-camera {
    width: 100%;
    padding: 20px;
    font-size: 18px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.gfcam-mobile-camera .gfcam-start-camera:hover {
    background-color: #005a87;
}

/* Modal Styles */
.gfcam-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gfcam-modal-content {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Camera Viewport */
.gfcam-camera-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

.gfcam-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gfcam-overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    object-fit: cover;
}

.gfcam-capture-canvas {
    display: none;
}

/* Detection Status Indicator */
.gfcam-detection-status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 12px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.gfcam-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: gfcam-pulse-slow 2s ease-in-out infinite;
}

.gfcam-status-indicator.status-searching {
    background-color: #ff9800;
}

.gfcam-status-indicator.status-detecting {
    background-color: #2196f3;
    animation: gfcam-pulse-fast 1s ease-in-out infinite;
}

.gfcam-status-indicator.status-ready {
    background-color: #4caf50;
    animation: none;
}

.gfcam-status-text {
    color: white;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

@keyframes gfcam-pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes gfcam-pulse-fast {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* Camera Controls - Default (for start button) */
.gfcam-camera-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    gap: 15px;
}

/* Camera Controls - Overlaid on Video (only in modal) */
.gfcam-modal .gfcam-camera-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    justify-content: space-between;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}

.gfcam-camera-controls button {
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: white;
    font-weight: 300;
}

.gfcam-close-camera {
    width: 44px;
    height: 44px;
    font-size: 32px;
    line-height: 1;
    font-weight: 200;
}

.gfcam-close-camera:hover {
    opacity: 0.7;
}

.gfcam-manual-capture {
    flex: 1;
    max-width: 70px;
    height: 70px;
    margin: 0 auto;
    background-color: white !important;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.gfcam-manual-capture:hover {
    transform: scale(1.05);
}

/* Preview Styles */
.gfcam-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background-color: #000;
}

.gfcam-preview-image {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.gfcam-preview-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

.gfcam-preview-controls button {
    flex: 1;
    padding: 15px 30px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.gfcam-retake {
    background-color: #dc3232;
    color: white;
}

.gfcam-retake:hover {
    background-color: #a82a2a;
    transform: translateY(-2px);
}

.gfcam-confirm {
    background-color: #46b450;
    color: white;
}

.gfcam-confirm:hover {
    background-color: #3a9641;
    transform: translateY(-2px);
}

/* Fallback Styles */
.gfcam-fallback {
    width: 100%;
}

.gfcam-fallback-input {
    width: 100%;
    padding: 12px;
    border: 2px dashed #ccc;
    border-radius: 5px;
    cursor: pointer;
}

.gfcam-fallback-input:hover {
    border-color: #0073aa;
}

/* Status Messages */
.gfcam-success {
    padding: 15px;
    margin-top: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    background-color: #f0f9f2;
    color: #46b450;
    border: 2px solid #46b450;
}

/* Uploading Overlay */
.gfcam-uploading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gfcam-uploading-message {
    background-color: white;
    padding: 30px 50px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #0073aa;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Entry Detail Display */
.gfcam-file-display {
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.gfcam-file-display a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.gfcam-file-display a:hover {
    text-decoration: underline;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .gfcam-camera-controls {
        padding: 15px;
    }

    .gfcam-close-camera {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }

    .gfcam-manual-capture {
        max-width: 60px;
        height: 60px;
    }

    .gfcam-preview {
        padding: 15px;
    }

    .gfcam-preview-controls {
        flex-direction: column;
        gap: 10px;
    }

    .gfcam-preview-controls button {
        width: 100%;
    }
}

/* FilePond Customization - Keep it simple */
.gfcam-container .filepond--root {
    margin-bottom: 0;
    font-family: inherit;
}

.gfcam-container .filepond--drop-label {
    min-height: 150px;
}

.gfcam-container .filepond--item {
    width: calc(50% - 0.5em);
}

@media (max-width: 768px) {
    .gfcam-container .filepond--item {
        width: 100%;
    }
}

/* Loading Animation */
@keyframes gfcam-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.gfcam-uploading-message::after {
    content: '...';
    animation: gfcam-pulse 1.5s ease-in-out infinite;
}

/* Smooth transitions */
.gfcam-camera-viewport,
.gfcam-preview {
    transition: opacity 0.3s ease;
}

/* Ensure modal is above everything */
.gfcam-modal {
    isolation: isolate;
}
