/* ==========================================================================
   FRYNZY CAMERA — CYPHER SPECIFICATION STYLES
   Edge-to-edge camera UI, iPhone aesthetics, audio visualizer, gallery viewer
   ========================================================================== */

/* 1. Camera Modal Container */
.frynzy-camera-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 100000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #ffffff;
    touch-action: pan-y !important;
    overscroll-behavior: none !important;
}

.frynzy-camera-modal.active {
    display: flex;
}

/* 2. Top Header Bar (Tête de l'écran) */
.frynzy-cam-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding-top: var(--sat, 28px);
    height: calc(56px + var(--sat, 28px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 14px;
    padding-right: 14px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.25) 70%, transparent 100%);
    z-index: 50;
    box-sizing: border-box;
    max-width: 100vw;
    overflow-x: hidden;
}

/* 3-Bars White Icon Without Background */
.frynzy-cam-icon-btn {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #ffffff !important;
    font-size: 22px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.frynzy-cam-icon-btn:active {
    transform: scale(0.88);
    opacity: 0.8;
}

/* Header Main Tools Group */
.frynzy-cam-header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.2s ease;
}

.frynzy-cam-header-tools.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

/* Sub-Options Dynamic Tray (Timer, HD, Flash) */
.frynzy-cam-options-tray {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 4px 8px;
    border-radius: 30px;
    animation: camSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: calc(100vw - 80px);
    overflow-x: auto;
    flex-shrink: 1;
    -webkit-overflow-scrolling: touch;
}

.frynzy-cam-options-tray::-webkit-scrollbar {
    display: none;
}

.frynzy-cam-options-tray.active {
    display: inline-flex;
}

@keyframes camSlideDown {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.frynzy-cam-pill-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.frynzy-cam-pill-btn.active {
    background: #ffffff;
    color: #000000 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.frynzy-cam-tool-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    position: relative;
    transition: transform 0.15s ease, background 0.15s ease;
}

.frynzy-cam-tool-btn.active {
    color: #facc15; /* Yellow accent when active */
}

.frynzy-cam-tool-badge {
    position: absolute;
    top: 2px;
    right: 0px;
    background: #facc15;
    color: #000;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 8px;
}

/* Custom robust Flash Icon with Slash for Off mode */
.frynzy-flash-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}
.frynzy-flash-icon-wrap i {
    font-size: 18px;
    line-height: 1;
}
.frynzy-flash-icon-wrap.flash-off i {
    opacity: 0.85;
}
.frynzy-flash-slash {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background-color: #ffffff;
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 2px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}
.frynzy-flash-icon-wrap.flash-off .frynzy-flash-slash {
    display: block;
}

.frynzy-cam-hd-badge {
    font-size: 14px;
    font-weight: 800;
    border: 1.5px solid #ffffff;
    padding: 1px 6px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.frynzy-cam-hd-badge.active {
    background: #facc15;
    color: #000;
    border-color: #facc15;
}

/* 3. Viewport (Camera Live Stream & Canvas) */
.frynzy-cam-viewport {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    background: #000000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#frynzyCamVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center center;
    transition: filter 0.2s ease, transform 0.05s linear;
    image-rendering: -webkit-optimize-contrast;
    will-change: transform;
}

#frynzyCamVideo.mirrored {
    transform: scaleX(-1) !important;
    -webkit-transform: scaleX(-1) !important;
}

/* 3x3 Composition Grid */
.frynzy-cam-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    z-index: 10;
}

.frynzy-cam-grid.active {
    display: grid;
}

.frynzy-cam-grid-cell {
    border: 0.5px solid rgba(255, 255, 255, 0.22);
}

/* Flash White-Out Overlay */
.frynzy-cam-flash-overlay {
    position: absolute;
    inset: 0;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: 80;
    transition: opacity 0.05s ease-out;
}

.frynzy-cam-flash-overlay.firing {
    opacity: 1;
}

/* Countdown Overlay (3s, 10s) */
.frynzy-cam-countdown-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 75;
    background: rgba(0, 0, 0, 0.35);
}

