/* ============================================================================
 * zen/components/phone-mock/phone-mock.css
 * ----------------------------------------------------------------------------
 * Smartphone mockup — iPhone-like frame with a viewport that hosts either a
 * lockscreen notification (push alert) or an app content (Slack-style message,
 * access-request approval).
 *
 * HTML:
 *   <div class="zen-phone-mock" data-at="50% 50%">
 *       <div class="zen-phone-mock__frame">
 *           <div class="zen-phone-mock__notch"></div>
 *           <div class="zen-phone-mock__statusbar">...</div>
 *           <div class="zen-phone-mock__screen">
 *               ...lockscreen or app content...
 *           </div>
 *       </div>
 *   </div>
 *
 * Variants: `.zen-phone-mock--arcade` (default) / `.zen-phone-mock--sober`.
 * States:   `.a-active` / `.a-past` / `.a-dimmed`.
 * ============================================================================ */

.zen-phone-mock {
    --pm-bg:       #0B0E18;
    --pm-bg2:      #10162A;
    --pm-frame:    #0A0C14;
    --pm-border:   #232a45;
    --pm-text:     #E8ECF7;
    --pm-muted:    #8C94B0;
    --pm-accent:   var(--violet);
    --pm-accent2:  var(--pink);
    --pm-accent3:  var(--cyan);
    --pm-glow:     rgba(124, 58, 237, 0.55);
    --pm-glow-pink: rgba(244, 114, 182, 0.4);
    --pm-radius:   48px;
    --pm-w:        360px;
    --pm-h:        720px;
}

