/* =====================
   BOARD SCREEN
   ===================== */
#screen-board {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background-color: #f3f4f6;
    transition: background-color 0.4s ease;
}

/* Spotlight Vignette Overlay */
#screen-board::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.4) 0%, rgba(0, 0, 0, 0.15) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

/* Edit Mode Desk Shift */
#screen-board.edit-active {
    background-color: #D3D3D3; /* Light grey workspace desk */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

#screen-board.edit-active::before {
    opacity: 1;
}

/* Make headers legible */
.board-username, .board-followers, #btn-settings {
    transition: color 0.4s ease;
}

#screen-board.edit-active .board-followers {
    color: #4b5563; /* Slightly darker for contrast on grey */
}

.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 0;
    width: var(--wall-frame-width);
    max-width: calc(100% - 32px);
    margin: 2px auto 2px;
    flex-shrink: 0;
    position: relative;
    z-index: 10 !important;
}

.board-user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.board-edit-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.board-username {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

.board-followers {
    font-family: var(--font-ui);
    font-size: 11.5px;
    font-weight: 600;
    color: #6b7280;
    background: rgba(0, 0, 0, 0.06);
    padding: 3px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    letter-spacing: -0.01em;
}

.board-visitor-frame {
    display: contents;
}

.board-canvas-wrap {
    aspect-ratio: 408 / 666;
    flex: 0 0 auto;
    max-width: calc(100% - 32px);
    width: min(var(--wall-frame-width), calc((100dvh - 110px) * 408 / 666));
    height: auto;
    align-self: center;
    margin: 0 auto 16px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    /* Elevation shadow — stronger on sides and bottom */
    box-shadow:
        -6px 0 16px rgba(0, 0, 0, 0.10),
        6px 0 16px rgba(0, 0, 0, 0.10),
        0 12px 24px rgba(0, 0, 0, 0.16),
        0 20px 40px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.board-canvas-wrap.has-active-layer {
    transform: none;
}

/* Sticky Wrapper for Top-Right Switcher Pill so it never scrolls away when scrolling the wall */
.wall-room-switcher-sticky-wrap {
    position: sticky !important;
    top: 16px !important;
    left: 0;
    width: 100%;
    height: 0;
    z-index: 99999 !important;
    pointer-events: none !important;
    display: flex;
    justify-content: flex-end;
    padding-right: 16px;
    box-sizing: border-box;
    overflow: visible !important;
}

/* Top-Right Compact Page Counter Badge */
.wall-room-switcher {
    position: relative !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: 99999 !important;
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28), 0 1px 3px rgba(0, 0, 0, 0.15);
    padding: 3px 11px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    pointer-events: auto !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    height: 28px;
}

.wall-room-switcher:hover {
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.20);
    transform: translateY(-1px) !important;
}

/* Hide wall-room-switcher during edit stage so it won't clash with floating layer menus */
body.board-editing-mode .wall-room-switcher-sticky-wrap,
body.board-editing-mode .wall-room-switcher,
.board-canvas.edit-active ~ .wall-room-switcher,
#screen-board.edit-active .wall-room-switcher-sticky-wrap,
#screen-board.edit-active .wall-room-switcher {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Vertical centering & spacing during edit mode for header, canvas, and pagination */
#screen-board.edit-active .board-header {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    padding-bottom: 0 !important;
    flex-shrink: 0 !important;
}

#screen-board.edit-active .board-canvas-wrap {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    flex-shrink: 0 !important;
}

#screen-board.edit-active .edit-mode-bottom-pagination {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
}


.room-floor-display {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 22px;
    background: transparent;
    font-size: 13px;
    font-weight: 750;
    color: #1e293b;
    line-height: 22px;
    letter-spacing: -0.3px;
    user-select: none;
    pointer-events: none;
    cursor: default;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    white-space: nowrap;
}

.room-action-btn {
    width: 24px;
    height: 22px;
    border-radius: 6px;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
}

.room-action-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: scale(1.08);
}

.room-action-btn:active {
    transform: scale(0.92);
}

/* Three Dots Actions Popover (Pops up directly above Edit Wall pill) */
.room-actions-popover {
    position: absolute !important;
    bottom: 38px !important;
    right: 16px !important;
    top: auto !important;
    left: auto !important;
    z-index: 100000 !important;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24), 0 2px 6px rgba(0, 0, 0, 0.12);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: auto !important;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.room-actions-popover.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.popover-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.popover-action-item:hover {
    background: #f1f5f9;
}

.popover-action-danger {
    color: #dc2626 !important;
}

.popover-action-danger:hover {
    background: #fee2e2 !important;
}


@media (pointer: coarse) {
    .board-canvas-wrap {
        aspect-ratio: 408 / 666;
        flex: 0 0 auto;
        width: min(calc(100% - 32px), calc((100dvh - 88px) * 408 / 666), 430px);
        height: auto;
    }

    body.board-editing-mode .board-canvas-wrap {
        width: min(calc(100% - 32px), calc((100dvh - 88px) * 408 / 666), 430px);
    }
}

/* Tablet / iPad & Large Screen Scaling (fills screen height without bottom gap) */
@media (min-width: 600px) {
    .board-header,
    .board-canvas-wrap {
        width: min(calc(100% - 48px), calc((100dvh - 110px) * 408 / 666), 680px) !important;
        max-width: 680px !important;
    }
}

