/* Campaign workspace shared styles */

.workspace-shell {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100vh;
    min-height: 0;
    background: #f4f5f7;
    overflow: hidden;
}

.workspace-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.workspace-header-title {
    font-weight: 600;
    font-size: 1.05rem;
    white-space: nowrap;
}

.workspace-header-counter {
    font-size: 0.85rem;
    color: #6b7280;
    white-space: nowrap;
}

.workspace-header-spacer {
    flex: 1 1 auto;
}

.workspace-header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.workspace-body {
    display: grid;
    grid-template-columns: 280px 1fr 380px;
    min-height: 0;
    overflow: hidden;
}

@media (max-width: 1100px) {
    .workspace-body {
        grid-template-columns: 240px 1fr 340px;
    }
}

@media (max-width: 900px) {
    .workspace-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
}

.workspace-pane {
    background: #fff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.workspace-pane:last-child {
    border-right: 0;
}

.workspace-pane-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.workspace-pane-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px;
    min-height: 0;
}

.workspace-pane-footer {
    border-top: 1px solid #f3f4f6;
    padding: 12px;
    flex-shrink: 0;
    background: #fafbfc;
}

/* Banner cards (left rail) */
.banner-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0;
    background: #fff;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}

.banner-card:hover {
    border-color: #93c5fd;
}

.banner-card.is-selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px #dbeafe;
}

.banner-card-thumb-wrapper {
    position: relative;
    width: 100%;
    height: 88px;
    background: #f3f4f6;
}

.banner-card-thumb {
    width: 100%;
    height: 88px;
    object-fit: contain;
    display: block;
    border: none;
}

.banner-card-thumb-iframe {
    background: #fff;
    pointer-events: none;
}

.banner-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.banner-card-click-shield {
    position: absolute;
    inset: 0;
    background: transparent;
    cursor: pointer;
    z-index: 2;
}

.banner-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    padding: 6px 8px 8px;
}

.banner-card-unread {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 7px;
    z-index: 3;
}

