/* /css/quick_tools/notes_tool.css */
/* Quick Tools: Personal Notes Component Styles */

/* --- Modal Shell & Themes --- */
.notes-modal-dialog {
    max-width: 760px;
}

/* Centered Smooth Scale + Fade In Animation (replaces any slide-from-edge) */
#quickNotesModal.modal.fade .notes-modal-dialog {
    transform: scale(0.95) translateY(-8px) !important;
    opacity: 0;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease !important;
}

#quickNotesModal.modal.show .notes-modal-dialog {
    transform: scale(1) translateY(0) !important;
    opacity: 1;
}

#quickNotesDeleteModal.modal.fade .modal-dialog {
    transform: scale(0.94) translateY(-6px) !important;
    opacity: 0;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
}

#quickNotesDeleteModal.modal.show .modal-dialog {
    transform: scale(1) translateY(0) !important;
    opacity: 1;
}

.notes-modal-content {
    background-color: var(--bs-body-bg, #1a1a2e) !important;
    border: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.15)) !important;
    border-radius: 20px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--bs-border-color-translucent) !important;
    color: var(--bs-body-color) !important;
    overflow: hidden;
}

[data-bs-theme="dark"] .notes-modal-content {
    background-color: #1a1a28 !important;
}

[data-bs-theme="light"] .notes-modal-content {
    background-color: #ffffff !important;
}

/* --- Header Styling --- */
.notes-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--apple-accent-color, #6c63ff), #38bdf8);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(108, 99, 255, 0.35);
    flex-shrink: 0;
}

.notes-count-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    background: rgba(var(--bs-primary-rgb, 108, 99, 255), 0.12);
    color: var(--apple-accent-color, #6c63ff);
    border: 1px solid rgba(var(--bs-primary-rgb, 108, 99, 255), 0.22);
}

.notes-circle-btn {
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border: 1px solid var(--bs-border-color-translucent);
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color) !important;
    opacity: 0.85;
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.notes-circle-btn:hover {
    opacity: 1;
    background: var(--bs-secondary-bg);
    transform: scale(1.06);
}

.notes-modal-header {
    position: relative;
    padding-right: 115px !important;
}

.notes-header-actions {
    position: absolute;
    top: 14px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.notes-close-btn:hover {
    background: rgba(255, 59, 48, 0.15) !important;
    border-color: rgba(255, 59, 48, 0.35) !important;
    color: #ff3b30 !important;
}

/* --- Note Composer Card --- */
.notes-composer-card {
    background: rgba(var(--bs-tertiary-bg-rgb, 128, 128, 128), 0.45);
    border: 1px solid var(--bs-border-color-translucent) !important;
    border-radius: 18px;
    padding: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    position: relative;
}

.notes-composer-card:focus-within {
    border-color: var(--apple-accent-color, #6c63ff) !important;
    background: rgba(var(--bs-tertiary-bg-rgb, 128, 128, 128), 0.65);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(var(--bs-primary-rgb, 108, 99, 255), 0.25);
}

.notes-composer-textarea {
    width: 100%;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    resize: none;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--bs-body-color) !important;
    min-height: 72px;
    padding: 0;
}

.notes-composer-textarea::placeholder {
    color: var(--bs-body-color) !important;
    opacity: 0.5;
}

/* --- Color Picker Dots --- */
.notes-color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notes-color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
    box-sizing: border-box;
    flex-shrink: 0;
}

.notes-color-dot:hover {
    transform: scale(1.22);
}

.notes-color-dot.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--apple-accent-color, #6c63ff), 0 2px 8px rgba(0, 0, 0, 0.25);
    transform: scale(1.18);
}

[data-bs-theme="light"] .notes-color-dot.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--apple-accent-color, #6c63ff), 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Color Dropdown Popover on Note Cards (100% Solid Non-Transparent) */
.notes-color-dropdown-menu {
    min-width: 165px !important;
    padding: 6px !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
    z-index: 1060 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform-origin: top right;
}

.notes-color-dropdown-menu.show {
    animation: notesDropdownIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes notesDropdownIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(-4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

[data-bs-theme="dark"] .notes-color-dropdown-menu {
    background: #1e1e2e !important;
    background-color: #1e1e2e !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="light"] .notes-color-dropdown-menu {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
}

.notes-color-dropdown-menu .dropdown-item {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--bs-body-color) !important;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.notes-color-dropdown-menu .dropdown-item:hover {
    background-color: rgba(128, 128, 128, 0.12) !important;
}

/* --- Add Button --- */
.notes-add-btn {
    background-color: var(--apple-accent-color, #6c63ff) !important;
    color: #ffffff !important;
    border: none;
    border-radius: 50rem;
    padding: 7px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px var(--button-glow, rgba(108, 99, 255, 0.35)) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.notes-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--button-glow, rgba(108, 99, 255, 0.5)) !important;
    opacity: 0.96;
}

.notes-add-btn:active {
    transform: scale(0.96);
}

.notes-kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.72rem;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.2;
    color: var(--bs-secondary-color);
    background-color: rgba(128, 128, 128, 0.15);
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 6px;
}

/* --- Toolbar (Segmented Filters + Search) --- */
.notes-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    margin-bottom: 16px;
}

.notes-segmented-track {
    display: inline-flex;
    align-items: center;
    background: var(--bs-tertiary-bg);
    border-radius: 50rem;
    padding: 3px;
    border: 1px solid var(--bs-border-color-translucent);
    gap: 3px;
}

