/* =============================================
   Floating Note Widget
   ============================================= */

#note-widget-toggle {
    position: fixed;
    bottom: 65px; /* nằm ngay trên .back-to-top (15 + 40 + 10) */
    right: 15px;
    z-index: 996;
    width: 40px;
    height: 40px;
    border-radius: 50px;
    border: none;
    background: #6f42c1;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 16px rgba(111, 66, 193, .35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s;
}

#note-widget-toggle:hover {
    background: #5a32a3;
    transform: scale(1.08);
}

#note-widget-toggle i {
    font-size: 20px;
    color: #fff;
    line-height: 0;
}

#note-widget-panel {
    position: fixed;
    bottom: 115px; /* ngay trên nút toggle */
    right: 15px;
    z-index: 995;
    width: 330px;
    max-height: 490px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(111, 66, 193, .2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

#note-widget-panel.show {
    display: flex;
}

.nw-header {
    padding: 10px 14px;
    background: linear-gradient(135deg, #6f42c1, #9b59b6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.nw-header span {
    font-size: 14px;
    font-weight: 600;
}

.nw-header .nw-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: .8;
}

.nw-header .nw-close-btn:hover {
    opacity: 1;
}

.nw-body {
    overflow-y: auto;
    flex: 1;
    padding: 10px 12px;
}

.nw-input {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 5px;
    outline: none;
    transition: border-color .2s;
}

.nw-input:focus {
    border-color: #6f42c1;
}

.nw-textarea {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
    resize: none;
    outline: none;
    transition: border-color .2s;
}

.nw-textarea:focus {
    border-color: #6f42c1;
}

.nw-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.nw-save-btn {
    flex: 1;
    padding: 6px;
    background: #6f42c1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s;
}

.nw-save-btn:hover {
    background: #5a32a3;
}

.nw-manage-btn {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: border-color .2s;
}

.nw-manage-btn:hover {
    border-color: #6f42c1;
    color: #6f42c1;
}

.nw-recent-header {
    font-size: 10px;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    margin-bottom: 4px;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
}

.nw-note-item {
    display: block;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .15s;
}

.nw-note-item:hover {
    background: #f3f0ff;
    color: #6f42c1;
}
