/* ============================================================
   Notes App – Stylesheet
   ============================================================ */

:root {
    --accent: #0d6efd;
    --accent-light: rgba(13, 110, 253, .12);
    --card-border: #e3e7ef;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    --card-shadow-h: 0 6px 20px rgba(0, 0, 0, .11);
    --bg: #f4f6fb;
}

body {
    background: var(--bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Navbar ──────────────────────────────────────────── */
.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: .4px;
}

/* ── Toolbar ─────────────────────────────────────────── */
.app-toolbar {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: .6rem .85rem;
    box-shadow: var(--card-shadow);
    flex-wrap: nowrap;
    min-width: 0;
}

/* ── Note card ───────────────────────────────────────── */
.note-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.note-card>.card-header {
    background: transparent;
    border-bottom: 1px solid var(--card-border);
    padding: .65rem 1rem;
    border-radius: 10px 10px 0 0;
}

.note-title {
    font-size: .9375rem;
    font-weight: 600;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.note-card>.card-body {
    flex: 1;
    padding: .75rem 1rem;
    overflow: hidden;
}

/* Content preview with fade-out */
.note-preview {
    font-size: .8125rem;
    color: #555;
    max-height: 110px;
    overflow: hidden;
    position: relative;
    line-height: 1.55;
}

.note-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
}

.note-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.note-card>.card-footer {
    background: transparent;
    border-top: 1px solid var(--card-border);
    padding: .45rem 1rem;
    font-size: .7rem;
    color: #adb5bd;
    border-radius: 0 0 10px 10px;
}

/* ── Pinned state ────────────────────────────────────── */
.note-card.is-pinned {
    border-color: #ffc107;
    border-top: 3px solid #ffc107;
}

.note-card.is-pinned>.card-header {
    background: rgba(255, 193, 7, .08);
}

/* ── Editing state ───────────────────────────────────── */
.note-card.is-editing {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light), var(--card-shadow-h);
}

/* ── Quill editor ─────────────────────────────────────── */
.ql-toolbar.ql-snow {
    border-radius: 6px 6px 0 0 !important;
    background: #f8f9fa;
}

.ql-container.ql-snow {
    border-radius: 0 0 6px 6px !important;
    font-size: .9375rem !important;
}

.ql-editor {
    min-height: 150px;
}

/* ── Modal: 90 vh, scrollable body ──────────────────── */
#noteModal .modal-dialog {
    height: 90vh;
    margin-top: 5vh;
    margin-bottom: 5vh;
}

#noteModal .modal-content {
    height: 100%;
}

#noteModal .ql-editor {
    min-height: 260px;
}

/* ── Search input ────────────────────────────────────── */
#searchInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem var(--accent-light);
}

/* ── Mobile adjustments ──────────────────────────────── */
@media (max-width: 575px) {
    .ql-editor {
        min-height: 110px;
    }
}

/* List and details view styles */
.note-list-row>div,
.note-details-row>div {
    width: 100%;
}

.btn-group .btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.note-list-row .btn,
.note-details-row .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.95em;
}

.note-list-row .fw-semibold {
    font-size: 1rem;
}

.note-details-row .fw-bold.fs-5 {
    font-size: 1.15rem !important;
}

.note-details-row .note-preview {
    max-height: none;
    font-size: 1em;
}