/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* TipTap / ProseMirror minimal resets to stabilize caret behavior */
.ProseMirror {
	outline: none;
	white-space: pre-wrap;
}
.ProseMirror p { margin: 0 0 1em; }
.ProseMirror ul, .ProseMirror ol { padding-left: 1.2rem; margin: 0 0 1em; }
.ProseMirror li { margin: 0.25em 0; }

main {
    border-bottom: 1px solid var(--borderColor-default);
    padding: 2rem 0;
    min-height: 50vh;
    min-height: 50svh;
}

footer {
    align-items: center;

    display: flex !important;
    justify-content: center;
    padding: 3rem 0;
    width: 100%;
}

footer .brandaid {
    box-shadow: none;
    color: #0969da;
    fill: #0969da;
    font-size: 4rem !important;
}

footer .brandaid:hover {
    border: none !important;
    color: #0969da;
    fill: #0969da;
}

header .brandaid {
    position: absolute;
    width: 139px;
    left: 50%;
    right: 50%;
    transform: translateX(-50%);
}

.tiptap.ProseMirror {
    padding: 0.5rem;
}

.tiptap h1, .tiptap h2, .tiptap h3, .tiptap h4, .tiptap h5, .tiptap h6 {
    margin-top: revert;
    margin-bottom: revert;
}

.document-editor {
  margin: -1.5rem 0 -2rem;
}

/* Assistant split layout only on large screens */
.document-editor.assistant-split {
    /* default: do not split on small/medium; keep as single column */
    display: block;
}

.document-editor.assistant-split > form { min-width: 0; }

.document-editor.assistant-split .ai-assistant {
    position: sticky;
    top: auto;
    bottom: 0;
    left: auto;
    right: auto;
    width: auto;
    border-left: 0;
    border-top: 1px solid var(--borderColor-muted, var(--borderColor-default));
}

@media (min-width: 1024px) {
    .document-editor.assistant-split {
        display: grid;
        grid-template-columns: 38% 1fr; /* golden-ish ratio */
        grid-template-areas: "assistant form";
        gap: 1rem;
        align-items: start;
    }

    .document-editor.assistant-split > form { grid-area: form; }

    .document-editor.assistant-split .ai-assistant {
        grid-area: assistant;
        top: 0;
        bottom: auto;
        border-top: 0;
        border-left: 1px solid var(--borderColor-muted, var(--borderColor-default));
        /* Fill assistant column with an accent blue when split */
        background-color: var(--color-accent-subtle, var(--bgColor-accent-muted, rgba(9, 105, 218, 0.08)));
    }
}

.document-editor.assistant-split .ai-assistant .ai-panel {
    display: block;
}

/* Constrain preview areas a bit tighter in split view */
.document-editor.assistant-split .ai-result { max-height: 250px; }
.document-editor.assistant-split .ai-context { max-height: 250px; }

/* Small screens inherently use the single-column default above */

/* Transition animations between bottom bar and split-left panel */
.ai-assistant.ai-leave-bottom { animation: ai-slide-down 180ms ease forwards; }
.ai-assistant.ai-enter-left { animation: ai-slide-in-left 240ms ease both; }
.ai-assistant.ai-leave-left { animation: ai-slide-left-out 160ms ease forwards; }
.ai-assistant.ai-enter-bottom { animation: ai-slide-up 220ms ease both; }

@keyframes ai-slide-down {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(100%); opacity: 0; }
}
@keyframes ai-slide-in-left {
    from { transform: translateX(-16px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes ai-slide-left-out {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(-16px); opacity: 0; }
}
@keyframes ai-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