@media (pointer: coarse) and (min-width: 600px) {
    .board-header,
    .board-canvas-wrap,
    body.board-editing-mode .board-canvas-wrap {
        width: min(calc(100% - 48px), calc((100dvh - 96px) * 408 / 666), 680px) !important;
        max-width: 680px !important;
    }
}


.board-canvas {
    width: 100%;
    height: 100%;
    /* White pegboard with custom background image */
    background-image: url('../Component/board.png');
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.board-profile-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 0;
    pointer-events: none;
}

.board-profile-circle {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 91px;
    height: 91px;
    border-radius: 50%;
    border: 6px solid #e2bbf0;
    background: white;
    z-index: 1;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.board-profile-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
}

.board-profile-circle:active {
    transform: scale(0.98);
}

.board-profile-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-likes-pill {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin-top: 6px;
    background: #ffffff;
    border: 2px solid #e2bbf0;
    border-radius: 20px;
    padding: 3px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    font-size: 13px;
    font-weight: 700;
    color: #2b2b2b;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
    user-select: none;
}

.profile-likes-pill svg {
    color: #ff3b5c;
    flex-shrink: 0;
}

.fab-edit {
    height: 32px;
    border-radius: 50px;
    background: #F7EEFF;
    border: 1px solid #D9B8FF;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: #1f1f1f;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform var(--t);
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    white-space: nowrap;
    flex-shrink: 0;
}

.fab-edit svg {
    width: 20px !important;
    height: 20px !important;
}

.fab-share {
    background: #1f182b;
    border-color: #36294a;
}

/* Share link in top-right: lavender fill and purple stroke */
#btn-share-wall {
    height: 32px;
    padding: 0 14px;
    gap: 6px;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 12.5px;
    font-weight: 700;
    background: #F7EEFF;
    border: 1.5px solid #C8A2F3;
    color: #6B21A8;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.08);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

#btn-share-wall svg {
    width: 13px !important;
    height: 13px !important;
    stroke: #6B21A8 !important;
    fill: none;
}

#btn-share-wall:active {
    background: #18181b !important;
    border-color: #18181b !important;
    color: #ffffff !important;
}

#btn-share-wall:active svg {
    stroke: #ffffff !important;
}

.fab-edit.active-fab,
.nav-center-fab.active-fab {
    background: #3a1d6e !important;
    border-color: #6d28d9 !important;
    color: #ffffff !important;
}

.fab-edit.active-fab .icon-pencil,
.nav-center-fab.active-fab .icon-pencil {
    display: none !important;
}

.fab-edit.active-fab .icon-check,
.nav-center-fab.active-fab .icon-check {
    display: block !important;
}

@keyframes editBoardAttention {
    0%, 100% {
        transform: scale(1);
        border-color: #d1d5db;
        box-shadow: var(--shadow-sm);
    }
    35% {
        transform: scale(1.08);
        border-color: #a855f7;
        box-shadow: 0 0 0 5px rgba(168, 85, 247, 0.18);
    }
    70% {
        transform: scale(1.02);
        border-color: #c084fc;
        box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.14);
    }
}

.fab-edit.edit-board-attention,
.nav-center-fab.edit-board-attention {
    animation: editBoardAttention 0.85s ease;
}

.board-edit-undo {
    border-color: #d1d5db;
    background: #ffffff;
    color: #4b5563;
    box-shadow: none;
}

.board-edit-undo:hover:not(:disabled) {
    border-color: #9ca3af;
    background: #f9fafb;
    color: #111111;
}

.board-edit-undo:disabled {
    opacity: 0.38;
    cursor: default;
}

.board-dock {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    left: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 100 !important;
    pointer-events: none;
    transition: opacity var(--t), transform var(--t);
}

#screen-board.edit-active .board-dock,
body.board-editing-mode .board-dock {
    display: flex !important;
}

.board-cta-label {
    display: none;
}

#screen-board.edit-active .board-cta-label {
    color: rgba(255, 255, 255, 0.95);
}

.action-row {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 0;
    width: auto;
    pointer-events: auto;
}

.action-pill-btn {
    flex: 0 0 auto;
    width: 48px;
    max-width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #1f182b;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(31, 24, 43, 0.28);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, background 0.18s ease;
    padding: 0;
}

.action-btn-label {
    display: none;
}

.action-text-icon {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    line-height: 1;
}

.action-pill-btn:hover {
    transform: scale(1.08) translateY(-2px);
    background: #312645;
    box-shadow: 0 8px 20px rgba(31, 24, 43, 0.45);
}

.action-pill-btn:active {
    transform: scale(0.95);
    background: #15101d;
    box-shadow: 0 2px 8px rgba(31, 24, 43, 0.2);
}

/* ==========================================================
   STORY CAPTURE ARTIFACT SUPPRESSION
   Prevents iOS WebKit SVG compositing engine from rendering
   CSS box-shadow and drop-shadow as muddy grey vertical smudges.
   ========================================================== */
.capturing-story,
.capturing-story * {
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.capturing-story .btn-item-delete,
.capturing-story .btn-item-rotate,
.capturing-story .btn-item-manage,
.capturing-story .premium-board-item-badge,
.capturing-story .premium-board-preview-badge {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.capturing-story .board-item {
    outline: none !important;
}
