/* ===================== CAMERA MODAL (shared) =====================
   Single source of truth for the camera capture modal. Every page that
   includes the #camera-modal markup must link this stylesheet (see the
   <link rel="stylesheet" href="/sonimarto/camera.css"> tags). Without it
   the modal renders unstyled: no full-screen overlay, no z-index, and the
   video does not cover the content. */
.camera-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.camera-modal-content {
    position: relative;
    z-index: 1;
    background: var(--card-bg, var(--bg-white, #ffffff));
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.camera-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e9f2;
    gap: 12px;
}

.camera-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #0b1430);
    letter-spacing: -0.01em;
}

.camera-switch-btn,
.camera-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f0f2f6;
    color: #4e5870;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.camera-switch-btn:hover,
.camera-modal-close:hover {
    background: #e5e9f2;
    color: var(--text-dark);
}

.camera-switch-btn:active,
.camera-modal-close:active {
    transform: scale(0.92);
}

.camera-viewport {
    position: relative;
    background: #000;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.camera-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-controls {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg, var(--bg-white, #ffffff));
    border-top: 1px solid #e5e9f2;
}

.camera-capture-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--primary, #1358ff);
    background: rgba(19, 88, 255, 0.1);
    color: var(--primary, #1358ff);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}

.camera-capture-btn:hover {
    transform: scale(1.05);
    background: rgba(19, 88, 255, 0.2);
}

.camera-capture-btn:active {
    transform: scale(0.95);
}

.camera-error {
    padding: 12px 20px;
    margin: 0;
    background: var(--danger-soft, #fef2f2);
    color: var(--danger, #dc2626);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border-top: 1px solid var(--danger-soft, #fecaca);
}