/* Root ---------------------------------------------------------------------- */
.zen-phone-mock {
    position: absolute;
    width: var(--pm-w);
    height: var(--pm-h);
    color: var(--pm-text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: all 0.6s var(--ease-natural, cubic-bezier(.16,1,.3,1));
    opacity: 0.95;
}
.zen-phone-mock.a-active {
    opacity: 1;
    filter: drop-shadow(0 0 40px var(--pm-glow-pink)) drop-shadow(0 0 80px var(--pm-glow));
}
.zen-phone-mock.a-past   { opacity: 0.55; filter: grayscale(0.3); }
.zen-phone-mock.a-dimmed { opacity: 0.15; }

/* Physical frame ------------------------------------------------------------ */
.zen-phone-mock__frame {
    position: relative;
    width: 100%; height: 100%;
    background: linear-gradient(160deg, #1a1f33 0%, #0a0c16 55%, #050710 100%);
    border-radius: var(--pm-radius);
    padding: 14px;
    box-sizing: border-box;
    box-shadow:
        0 0 0 2px rgba(124,58,237,0.45),
        0 0 0 3px rgba(0,0,0,0.4) inset,
        0 30px 80px rgba(0,0,0,0.7);
    overflow: hidden;
    isolation: isolate;
}

/* Arcade vs sober variant --------------------------------------------------- */
.zen-phone-mock,
.zen-phone-mock--arcade {}

.zen-phone-mock--arcade .zen-phone-mock__frame {
    box-shadow:
        0 0 0 2px var(--pm-accent),
        0 0 0 4px rgba(244,114,182,0.25),
        0 0 40px var(--pm-glow),
        0 0 80px var(--pm-glow-pink),
        0 30px 80px rgba(0,0,0,0.7);
}

.zen-phone-mock--sober .zen-phone-mock__frame {
    box-shadow:
        0 0 0 1.5px var(--pm-border),
        0 20px 50px rgba(0,0,0,0.55);
}

/* Subtle scanline overlay (arcade only) */
.zen-phone-mock--arcade .zen-phone-mock__frame::after {
    content: '';
    position: absolute; inset: 14px;
    border-radius: calc(var(--pm-radius) - 14px);
    background: repeating-linear-gradient(
        0deg,
        rgba(255,255,255,0.00) 0,
        rgba(255,255,255,0.00) 2px,
        rgba(124,58,237,0.035) 2px,
        rgba(124,58,237,0.035) 3px
    );
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 4;
}

/* Notch + speaker bar ------------------------------------------------------- */
.zen-phone-mock__notch {
    position: absolute;
    top: 20px;
    left: 50%; transform: translateX(-50%);
    width: 120px; height: 28px;
    background: #050710;
    border-radius: 0 0 16px 16px;
    z-index: 3;
}
.zen-phone-mock__notch::before {
    content: '';
    position: absolute;
    top: 9px; left: 50%; transform: translateX(-50%);
    width: 50px; height: 4px;
    background: #181e33;
    border-radius: 3px;
}
.zen-phone-mock__notch::after {
    content: '';
    position: absolute;
    top: 8px; right: 18px;
    width: 6px; height: 6px;
    background: #2a3050;
    border-radius: 50%;
}

/* Screen -------------------------------------------------------------------- */
.zen-phone-mock__screen {
    position: relative;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, var(--pm-bg), var(--pm-bg2));
    border-radius: calc(var(--pm-radius) - 14px);
    padding: 44px 16px 20px 16px;
    box-sizing: border-box;
    overflow: hidden;
    display: flex; flex-direction: column; gap: 14px;
}

/* Status bar inside screen */
.zen-phone-mock__statusbar {
    position: absolute;
    top: 18px;
    left: 28px; right: 28px;
    display: flex; align-items: center;
    font-size: 12px; font-weight: 600;
    color: var(--pm-text);
    z-index: 2;
}
.zen-phone-mock__statusbar__time { min-width: 40px; }
.zen-phone-mock__statusbar__spacer { flex: 1; }
.zen-phone-mock__statusbar__icons { display: inline-flex; gap: 5px; opacity: 0.85; }
.zen-phone-mock__statusbar__icons svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* Lockscreen ---------------------------------------------------------------- */
.zen-phone-mock__lockscreen {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px;
    padding-top: 18px;
}
.zen-phone-mock__lockscreen__date {
    font-size: 13px; color: var(--pm-muted);
    text-transform: uppercase; letter-spacing: 0.4px;
}
.zen-phone-mock__lockscreen__time {
    font-size: 68px; font-weight: 200;
    line-height: 1;
    color: var(--pm-text);
    text-shadow: 0 0 18px rgba(244,114,182,0.25);
    font-family: 'SF Pro Display', 'Segoe UI', sans-serif;
}

/* Notification card --------------------------------------------------------- */
.zen-phone-mock__notif-card {
    padding: 12px 14px;
    background: rgba(20,25,45,0.78);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(124,58,237,0.4);
    border-radius: 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px 12px;
    align-items: start;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}
.zen-phone-mock__notif-card__icon {
    grid-row: 1 / 3;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--pm-accent), var(--pm-accent2));
    color: #fff;
    border-radius: 9px;
    font-weight: 700; font-size: 16px;
    box-shadow: 0 0 14px var(--pm-glow);
}
.zen-phone-mock__notif-card__app {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--pm-accent2);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.zen-phone-mock__notif-card__time {
    font-size: 11px;
    color: var(--pm-muted);
    justify-self: end;
}
.zen-phone-mock__notif-card__title {
    grid-column: 2 / 4;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--pm-text);
}
.zen-phone-mock__notif-card__body {
    grid-column: 2 / 4;
    font-size: 12.5px;
    color: var(--pm-muted);
    line-height: 1.4;
}

