/* Inline content-suggestion widget for marketing pages. */

[data-content-block] {
    position: relative;
}

[data-content-block].cb-editable-hover {
    outline: 2px dashed rgba(245, 158, 11, 0.55);
    outline-offset: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: outline-color 120ms ease;
}

/* Wrapper for <img> / <video> blocks — they can't host child elements,
   so the badge has to live as a sibling inside this wrapper. */
.cb-media-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.cb-media-wrapper:hover .cb-edit-badge,
.cb-media-wrapper [data-content-block]:hover ~ .cb-edit-badge {
    display: inline-flex;
}

.cb-edit-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 8px;
    background: #f59e0b;
    color: #1a1a2e;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    z-index: 9999;
    white-space: nowrap;
    pointer-events: auto;
}

.cb-edit-badge:hover {
    background: #fbbf24;
}

[data-content-block].cb-editable-hover .cb-edit-badge,
[data-content-block]:hover .cb-edit-badge {
    display: inline-flex;
}

/* Toast notification */
.cb-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #e2e8f0;
    border: 2px solid #f59e0b;
    padding: 12px 20px;
    border-radius: 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 200ms ease;
    pointer-events: none;
    max-width: 90vw;
}

.cb-toast.cb-toast-show {
    opacity: 1;
}

.cb-toast.cb-toast-error {
    border-color: #f87171;
}

/* Modal backdrop */
.cb-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.cb-modal {
    background: #1a1a2e;
    border: 2px solid #4a4a6a;
    border-radius: 8px;
    padding: 24px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    color: #e2e8f0;
    font-family: 'Space Grotesk', sans-serif;
}

.cb-modal h3 {
    margin: 0 0 8px 0;
    font-family: 'Press Start 2P', monospace;
    font-size: 13px;
    letter-spacing: 1px;
    color: #f59e0b;
}

.cb-modal p.cb-target {
    margin: 0 0 16px 0;
    font-size: 12px;
    color: #aaa;
}

.cb-modal .cb-current {
    background: #0f0f1e;
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #cbd5e1;
    max-height: 30vh;
    overflow-y: auto;
    white-space: pre-wrap;
}

.cb-modal label {
    display: block;
    margin-top: 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
}

.cb-modal textarea,
.cb-modal input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 10px;
    background: #0f0f1e;
    color: #e2e8f0;
    border: 1px solid #4a4a6a;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
}

.cb-modal textarea {
    resize: vertical;
    min-height: 100px;
}

.cb-modal .cb-counter {
    text-align: right;
    margin-top: 2px;
    font-size: 11px;
    color: #888;
}

.cb-modal .cb-counter.cb-counter-over {
    color: #f87171;
}

.cb-modal .cb-preview {
    margin-top: 10px;
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid #2a2a4a;
    background: #0f0f1e;
}

.cb-modal .cb-preview img,
.cb-modal .cb-preview video {
    display: block;
    max-width: 100%;
    max-height: 240px;
    margin: 0 auto;
}

.cb-modal .cb-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.cb-modal .cb-btn {
    padding: 8px 16px;
    background: #2a2a4a;
    color: #e2e8f0;
    border: 1px solid #4a4a6a;
    border-radius: 4px;
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}

.cb-modal .cb-btn.cb-btn-primary {
    background: #f59e0b;
    color: #1a1a2e;
    border-color: #f59e0b;
}

.cb-modal .cb-btn.cb-btn-primary:hover {
    background: #fbbf24;
}

.cb-modal .cb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cb-modal .cb-error {
    margin-top: 10px;
    color: #f87171;
    font-size: 12px;
}

.cb-modal .cb-info {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 4px;
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 12px;
    color: #fbbf24;
    line-height: 1.5;
}

.cb-modal .cb-info a {
    color: #fbbf24;
    text-decoration: underline;
}