/* Status pills */
.status-pill {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-pill-pushed {
    background: #d1fae5;
    color: #065f46;
}

.status-pill-draft {
    background: #fef3c7;
    color: #92400e;
}

.status-pill-resolved {
    background: #ddd6fe;
    color: #5b21b6;
}

/* Banner viewer (center) — scaled stage */
.banner-viewer-stage {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-conic-gradient(#f5f5f5 0% 25%, #ffffff 0% 50%) 0/24px 24px;
    overflow: auto;
    position: relative;
    min-height: 0;
}

.banner-viewer-scale-wrapper {
    position: relative;
    flex-shrink: 0;
}

.banner-viewer-size-box {
    position: relative;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.banner-viewer-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.banner-viewer-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

.banner-viewer-iframe-pdf {
    background: #525659;
}

.banner-viewer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #9ca3af;
    gap: 12px;
}

.banner-viewer-toolbar {
    padding: 8px 16px;
    background: #fff;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.toolbar-divider {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: #e5e7eb;
    margin: 0 6px;
}

.draft-ribbon {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: #fef3c7;
    color: #92400e;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 5;
}

.banner-mode-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(31, 41, 55, 0.92);
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.banner-busy-overlay {
    position: absolute;
    inset: 0;
    background: rgba(31, 41, 55, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: busy-fade-in 0.15s ease;
}

@keyframes busy-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.banner-busy-card {
    background: #fff;
    padding: 24px 32px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    max-width: 360px;
    color: #1f2937;
}

.banner-busy-card .icon {
    color: #3b82f6;
}

/* Pin overlay (always visible, never blocks pointer) */
.banner-pin-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.pin-marker {
    position: absolute;
    color: #ef4444;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -100%);
    font-size: 26px;
    line-height: 1;
    pointer-events: auto;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.pin-marker:hover,
.pin-marker.is-hovered {
    transform: translate(-50%, -100%) scale(1.25);
    filter: drop-shadow(0 2px 6px rgba(239, 68, 68, 0.6));
    z-index: 6;
}

.pin-marker.is-flashed {
    animation: pin-flash 0.4s ease 0s 4 alternate;
    z-index: 6;
}

@keyframes pin-flash {
    from { transform: translate(-50%, -100%) scale(1); }
    to   { transform: translate(-50%, -100%) scale(1.4); filter: drop-shadow(0 0 12px #ef4444); }
}

.pin-marker-number {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translate(-50%, 0);
    background: #fff;
    color: #ef4444;
    border: 2px solid #ef4444;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: 700;
    line-height: 12px;
    text-align: center;
    text-shadow: none;
    pointer-events: none;
}

.pin-marker-pending {
    color: #f59e0b;
    pointer-events: none;
}

.pin-marker-pending .pin-marker-number {
    color: #f59e0b;
    border-color: #f59e0b;
}

/* Interaction overlay (mode-driven) */
.banner-interaction-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
}

.banner-interaction-overlay.is-view {
    pointer-events: none;
}

.banner-interaction-overlay.is-pin {
    pointer-events: auto;
    cursor: crosshair;
    background: rgba(59, 130, 246, 0.04);
}

.banner-interaction-overlay.is-draw {
    pointer-events: auto;
}

.banner-draw-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Draw toolbar */
.draw-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
    padding: 4px 8px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.draw-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #d1d5db;
    cursor: pointer;
    padding: 0;
}

.draw-color-swatch.is-active {
    box-shadow: 0 0 0 2px #1f2937;
}

/* Thread / messages (right rail) */
.thread-empty {
    text-align: center;
    color: #9ca3af;
    padding: 32px 16px;
}

.message-bubble {
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.message-bubble.is-self {
    background: #dbeafe;
    border-color: #bfdbfe;
}

.message-bubble.is-system {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #6b7280;
    font-style: italic;
    font-size: 0.85rem;
}

.message-bubble.is-hovered {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px #fee2e2;
}

.message-bubble.is-flashed {
    animation: bubble-flash 0.4s ease 0s 4 alternate;
}

@keyframes bubble-flash {
    from { box-shadow: 0 0 0 2px #fee2e2; }
    to   { box-shadow: 0 0 0 4px #fca5a5, 0 0 16px rgba(239, 68, 68, 0.4); border-color: #ef4444; }
}

.message-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.message-author {
    font-weight: 600;
    color: #111827;
}

.message-time {
    color: #9ca3af;
}

.message-attachments {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.message-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.78rem;
    color: #374151;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    font-family: inherit;
}

.message-attachment-chip:hover {
    background: #e5e7eb;
}

.message-attachment-thumb {
    margin-top: 6px;
    margin-right: 6px;
    max-width: 220px;
    max-height: 160px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: zoom-in;
    background: #fff;
    display: inline-block;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.message-attachment-thumb:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.message-attachment-image {
    /* inherits .message-attachment-thumb sizing */
}

.message-attachment-video-thumb {
    position: relative;
    width: 220px;
    height: 140px;
    overflow: hidden;
    background: #111;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-top: 6px;
    margin-right: 6px;
    cursor: pointer;
    display: inline-block;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.message-attachment-video-thumb:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.message-attachment-video-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.message-attachment-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

.message-pin-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px 2px 4px;
    border-radius: 999px;
    font-size: 0.72rem;
    margin-top: 4px;
    border: 1px solid #fca5a5;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s;
}

.message-pin-chip:hover {
    background: #fecaca;
}

.message-pin-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: 700;
}

.message-annotation-thumb {
    margin-top: 6px;
    width: 80px;
    height: 60px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}

/* Composer */
.composer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.composer-textarea {
    width: 100%;
    min-height: 60px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.composer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.composer-actions-spacer {
    flex: 1 1 auto;
}

.composer {
    position: relative;
    transition: background 0.15s, box-shadow 0.15s;
}

.composer.drop-zone-active {
    background: #dbeafe;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.composer-drop-hint {
    position: absolute;
    inset: 0;
    background: rgba(219, 234, 254, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #1d4ed8;
    font-weight: 600;
    pointer-events: none;
    z-index: 5;
    border-radius: 6px;
    gap: 6px;
}

.composer-hint {
    margin-left: 4px;
}

.composer-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.composer-annotation-mini {
    width: 28px;
    height: 20px;
    object-fit: contain;
    margin-left: 6px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background: #fff;
}

/* Presence chips */
.presence-chips {
    display: flex;
    align-items: center;
    gap: 4px;
}

.presence-chip {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    position: relative;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e5e7eb;
}

.presence-chip.is-admin {
    background: #ef4444;
}

.presence-chip.is-participant {
    background: #10b981;
}

.presence-chip::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #fff;
}

.typing-indicator {
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 6px;
    min-height: 18px;
}
