/* ═══════════════════════════════════════════════════════════════════
   user-notes.css — Jun's Notes overlay + rich text editor
   ═══════════════════════════════════════════════════════════════════ */

/* ── Overlay backdrop ─────────────────────────────────────────────── */
#jun-notes-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;  /* above plant-modal (9999) */
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#jun-notes-overlay.active {
    display: flex;
    opacity: 1;
}

/* ── Notes card ───────────────────────────────────────────────────── */
.jun-notes-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: notesSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes notesSlideIn {
    from { transform: translateY(30px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* ── Header ───────────────────────────────────────────────────────── */
.jun-notes-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.jun-notes-icon {
    font-size: 1.5rem;
}

.jun-notes-title {
    margin: 0;
    font-size: 1.15rem;
    color: #e2e8f0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.jun-notes-plant-name {
    margin-left: auto;
    font-size: 0.85rem;
    color: #fbbf24;
    font-weight: 600;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Body / viewer ────────────────────────────────────────────────── */
.jun-notes-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    min-height: 150px;
    max-height: 55vh;
}

.jun-notes-viewer {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.7;
}

.jun-notes-viewer a {
    color: #60a5fa;
    text-decoration: underline;
}

.jun-notes-viewer img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.jun-notes-viewer h1,
.jun-notes-viewer h2,
.jun-notes-viewer h3 {
    color: #e2e8f0;
    margin-top: 12px;
}

.jun-notes-viewer ul,
.jun-notes-viewer ol {
    padding-left: 20px;
    margin: 8px 0;
}

/* ── Quill editor overrides (dark theme) ──────────────────────────── */
#jun-notes-editor-wrap .ql-toolbar.ql-snow {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px 10px 0 0;
    background: rgba(0, 0, 0, 0.3);
}

#jun-notes-editor-wrap .ql-toolbar.ql-snow .ql-stroke {
    stroke: #94a3b8;
}

#jun-notes-editor-wrap .ql-toolbar.ql-snow .ql-fill {
    fill: #94a3b8;
}

#jun-notes-editor-wrap .ql-toolbar.ql-snow .ql-picker-label {
    color: #94a3b8;
}

#jun-notes-editor-wrap .ql-toolbar.ql-snow button:hover .ql-stroke,
#jun-notes-editor-wrap .ql-toolbar.ql-snow button.ql-active .ql-stroke {
    stroke: #60a5fa;
}

#jun-notes-editor-wrap .ql-toolbar.ql-snow button:hover .ql-fill,
#jun-notes-editor-wrap .ql-toolbar.ql-snow button.ql-active .ql-fill {
    fill: #60a5fa;
}

#jun-notes-editor-wrap .ql-container.ql-snow {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: none;
    border-radius: 0 0 10px 10px;
    background: rgba(0, 0, 0, 0.2);
    color: #e2e8f0;
    font-size: 0.95rem;
    min-height: 200px;
    max-height: 40vh;
    overflow-y: auto;
}

#jun-notes-editor-wrap .ql-editor.ql-blank::before {
    color: rgba(148, 163, 184, 0.5);
    font-style: italic;
}

#jun-notes-editor-wrap .ql-editor a {
    color: #60a5fa;
}

#jun-notes-editor-wrap .ql-snow .ql-picker-options {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.15);
}

#jun-notes-editor-wrap .ql-snow .ql-picker-item {
    color: #cbd5e1;
}

/* ── Action buttons ───────────────────────────────────────────────── */
.jun-notes-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
}

.jun-notes-actions .btn {
    padding: 8px 18px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.jun-btn-edit {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3) !important;
}
.jun-btn-edit:hover { background: rgba(96, 165, 250, 0.35); }

.jun-btn-save {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3) !important;
}
.jun-btn-save:hover { background: rgba(52, 211, 153, 0.35); }

.jun-btn-delete {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.25) !important;
}
.jun-btn-delete:hover { background: rgba(248, 113, 113, 0.3); }

.jun-btn-cancel {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
}
.jun-btn-cancel:hover { background: rgba(148, 163, 184, 0.3); }

.jun-btn-close {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1a1a2e;
    font-weight: 700;
}
.jun-btn-close:hover { background: linear-gradient(135deg, #fbbf24, #f59e0b); }

/* ── Card badge (📝 on cards with notes) ──────────────────────────── */
.jun-note-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 25;
    font-size: 1.1rem;
    background: rgba(251, 191, 36, 0.9);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* ── Mobile responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
    .jun-notes-card {
        max-height: 92vh;
        border-radius: 15px;
    }

    .jun-notes-header {
        padding: 14px 16px;
        flex-wrap: wrap;
    }

    .jun-notes-plant-name {
        max-width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }

    .jun-notes-body {
        padding: 16px;
    }

    .jun-notes-actions {
        padding: 12px 16px;
    }

    .jun-notes-actions .btn {
        padding: 7px 14px;
        font-size: 0.8rem;
    }
}
