/**
 * /characterforge/vtt/css/vtt_tiptap.css
 * Defines the CharacterForge VTT journal editor shell, toolbar controls,
 * rich text document rendering, and editor-specific prompt dialog styling.
 */

/* Tiptap Editor Container styling */
.vtt-editor-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    border: 1px solid #444;
    border-radius: 6px;
    background-color: #1a1a1a;
    overflow: hidden;
}

/* Toolbar styling */
.vtt-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: #2b2b2b;
    border-bottom: 1px solid #444;
    align-items: center;
}

/* Toolbar buttons */
.vtt-editor-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #aaa;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: bold;
}

.vtt-editor-btn:hover {
    background: #3a3a3a;
    color: #fff;
    border-color: #555;
}

.vtt-editor-btn.active {
    background: #d4af37;
    color: #111;
    border-color: #b5952f;
}

/* Content Area styling */
.vtt-editor-content {
    flex: 1;
    overflow: auto;
    padding: 15px;
    outline: none;
    color: #eaeaea;
    min-height: 0;
    line-height: 1.6;
    font-size: 14px;
}

/* Tiptap standard editor content rules */
.vtt-editor-content .ProseMirror {
    height: 100%;
    outline: none;
}

.vtt-editor-content .ProseMirror p {
    margin-top: 0;
    margin-bottom: 1em;
}

.vtt-editor-content .ProseMirror h1,
.vtt-editor-content .ProseMirror h2,
.vtt-editor-content .ProseMirror h3 {
    color: #d4af37;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: bold;
}

.vtt-editor-content .ProseMirror h1 { font-size: 1.8em; }
.vtt-editor-content .ProseMirror h2 { font-size: 1.5em; }
.vtt-editor-content .ProseMirror h3 { font-size: 1.2em; }

.vtt-editor-content .ProseMirror ul,
.vtt-editor-content .ProseMirror ol {
    margin-top: 0;
    margin-bottom: 1em;
    padding-left: 20px;
}

.vtt-editor-content .ProseMirror blockquote {
    border-left: 3px solid #d4af37;
    padding-left: 12px;
    margin-left: 0;
    margin-right: 0;
    color: #bbb;
    font-style: italic;
}

.vtt-editor-content .ProseMirror hr {
    border: none;
    border-top: 1px solid #444;
    margin: 1.5em 0;
}

.vtt-editor-content .ProseMirror img,
.vtt-editor-content .ProseMirror .vtt-editor-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 12px 0;
    border: 1px solid #444;
    border-radius: 4px;
    box-sizing: border-box;
}

.vtt-editor-content .ProseMirror img.ProseMirror-selectednode {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

.vtt-editor-content .ProseMirror video,
.vtt-editor-content .ProseMirror .vtt-editor-video {
    display: block;
    width: min(100%, 720px);
    aspect-ratio: 16 / 9;
    margin: 12px 0;
    border: 1px solid #444;
    border-radius: 4px;
    background: #050505;
    object-fit: contain;
    box-sizing: border-box;
}

.vtt-editor-content .ProseMirror video.ProseMirror-selectednode {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

.vtt-editor-content .ProseMirror table,
.vtt-editor-content .ProseMirror .vtt-editor-table {
    width: 100%;
    min-width: 320px;
    margin: 12px 0 18px;
    border-collapse: collapse;
    table-layout: fixed;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.18);
}

.vtt-editor-content .ProseMirror th,
.vtt-editor-content .ProseMirror td {
    position: relative;
    min-width: 1em;
    padding: 8px 10px;
    border: 1px solid #555;
    vertical-align: top;
    box-sizing: border-box;
}

.vtt-editor-content .ProseMirror th {
    color: #f1d27a;
    background: rgba(120, 82, 18, 0.38);
    font-weight: bold;
}

.vtt-editor-content .ProseMirror td {
    color: #eaeaea;
    background: rgba(255, 255, 255, 0.025);
}

.vtt-editor-content .ProseMirror th p,
.vtt-editor-content .ProseMirror td p {
    margin: 0;
}

.vtt-editor-content .ProseMirror .selectedCell::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: rgba(212, 175, 55, 0.2);
}

.vtt-editor-content .ProseMirror .column-resize-handle {
    position: absolute;
    top: 0;
    right: -2px;
    bottom: -2px;
    width: 4px;
    z-index: 20;
    pointer-events: none;
    background-color: #d4af37;
}

.vtt-editor-content .ProseMirror.resize-cursor {
    cursor: col-resize;
}

.vtt-editor-prompt-content {
    width: 420px;
    max-width: 92vw;
    border-color: #d4af37;
}

#btnVttEditorPromptClose {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #ff4444;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}

.vtt-editor-prompt-title {
    color: #d4af37;
    margin: 0 28px 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
    font-family: 'Cinzel', serif;
}

.vtt-editor-prompt-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vtt-editor-field-group {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
}

.vtt-editor-field-group label,
.vtt-editor-checkbox-row {
    color: #aaa;
    font-size: 12px;
    font-weight: bold;
}

.vtt-editor-field-group input {
    width: 100%;
}

.vtt-editor-media-source-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.vtt-editor-media-source-row input {
    flex: 1;
    min-width: 0;
    width: auto;
}

.vtt-editor-file-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #8a6b21;
    border-radius: 4px;
    background: linear-gradient(180deg, #3a2d12, #1c170c);
    color: #d4af37;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.vtt-editor-file-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #4a3918, #241d0f);
    border-color: #d4af37;
    color: #fff3b0;
}

.vtt-editor-file-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.vtt-editor-file-input {
    display: none;
}

.vtt-editor-upload-status {
    min-height: 15px;
    color: #9bb58b;
    font-size: 11px;
    line-height: 1.35;
}

.vtt-editor-upload-status.error {
    color: #ff6b6b;
}

.vtt-editor-table-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.vtt-editor-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.vtt-editor-checkbox-row input {
    width: 16px;
    height: 16px;
    accent-color: #d4af37;
}

@media (max-width: 520px) {
    .vtt-editor-table-controls {
        grid-template-columns: 1fr;
    }
}