.frynzy-cam-countdown-number {
    font-size: 110px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
    animation: countdownPulse 0.95s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes countdownPulse {
    0% { transform: scale(1.4); opacity: 0; }
    40% { transform: scale(1); opacity: 1; }
    80% { transform: scale(0.95); opacity: 1; }
    100% { transform: scale(0.85); opacity: 0; }
}

/* Zoom Shortcuts Overlay (0.5x, 1x, 2x) */
.frynzy-cam-zoom-pills {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 24px;
    z-index: 25;
}

.frynzy-cam-zoom-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.frynzy-cam-zoom-btn.active {
    background: rgba(255, 255, 255, 0.25);
    color: #facc15;
    transform: scale(1.1);
}

/* Video Live Recording Badge */
.frynzy-cam-rec-badge {
    position: absolute;
    top: calc(16px + var(--sat, 28px));
    left: 50%;
    transform: translateX(-50%);
    background: rgba(220, 38, 38, 0.9);
    backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 60;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}

.frynzy-cam-rec-badge.active {
    display: inline-flex;
}

.frynzy-cam-rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    animation: recPulse 1s ease infinite;
}

@keyframes recPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* 4. Audio Waveform Visualizer Screen (Mode Enregistrement) */
.frynzy-cam-audio-view {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, #1e1b4b 0%, #09090b 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.frynzy-cam-audio-view.active {
    display: flex;
}

.frynzy-cam-audio-icon-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    border: 2px solid rgba(139, 92, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    font-size: 36px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.frynzy-cam-audio-icon-wrap.recording {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
    animation: micRecordPulse 1.5s infinite;
}

@keyframes micRecordPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.frynzy-cam-audio-timer {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}

.frynzy-cam-audio-canvas {
    width: 85%;
    max-width: 360px;
    height: 90px;
    background: transparent;
}

/* 4.1 iPhone Style Audio Mode Controls (Son Interne & Préréglages Studio) */
.frynzy-cam-audio-ctrls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    width: 90%;
    max-width: 360px;
    z-index: 30;
}

/* Toggle Son Interne - iPhone Pill Switch */
.frynzy-audio-internal-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 30px;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #10b981;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.frynzy-audio-internal-toggle:active {
    transform: scale(0.96);
}

.frynzy-audio-internal-toggle .frynzy-internal-icon {
    font-size: 14px;
    display: flex;
    align-items: center;
}

.frynzy-audio-internal-toggle .frynzy-internal-text {
    letter-spacing: 0.2px;
}

.frynzy-audio-internal-toggle .frynzy-internal-switch {
    width: 34px;
    height: 18px;
    border-radius: 12px;
    background: #10b981;
    position: relative;
    display: inline-block;
    transition: background 0.25s ease;
}

