.webcam-preview-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--bs-border-color);
}

.webcam-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.webcam-preview.mirrored {
    transform: scaleX(-1);
}

.webcam-preview.with-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 33.33% 33.33%;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    transition: opacity 0.3s ease;
}

.preview-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-icon {
    opacity: 0.5;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.overlay-text {
    font-size: 1.1rem;
    opacity: 0.7;
    margin: 0;
}

.snapshot-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--bs-border-color);
}

.snapshot-canvas {
    width: 100%;
    height: auto;
    display: block;
}

.camera-controls {
    padding: 1rem;
    background: var(--bs-light);
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .camera-controls {
    background: #1f1f1f;
}

/* Animation for camera starting */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.preview-overlay.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-indicator.active {
    background: #28a745;
    box-shadow: 0 0 8px #28a745;
}

.status-indicator.inactive {
    background: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .webcam-preview-wrapper {
        border-radius: 8px;
    }

    .overlay-icon {
        width: 48px;
        height: 48px;
    }

    .overlay-text {
        font-size: 0.95rem;
    }
}

/* Print hide */
@media print {
    .webcam-preview-wrapper,
    .snapshot-wrapper {
        display: none;
    }
}
