/* ============================================
   Whiteboard Block - Preview & Modal
   ============================================ */

.whiteboard-preview {
    position: relative;
    min-height: 120px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-secondary);
    transition: border-color 0.2s;
}

.whiteboard-preview:hover {
    border-color: var(--accent);
}

.whiteboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.whiteboard-empty svg {
    opacity: 0.5;
}

.whiteboard-empty span {
    font-size: 0.85rem;
}

.whiteboard-svg-container {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.whiteboard-svg-container svg {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
}

.whiteboard-enter-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.85;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.whiteboard-enter-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Iframe Wrapper — always mounted, toggles
   between hidden and fullscreen modes
   ============================================ */

.whiteboard-iframe-wrapper {
    display: flex;
    flex-direction: column;
}

/* Hidden mode: offscreen, tiny, for SVG export only */
.whiteboard-iframe-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Fullscreen mode: acts as the modal overlay */
.whiteboard-iframe-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 3000;
    animation: fadeIn 0.2s ease-out;
}

.whiteboard-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.whiteboard-modal-title {
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.whiteboard-modal-close {
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.whiteboard-modal-close:hover {
    background: #333;
    color: white;
    border-color: #666;
}

.whiteboard-iframe {
    flex: 1 1 0%;
    width: 100%;
    min-height: 0;
    border: none;
    background: #ffffff;
}
