/* ============================================================
   permit-photo-capture.css
   Full-screen camera takeover modal design system.
   Used by permit-photo-capture.js for dynamic modal injection.
   ============================================================ */

/* --- Backdrop --- */
.capture-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Modal container --- */
.capture-modal {
    height: 94vh;
    width: min(96vw, 840px);
    border-radius: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .capture-modal {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }
}

/* --- Stage (video + canvas wrapper) --- */
.capture-modal__stage {
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Video feed --- */
.capture-modal__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Guide overlay canvas --- */
.capture-modal__canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* --- Header toolbar (Cancel / Flip) --- */
.capture-modal__header {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
}

/* --- Icon buttons (Cancel ✕, Flip 🔄) --- */
.capture-modal__icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.capture-modal__icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Bottom controls bar --- */
.capture-modal__controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 20;
}

/* --- Instruction pill --- */
.capture-modal__instruction {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

/* --- Shutter button --- */
.capture-modal__shutter {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.capture-modal__shutter:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.5);
}

.capture-modal__shutter:active {
    transform: scale(0.95);
}

/* --- Review action bar (Retake / Use Photo) --- */
.capture-modal__review {
    display: flex;
    gap: 16px;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

/* --- Action buttons (shared) --- */
.capture-modal__btn {
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    flex: 1;
    text-align: center;
}

/* --- Retake (secondary) --- */
.capture-modal__btn--secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.capture-modal__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* --- Use Photo (primary) --- */
.capture-modal__btn--primary {
    background: #28a745;
    color: #fff;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.capture-modal__btn--primary:hover {
    background: #218838;
}

/* --- Roster CheckIn hover overlay --- */
.permit-photo-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.cursor-pointer {
    cursor: pointer;
}

[data-permit-photo-capture]:hover .permit-photo-hover-overlay {
    opacity: 1;
}
