/* ═══════════════════════════════════════════════════════════════════════
   welcome.css  —  Folio Welcome Screen + Sidebar + AI Panel
   ───────────────────────────────────────────────────────────────────────
   Covers:
     • Sidebar layout, SVG icon buttons (borderless), resize handle
     • AI panel resize handle
     • Welcome screen greeting animation
   ═══════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────────
   APP SHELL  — three-column flex layout
   ────────────────────────────────────────────────────────────────────── */

#app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════════
   SIDEBAR  (#sidebar)
   ══════════════════════════════════════════════════════════════════════ */

#sidebar {
    position: relative;          /* anchor for resize handle */
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w, 220px);
    min-width: 160px;
    max-width: 420px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border, #e8e3de);
    overflow: hidden;
    transition: width 0.18s ease;
    user-select: none;           /* prevent text selection while dragging */
}

/* ── Sidebar header ──────────────────────────────────────────────────── */

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 14px 10px;
    flex-shrink: 0;
}

.sidebar-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    flex-shrink: 0;
}

.sidebar-header-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-notes-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent-alpha, rgba(201,106,58,0.12));
    color: var(--accent, #C96A3A);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Notes list ──────────────────────────────────────────────────────── */

.notes-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
}

/* ── Sidebar footer  (sounds above settings) ─────────────────────────── */

.sidebar-footer {
    flex-shrink: 0;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* ── Footer buttons  — borderless icon + label ───────────────────────── */

.sidebar-footer-btn {
    display: flex;
    flex-direction: row;         /* override styles.css flex-direction:column */
    align-items: center;
    gap: 10px;
    width: 100%;
    flex: unset;                 /* override styles.css flex:1 */
    padding: 8px 12px;
    background: none;
    border: none;                /* override styles.css border:1px solid */
    border-radius: 7px;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    text-align: left;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-footer-btn:hover {
    background: var(--surface-alt, rgba(0,0,0,0.05));
    color: var(--text, #333);
}

.sidebar-footer-btn:active {
    background: var(--bg);
    color: var(--accent, #C96A3A);
}

.sidebar-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text);
}

.sidebar-btn-label {
    font-size: 13px;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Collapsed sidebar hides labels ─────────────────────────────────── */

#sidebar.collapsed {
    width: 52px !important;
}

#sidebar.collapsed .sidebar-header-label,
#sidebar.collapsed .sidebar-btn-label,
#sidebar.collapsed .sidebar-notes-badge,
#sidebar.collapsed .notes-list {
    display: none;
}

#sidebar.collapsed .sidebar-footer-btn {
    justify-content: center;
    padding: 10px 0;
}

/* ── Resize handle — right edge of sidebar ───────────────────────────── */

.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 100;
    background: transparent;
    transition: background 0.15s;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
    background: var(--accent, #C96A3A);
    opacity: 0.35;
    border-radius: 3px;
}

/* ══════════════════════════════════════════════════════════════════════
   AI PANEL  (#ai-panel)
   ══════════════════════════════════════════════════════════════════════ */

#ai-panel {
    position: relative;          /* anchor for resize handle — width/open handled by styles.css */
}

/* Allow text selection inside open panel */
#ai-panel.open {
    user-select: auto;
}

/* ── AI panel resize handle — left edge ──────────────────────────────── */

.ai-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    z-index: 100;
    background: transparent;
    transition: background 0.15s;
}

.ai-resize-handle:hover,
.ai-resize-handle.dragging {
    background: var(--accent, #C96A3A);
    opacity: 0.35;
    border-radius: 3px;
}

/* ══════════════════════════════════════════════════════════════════════
   RESIZE  — global cursor lock while dragging
   ══════════════════════════════════════════════════════════════════════ */

body.resizing-sidebar,
body.resizing-sidebar * {
    cursor: col-resize !important;
    user-select: none !important;
}

body.resizing-ai,
body.resizing-ai * {
    cursor: col-resize !important;
    user-select: none !important;
}

/* ══════════════════════════════════════════════════════════════════════
   WELCOME GREETING  — fade-in on load
   ══════════════════════════════════════════════════════════════════════ */

#welcome-greeting {
    overflow: hidden;
    max-height: 120px;
    transition: opacity 0.3s ease, max-height 0.4s ease;
}

#welcome-greeting h1 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

#welcome-greeting p {
    margin: 0;
    font-size: 14px;
    color: var(--text);
}