/* ================================================================
   OUTLINE EDITOR (Seamless Inline Chat Bubble)
   ================================================================ */

#outline-container {
    width: 100%;
    max-width: 800px;
    margin: 1.5rem auto 2rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#outline-container.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(10px);
}

.outline-chat-bubble {
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-left: 3rem;
    /* Space for the avatar to sit out if we want, or keep it inline */
    position: relative;
}

.outline-bubble-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.outline-ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
    position: absolute;
    left: 0;
    top: 0;
}

.outline-bubble-title {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
}

/* ================================================================
   SEAMLESS OUTLINE LIST (The fluid outline)
   ================================================================ */
.seamless-outline-list {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

:root[data-theme="light"] .seamless-outline-list {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.outline-bubble-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.outline-btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.outline-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

:root[data-theme="light"] .outline-btn-ghost {
    border-color: #E2E8F0;
    color: #4B5563;
}

:root[data-theme="light"] .outline-btn-ghost:hover {
    background: #F3F4F6;
}
/* ================================================================
   SEAMLESS ITEMS
   ================================================================ */

.seamless-slide-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    padding-left: 2rem;
}

.seamless-slide-number {
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    user-select: none;
}

.seamless-title-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
    resize: none;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.seamless-title-input::placeholder,
.seamless-point-input::placeholder {
    color: var(--muted);
    opacity: 0.5;
}

.seamless-points-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-left: 0.5rem;
}

.seamless-point-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    position: relative;
}

.seamless-point-bullet {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.5;
    user-select: none;
    margin-top: -1px;
}

.seamless-point-input {
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-body);
    font-size: 0.95rem;
    width: 100%;
    resize: none;
    overflow: hidden;
    padding: 0;
    line-height: 1.5;
}

:root[data-theme="light"] .seamless-point-input {
    color: rgba(0, 0, 0, 0.85);
}

.outline-generate-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    background: #0066FF;
    color: white;
    transition: all 0.2s ease;
}

.outline-generate-btn:hover {
    background: #0052cc;
    transform: translateY(-1px);
}

/* Redundant footer hiding */
.outline-bubble-footer {
    display: none !important;
}

/* Hover & Focus state transitions for text fields to signal editability */
.seamless-title-input,
.seamless-point-input {
    border-bottom: 1px solid transparent !important;
    transition: border-bottom-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, padding 0.2s ease !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    margin-left: -6px !important;
}

.seamless-title-input:hover,
.seamless-point-input:hover {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom-color: rgba(0, 102, 255, 0.3) !important;
    cursor: text !important;
}

.seamless-title-input:focus,
.seamless-point-input:focus {
    background: rgba(255, 255, 255, 0.06) !important;
    border-bottom-color: var(--accent, #0066FF) !important;
    outline: none !important;
}

:root[data-theme="light"] .seamless-title-input:hover,
:root[data-theme="light"] .seamless-point-input:hover {
    background: rgba(0, 102, 255, 0.03) !important;
    border-bottom-color: rgba(0, 102, 255, 0.4) !important;
}

:root[data-theme="light"] .seamless-title-input:focus,
:root[data-theme="light"] .seamless-point-input:focus {
    background: rgba(0, 102, 255, 0.06) !important;
    border-bottom-color: var(--accent, #0066FF) !important;
}

/* ========================================== */
/* HISTORICAL OUTLINE SUMMARIES (READ-ONLY)   */
/* ========================================== */
.historical-outline-summary {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    opacity: 0.5 !important;
    /* Muted aesthetic to indicate read-only history */
    transition: opacity 0.3s ease !important;
    pointer-events: none !important;
    /* Disable all edits and interactions */
    margin: 1rem 0 !important;
    box-shadow: none !important;
}

.historical-outline-summary:hover {
    opacity: 0.75 !important;
}

:root[data-theme="light"] .historical-outline-summary {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.historical-slide-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
    position: relative !important;
    padding-left: 2rem !important;
}

.historical-slide-number {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: var(--muted) !important;
}

.historical-slide-title {
    font-family: var(--font-body) !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--text) !important;
}

.historical-points-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.3rem !important;
    margin-left: 0.5rem !important;
}

.historical-point-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
}

.historical-point-bullet {
    color: var(--muted) !important;
    font-size: 1rem !important;
    line-height: 1.4 !important;
}

.historical-point-text {
    font-family: var(--font-body) !important;
    font-size: 0.95rem !important;
    color: var(--text) !important;
    opacity: 0.8 !important;
    line-height: 1.4 !important;
}

/* ================================================================
   AI RESPONSES & AVATAR CLEANUPS (Visual refinements)
   ================================================================ */

/* Keep the AI chat message container starting at the top (so the avatar doesn't slide down when slides load) */
.chat-msg-ai {
    align-items: flex-start !important;
}

/* Ensure the AI avatar always starts exactly at the same vertical offset (2px top margin) */
.chat-ai-avatar {
    margin-top: 2px !important;
}

/* Guarantee 100% pixel-perfect vertical centering of the thinking dots with the 30px high avatar */
.chat-thinking {
    height: 30px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    margin-top: 2px !important;
}

.chat-thinking.hidden {
    display: none !important;
}

/* Make the circular AI avatar invisible (but keep its width/space to prevent layout shifts/jumps) */
.chat-msg-ai:has(.chat-thinking.hidden) .chat-ai-avatar,
.chat-msg-ai:not(:has(.chat-thinking)) .chat-ai-avatar,
.chat-msg-ai:has(.chat-cancelled-message) .chat-ai-avatar,
.chat-msg-ai:has(.chat-cancellation-message) .chat-ai-avatar {
    opacity: 0 !important;
    pointer-events: none !important;
    user-select: none !important;
}

/* Subtle, muted, grey cancellation message, perfectly centered vertically with the 30px high avatar */
.chat-cancelled-message,
.chat-cancellation-message {
    color: var(--muted, #888) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    text-align: left !important;
    margin: 2px 0 0 0 !important;
    min-height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    opacity: 0.75 !important;
    line-height: 1.2 !important;
}