.frynzy-audio-internal-toggle .frynzy-internal-knob {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
    top: 2px;
    right: 2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Inactive state */
.frynzy-audio-internal-toggle.inactive {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #94a3b8;
}

.frynzy-audio-internal-toggle.inactive .frynzy-internal-switch {
    background: rgba(255, 255, 255, 0.25);
}

.frynzy-audio-internal-toggle.inactive .frynzy-internal-knob {
    transform: translateX(-16px);
}

/* Préréglages Studio - iOS Segmented Control */
.frynzy-audio-presets-segment {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 26px;
    padding: 3px;
    gap: 3px;
    width: 100%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.frynzy-audio-preset-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 5px;
    border-radius: 22px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    position: relative;
}

/* Badge ON / OFF sur les modules vocaux */
.frynzy-mod-badge {
    font-size: 8px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.frynzy-mod-badge.on,
.frynzy-audio-preset-btn.active .frynzy-mod-badge {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.tray-mod-tag {
    font-size: 8px;
    font-weight: 800;
    margin-left: 4px;
    padding: 1px 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
}

.frynzy-cam-pill-btn.active .tray-mod-tag {
    background: #10b981;
    color: #ffffff;
}

.frynzy-audio-preset-btn i {
    font-size: 12px;
}

.frynzy-audio-preset-btn:active {
    transform: scale(0.95);
}

.frynzy-audio-preset-btn.active {
    background: rgba(255, 255, 255, 0.26);
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Toast Rendu Asynchrone Hors-Thread */
.frynzy-audio-toast {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 16, 38, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #f1f5f9;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(139, 92, 246, 0.25);
    z-index: 60;
    animation: toastPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

@keyframes toastPopIn {
    from { opacity: 0; transform: translate(-50%, -10px) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.frynzy-audio-toast.success {
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(16, 185, 129, 0.3);
}

.frynzy-audio-toast.success i {
    color: #10b981;
}

/* 5. Filters Drawer / Tray */
.frynzy-cam-filters-tray {
    position: absolute;
    bottom: calc(140px + var(--sab, 48px));
    left: 0;
    right: 0;
    display: none;
    overflow-x: auto;
    padding: 10px 16px;
    gap: 14px;
    z-index: 45;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.frynzy-cam-filters-tray::-webkit-scrollbar {
    display: none;
}

.frynzy-cam-filters-tray.active {
    display: flex;
}

.frynzy-cam-filter-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.frynzy-cam-filter-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    overflow: hidden;
    background: #27272a;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.frynzy-cam-filter-chip.active .frynzy-cam-filter-preview {
    border-color: #facc15;
    transform: scale(1.12);
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
}

.frynzy-cam-filter-name {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.frynzy-cam-filter-chip.active .frynzy-cam-filter-name {
    color: #facc15;
    font-weight: 700;
}

/* 6. Mode Selector Bar (Photo, Vidéo, Enregistrement) */
.frynzy-cam-mode-bar {
    position: absolute;
    bottom: calc(90px + var(--sab, 48px));
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 40;
    height: 44px;
}

.frynzy-cam-modes-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    overflow: hidden;
    touch-action: pan-x;
}

.frynzy-cam-mode-item {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 16px;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.frynzy-cam-mode-item.active {
    color: #facc15;
    font-weight: 800;
    transform: scale(1.05);
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
}

/* 7. Bottom Shutter Row (Pied de l'écran) */
.frynzy-cam-shutter-row {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(90px + var(--sab, 48px));
    padding-bottom: var(--sab, 48px);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-left: 24px;
    padding-right: 24px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 65%, transparent 100%);
    z-index: 40;
    box-sizing: border-box;
}

.frynzy-cam-circle-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease;
}

.frynzy-cam-circle-btn:active {
    transform: scale(0.88);
    background: rgba(255, 255, 255, 0.35);
}

/* Dynamic Capture / Shutter Trigger Button */
.frynzy-cam-shutter-btn {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    background: transparent;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.frynzy-cam-shutter-btn:active {
    transform: scale(0.92);
}

.frynzy-cam-shutter-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Video Mode Shutter Styling */
.frynzy-cam-shutter-btn.video-mode .frynzy-cam-shutter-inner {
    background: #ef4444;
}

.frynzy-cam-shutter-btn.video-recording .frynzy-cam-shutter-inner {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ef4444;
    animation: shutterRecPulse 1.2s infinite;
}

/* Audio Mode Shutter Styling */
.frynzy-cam-shutter-btn.audio-mode .frynzy-cam-shutter-inner {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
}

.frynzy-cam-shutter-btn.audio-recording .frynzy-cam-shutter-inner {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ef4444;
    animation: shutterRecPulse 1.2s infinite;
}

@keyframes shutterRecPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.88); }
}

/* Circular Gallery Thumbnail Button */
.frynzy-cam-thumb-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    overflow: hidden;
    background: #18181b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    transition: transform 0.15s ease;
}

.frynzy-cam-thumb-btn:active {
    transform: scale(0.9);
}

.frynzy-cam-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 8. Camera Settings Modal (Opened from 3-Bars Icon) */
.frynzy-cam-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 100060;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: flex-end;
}

.frynzy-cam-settings-modal.active {
    display: flex !important;
}

.frynzy-cam-settings-sheet {
    width: 100%;
    max-height: 85vh;
    background: #ffffff;
    color: #0f172a;
    border-radius: 28px 28px 0 0;
    padding: 24px 20px calc(24px + var(--sab, 48px)) 20px;
    overflow-y: auto;
    box-sizing: border-box;
    animation: camSheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes camSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.frynzy-cam-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.frynzy-cam-settings-title {
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.frynzy-cam-settings-close {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frynzy-cam-settings-section {
    margin-bottom: 20px;
}

.frynzy-cam-settings-sec-title {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.frynzy-cam-settings-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.frynzy-cam-settings-row-label {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.frynzy-cam-settings-select {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    outline: none;
}

/* 9. Permission Denied Bottom Sheet (Fond Blanc Professionnel) */
.frynzy-cam-perm-modal {
    position: fixed;
    inset: 0;
    z-index: 100060;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    display: none;
    align-items: flex-end;
}

.frynzy-cam-perm-modal.active {
    display: flex;
}

.frynzy-cam-perm-card {
    width: 100%;
    background: #ffffff;
    color: #0f172a;
    border-radius: 28px 28px 0 0;
    padding: 28px 24px calc(24px + var(--sab, 48px)) 24px;
    box-sizing: border-box;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    animation: camSheetUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

.frynzy-cam-perm-icon-box {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    color: #2563eb;
    font-size: 30px;
    margin: 0 auto 18px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frynzy-cam-perm-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.frynzy-cam-perm-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 24px;
}

.frynzy-cam-perm-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.frynzy-cam-perm-btn-settings {
    background: #2563eb;
    color: #ffffff;
    border: none;
    font-size: 16px;
    font-weight: 700;
    padding: 15px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease, background 0.15s ease;
}

.frynzy-cam-perm-btn-settings:active {
    transform: scale(0.97);
    background: #1d4ed8;
}

.frynzy-cam-perm-btn-close {
    background: #f1f5f9;
    color: #475569;
    border: none;
    font-size: 15px;
    font-weight: 600;
    padding: 13px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.frynzy-cam-perm-btn-close:active {
    background: #e2e8f0;
}

/* 10. Captured Media Fullscreen Viewer (Visionneuse Plein Écran) */
.frynzy-cam-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 100070;
    background: #000000;
    color: #ffffff;
    display: none;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
}

.frynzy-cam-viewer-modal.active {
    display: flex;
}

.frynzy-cam-viewer-header {
    padding-top: var(--sat, 28px);
    height: calc(56px + var(--sat, 28px));
    padding-left: 16px;
    padding-right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 30;
    box-sizing: border-box;
}

.frynzy-cam-viewer-counter {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.frynzy-cam-viewer-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.frynzy-cam-viewer-body {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}

.frynzy-cam-viewer-content {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.frynzy-cam-viewer-audio-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 88%;
    max-width: 360px;
    padding: 26px 18px;
    background: rgba(20, 18, 38, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-sizing: border-box;
    overflow: hidden;
}

.frynzy-cam-viewer-audio-title {
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    width: 100%;
    max-width: 100%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
    box-sizing: border-box;
    padding: 0 6px;
}

#frynzyCamAudioPresetBadge {
    background: #8b5cf6;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 9px;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
}

.frynzy-cam-viewer-footer {
    padding-bottom: calc(16px + var(--sab, 48px));
    padding-left: 20px;
    padding-right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 30;
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════════════════
   13. QR CODE SCANNER OVERLAY & ANIMATIONS
   ══════════════════════════════════════════════════════════════════════ */
.frynzy-cam-qr-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
    transition: opacity 0.4s ease;
}

.frynzy-cam-qr-box {
    position: absolute;
    border: 2px solid rgba(99, 102, 241, 0.7);
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4), inset 0 0 15px rgba(99, 102, 241, 0.2);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    box-sizing: border-box;
}

.frynzy-cam-qr-box .qr-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: #6366f1;
    border-style: solid;
}

.frynzy-cam-qr-box .qr-corner.top-left {
    top: -2px; left: -2px;
    border-width: 4px 0 0 4px;
    border-top-left-radius: 14px;
}
.frynzy-cam-qr-box .qr-corner.top-right {
    top: -2px; right: -2px;
    border-width: 4px 4px 0 0;
    border-top-right-radius: 14px;
}
.frynzy-cam-qr-box .qr-corner.bottom-left {
    bottom: -2px; left: -2px;
    border-width: 0 0 4px 4px;
    border-bottom-left-radius: 14px;
}
.frynzy-cam-qr-box .qr-corner.bottom-right {
    bottom: -2px; right: -2px;
    border-width: 0 4px 4px 0;
    border-bottom-right-radius: 14px;
}

.qr-scan-laser {
    position: absolute;
    left: 4px; right: 4px; height: 2px;
    background: linear-gradient(90deg, transparent, #818cf8, #a5b4fc, transparent);
    box-shadow: 0 0 8px #818cf8;
    animation: qrLaserScan 2s ease-in-out infinite alternate;
}

@keyframes qrLaserScan {
    0% { top: 5%; opacity: 0.3; }
    50% { opacity: 1; }
    100% { top: 92%; opacity: 0.3; }
}

/* Floating Animated Circle / Pill Card Over QR Code */
.frynzy-cam-qr-pill {
    position: absolute;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(10, 15, 35, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(99, 102, 241, 0.5);
    border-radius: 30px;
    padding: 10px 18px 10px 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255,255,255,0.06) inset;
    pointer-events: auto;
    cursor: pointer;
    transform: translateX(-50%) scale(0.6);
    opacity: 0;
    animation: qrPillPopIn 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 25;
    max-width: calc(100% - 40px);
    min-width: 220px;
    transition: box-shadow 0.2s ease;
}

.frynzy-cam-qr-pill:active {
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    transform: translateX(-50%) scale(0.97);
}

@keyframes qrPillPopIn {
    0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
    70% { transform: translateX(-50%) scale(1.05); opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.qr-pill-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
}

.qr-pill-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.qr-pill-type {
    font-size: 10px;
    font-weight: 700;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.qr-pill-url {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.qr-pill-action-btn {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    color: #a5b4fc;
    font-size: 14px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


/* In-app QR Notification Banner */
.frynzy-cam-qr-banner {
    position: absolute;
    top: calc(14px + var(--sat, 28px));
    left: 16px;
    right: 16px;
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 18px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
    z-index: 50;
    animation: bannerSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    cursor: pointer;
    touch-action: pan-y;
    will-change: transform, opacity;
}

.frynzy-cam-qr-banner.swiping {
    transition: none !important;
}

.frynzy-cam-qr-banner.dismissing-left {
    transform: translateX(-120vw) !important;
    opacity: 0 !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease !important;
}

.frynzy-cam-qr-banner.dismissing-right {
    transform: translateX(120vw) !important;
    opacity: 0 !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease !important;
}

.qr-banner-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #818cf8;
    font-size: 16px;
    flex-shrink: 0;
}

.qr-banner-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.qr-banner-title {
    font-size: 11px;
    font-weight: 700;
    color: #818cf8;
    text-transform: uppercase;
}

.qr-banner-text {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-banner-open-btn {
    background: #6366f1;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════════
   14. STORAGE EXPLORER PICKER MODAL
   ══════════════════════════════════════════════════════════════════════ */
.frynzy-cam-storage-modal {
    position: fixed;
    inset: 0;
    z-index: 100080;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
}

.frynzy-cam-storage-sheet {
    width: 100%;
    max-height: 82vh;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 28px 28px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    animation: camSheetUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.frynzy-cam-storage-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.frynzy-cam-exp-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: #cbd5e1;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.frynzy-cam-storage-title-box {
    flex: 1;
    min-width: 0;
}

.frynzy-cam-storage-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.frynzy-cam-storage-breadcrumb {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.frynzy-cam-storage-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 52vh;
}

.frynzy-cam-storage-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.frynzy-cam-storage-item:active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.frynzy-cam-storage-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.frynzy-cam-storage-item-icon.volume {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.frynzy-cam-storage-item-icon.sd {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.frynzy-cam-storage-item-icon.folder {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.frynzy-cam-storage-item-info {
    flex: 1;
    min-width: 0;
}

.frynzy-cam-storage-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.frynzy-cam-storage-item-sub {
    font-size: 12px;
    color: #94a3b8;
}

.frynzy-cam-storage-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px calc(14px + var(--sab, 48px)) 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #0b1120;
}

.frynzy-cam-picker-btn {
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
}

.frynzy-cam-picker-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.frynzy-cam-picker-btn.primary {
    flex: 1;
    background: #6366f1;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

/* Dialog for New Folder */
.frynzy-cam-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100090;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.frynzy-cam-dialog-card {
    width: 100%;
    max-width: 320px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: camSheetUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.frynzy-cam-dialog-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 14px;
}

.frynzy-cam-dialog-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 16px;
    outline: none;
}

.frynzy-cam-dialog-input:focus {
    border-color: #6366f1;
}

.frynzy-cam-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.frynzy-cam-dialog-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.frynzy-cam-dialog-btn.cancel {
    background: transparent;
    color: #94a3b8;
}

.frynzy-cam-dialog-btn.submit {
    background: #6366f1;
    color: #ffffff;
}

/* ══════════════════════════════════════════════════════════════════════
   15. TAP-TO-FOCUS & EXPOSURE METERING RETICLE (CERCLE DE MISE AU POINT)
   ══════════════════════════════════════════════════════════════════════ */
.frynzy-cam-focus-ring {
    position: absolute;
    width: 76px;
    height: 76px;
    pointer-events: none;
    z-index: 55;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.15s ease;
}

.focus-ring-circle {
    width: 66px;
    height: 66px;
    border: 2px solid #facc15;
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.45), inset 0 0 8px rgba(250, 204, 21, 0.25);
    animation: focusReticlePulse 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes focusReticlePulse {
    0% { transform: scale(1.55); opacity: 0; }
    50% { transform: scale(0.92); opacity: 1; }
    100% { transform: scale(1.0); opacity: 1; }
}

.focus-exposure-slider {
    position: absolute;
    left: 78px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    width: 32px;
    height: 80px;
    justify-content: center;
}

.focus-sun-track {
    width: 2px;
    height: 64px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

.focus-sun-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #facc15;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    cursor: ns-resize;
    user-select: none;
    touch-action: none;
    transition: transform 0.08s ease;
}

.focus-sun-icon:active {
    transform: translate(-50%, -50%) scale(1.15);
}