/* Alerte / critical variant */
.zen-phone-mock__notif-card--alert {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 24px rgba(239,68,68,0.3), 0 8px 24px rgba(0,0,0,0.45);
}
.zen-phone-mock__notif-card--alert .zen-phone-mock__notif-card__icon {
    background: linear-gradient(135deg, #DC2626, #F97316);
    box-shadow: 0 0 14px rgba(239,68,68,0.5);
}
.zen-phone-mock__notif-card--alert .zen-phone-mock__notif-card__app {
    color: #fb7185;
}

/* Slack app view ------------------------------------------------------------ */
.zen-phone-mock__slack-header {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 4px 10px 4px;
    border-bottom: 1px solid var(--pm-border);
    font-size: 12px;
    color: var(--pm-muted);
}
.zen-phone-mock__slack-header__channel {
    color: var(--pm-text); font-weight: 700; font-size: 14px;
}
.zen-phone-mock__slack-header__icon {
    width: 24px; height: 24px;
    background: linear-gradient(135deg, #4A154B, #ECB22E);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 12px;
}

.zen-phone-mock__slack-message {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 10px;
    padding: 10px 2px;
}
.zen-phone-mock__slack-message__avatar {
    grid-row: 1 / 4;
    width: 30px; height: 30px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--pm-accent), var(--pm-accent3));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 13px;
    box-shadow: 0 0 10px var(--pm-glow);
}
.zen-phone-mock__slack-message__user {
    font-size: 13px;
    font-weight: 700;
    color: var(--pm-text);
}
.zen-phone-mock__slack-message__user .time {
    font-weight: 400;
    font-size: 11px;
    color: var(--pm-muted);
    margin-left: 6px;
}
.zen-phone-mock__slack-message__body {
    font-size: 13px;
    color: var(--pm-text);
    line-height: 1.45;
}
.zen-phone-mock__slack-message__body code {
    font-family: 'SF Mono', monospace;
    padding: 1px 5px;
    background: rgba(124,58,237,0.18);
    border-radius: 3px;
    color: var(--pm-accent2);
    font-size: 12px;
}

.zen-phone-mock__slack-message__fields {
    margin-top: 4px;
    padding: 8px 10px;
    border-left: 3px solid var(--pm-accent);
    background: rgba(124,58,237,0.08);
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    color: var(--pm-muted);
    line-height: 1.5;
}
.zen-phone-mock__slack-message__fields b { color: var(--pm-text); font-weight: 600; }

.zen-phone-mock__slack-message__actions {
    /* Span both grid columns. Without this, grid auto-flow drops the actions
     * row into col 1 (the narrow avatar column) once the avatar's row-span
     * (rows 1–3) ends, leaving Approve / Deny crushed under the avatar. */
    grid-column: 1 / -1;
    display: flex; gap: 8px;
    margin-top: 6px;
}

/* Action buttons (Approve / Deny, etc.) ------------------------------------ */
.zen-phone-mock__action-btn {
    flex: 1;
    padding: 10px 12px;
    font: inherit;
    font-size: 13px; font-weight: 700;
    border-radius: 8px;
    border: 1px solid var(--pm-border);
    background: rgba(10,14,28,0.6);
    color: var(--pm-text);
    text-align: center;
    cursor: default;
}
.zen-phone-mock__action-btn--approve {
    background: linear-gradient(180deg, var(--green), #00a34f);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 14px rgba(0,230,118,0.35);
}
.zen-phone-mock__action-btn--deny {
    background: linear-gradient(180deg, #B91C1C, #7f1d1d);
    border-color: transparent;
    color: #fff;
}

/* Approved stamp (after click)  */
.zen-phone-mock__approved {
    /* Same rationale as __actions: span both grid columns of the
     * slack-message wrapper so the stamp gets the full message width
     * (not squeezed into the narrow avatar column on row 4+). */
    grid-column: 1 / -1;
    padding: 8px 10px;
    background: rgba(0,230,118,0.12);
    border: 1px solid rgba(0,230,118,0.45);
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--green);
    display: flex; align-items: center; gap: 6px;
    margin-top: 6px;
}
.zen-phone-mock__approved::before {
    content: '✓';
    width: 16px; height: 16px;
    background: var(--green);
    color: #fff;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 900;
}

/* Size modifiers ------------------------------------------------------------ */
.zen-phone-mock--lg { --pm-w: 400px; --pm-h: 800px; }
.zen-phone-mock--sm { --pm-w: 320px; --pm-h: 640px; }

/* Generic utility: visibility state already handled by framework `.show` */
.zen-phone-mock__notif-card:not(.show) {
    /* opt-in: when module pins a notif to appear on a specific step */
}