.notes-filter-btn {
    border: none;
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 50rem;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.notes-filter-btn:hover {
    color: var(--bs-body-color);
}

.notes-filter-btn.active {
    background: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.notes-filter-pill-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 12px;
    background: rgba(128, 128, 128, 0.18);
    line-height: 1.3;
}

.notes-search-wrapper {
    position: relative;
    min-width: 210px;
}

.notes-search-input {
    background: var(--bs-tertiary-bg) !important;
    border: 1px solid var(--bs-border-color-translucent) !important;
    border-radius: 50rem !important;
    padding-left: 32px !important;
    padding-right: 30px !important;
    font-size: 0.84rem !important;
    color: var(--bs-body-color) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.notes-search-input:focus {
    border-color: var(--apple-accent-color, #6c63ff) !important;
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb, 108, 99, 255), 0.2) !important;
    background: var(--bs-body-bg) !important;
}

.notes-search-input::placeholder {
    color: var(--bs-body-color) !important;
    opacity: 0.5;
}

.notes-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.82rem;
    color: var(--bs-secondary-color);
    pointer-events: none;
}

.notes-search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.25);
    border: none;
    color: var(--bs-body-color);
    font-size: 0.68rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.15s ease;
}

.notes-search-clear-btn:hover {
    background: rgba(128, 128, 128, 0.4);
}

/* --- Single Unified Modal Scrollbar --- */
.notes-modal-content .modal-body {
    max-height: calc(85vh - 130px);
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.notes-modal-content .modal-body::-webkit-scrollbar {
    width: 6px;
}

.notes-modal-content .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.notes-modal-content .modal-body::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.25);
    border-radius: 4px;
}

.notes-modal-content .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.45);
}

/* --- Notes List & Cards --- */
#quickNotesListContainer {
    overflow: visible;
    padding: 2px 2px 8px 2px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@keyframes noteSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.quick-note-card.note-card-new {
    animation: noteSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.quick-note-card {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
    border-radius: 16px;
    border: 1px solid var(--bs-border-color-translucent) !important;
    border-left-width: 4px !important;
    position: relative;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.03);
}

.quick-note-card.dropdown-open,
.quick-note-card:has(.show),
.quick-note-card:focus-within {
    z-index: 50 !important;
}

.quick-note-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Note Color Variants */
.quick-note-card[data-color="default"] {
    border-left-color: #8e8e93 !important;
    background: rgba(var(--bs-tertiary-bg-rgb, 128, 128, 128), 0.35) !important;
}

.quick-note-card[data-color="red"] {
    border-left-color: #ff3b30 !important;
    background: rgba(255, 59, 48, 0.08) !important;
}

.quick-note-card[data-color="yellow"] {
    border-left-color: #ff9500 !important;
    background: rgba(255, 149, 0, 0.09) !important;
}

.quick-note-card[data-color="green"] {
    border-left-color: #34c759 !important;
    background: rgba(52, 199, 89, 0.08) !important;
}

.quick-note-card[data-color="blue"] {
    border-left-color: #007aff !important;
    background: rgba(0, 122, 255, 0.08) !important;
}

.quick-note-card[data-color="purple"] {
    border-left-color: #af52de !important;
    background: rgba(175, 82, 222, 0.08) !important;
}

/* Done State */
.quick-note-card.note-is-done {
    opacity: 0.62;
}

.quick-note-card.note-is-done .quick-note-text {
    text-decoration: line-through;
    color: var(--bs-secondary-color);
}

/* Category Badge in Note Header */
.note-category-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.note-category-badge.badge-default {
    background: rgba(142, 142, 147, 0.18);
    color: var(--bs-secondary-color);
}

.note-category-badge.badge-red {
    background: rgba(255, 59, 48, 0.18);
    color: #ff3b30;
}

.note-category-badge.badge-yellow {
    background: rgba(255, 149, 0, 0.18);
    color: #ff9500;
}

.note-category-badge.badge-green {
    background: rgba(52, 199, 89, 0.18);
    color: #34c759;
}

.note-category-badge.badge-blue {
    background: rgba(0, 122, 255, 0.18);
    color: #007aff;
}

.note-category-badge.badge-purple {
    background: rgba(175, 82, 222, 0.18);
    color: #af52de;
}

/* Action Icon Buttons on Note Cards */
.notes-card-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--bs-secondary-color);
    transition: all 0.15s ease;
    padding: 0;
    cursor: pointer;
}

.notes-card-action-btn:hover {
    background: rgba(128, 128, 128, 0.16);
    color: var(--bs-body-color);
}

.notes-card-action-btn.btn-delete:hover {
    background: rgba(255, 59, 48, 0.18);
    color: #ff3b30;
}

/* Note Checkbox Styling */
.note-checkbox {
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
    border-radius: 6px;
    border-color: var(--bs-border-color-translucent);
    transition: all 0.15s ease;
}

.note-checkbox:checked {
    background-color: var(--apple-accent-color, #6c63ff);
    border-color: var(--apple-accent-color, #6c63ff);
}

/* Note Content Typography */
.quick-note-text {
    font-size: 0.94rem;
    line-height: 1.55;
    color: var(--bs-body-color);
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 4px;
}

/* Edit Box */
.edit-note-box textarea {
    border-radius: 12px !important;
    background: var(--bs-body-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
    font-size: 0.92rem;
    padding: 10px 12px;
    line-height: 1.5;
}

.edit-note-box textarea:focus {
    border-color: var(--apple-accent-color, #6c63ff) !important;
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb, 108, 99, 255), 0.25) !important;
}

/* --- Empty / Loading States --- */
.notes-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--bs-secondary-color);
}

.notes-empty-icon {
    font-size: 2.8rem;
    opacity: 0.35;
    margin-bottom: 0.75rem;
    display: inline-block;
}

/* --- Footer Bar --- */
.notes-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-top: 1px solid var(--bs-border-color-translucent);
    background: var(--bs-tertiary-bg);
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
}