/* ===== NOTES LAYOUT STYLES ===== */

/* Main Notes Container - Based on Figma Container specifications */
.figma-notes-container {
    display: flex;
    flex-direction: column;
    gap: 18px; /* Figma gap between header and white container */
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
    width: 100%;
}

/* Notes Header - Outside white container per Figma */
.figma-notes-header {
    display: flex;
    flex-direction: row;
    gap: 10px; /* Figma gap-2.5 = 10px */
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    height: 38px; /* Figma specified height */
    width: 100%;
}

.figma-notes-icon {
    width: 26px; /* Figma size-[26px] */
    height: 26px;
    overflow: hidden;
    flex-shrink: 0;
}

.figma-notes-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600; /* Semi Bold */
    font-size: 18px; /* Figma text-[18px] */
    line-height: 18px; /* Figma leading-[18px] */
    letter-spacing: -0.18px; /* Figma tracking-[-0.18px] */
    color: #3F4254; /* Figma text-[#3f4254] */
    margin: 0;
    flex-shrink: 0;
}

/* White Container - Exact Figma specifications */
.figma-white-container {
    background: #FFFFFF; /* Figma bg-[#ffffff] */
    border-radius: 12px; /* Figma rounded-xl */
    display: flex;
    flex-direction: column;
    gap: 16px; /* Figma gap-4 */
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0;
    width: 100%;
    flex-shrink: 0;
}

/* Turbo Frame - Ensure full width */
#notes-timeline {
    width: 100%;
    display: block;
}

/* Ensure all turbo-frame elements in notes take full width */
.figma-white-container turbo-frame {
    width: 100%;
    display: block;
}

/* Button Section - Bottom-right positioning per Figma */
.figma-button-section {
    display: flex;
    flex-direction: row;
    gap: 8px; /* Figma gap-2 */
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    flex-shrink: 0;
}

/* Add Note Button - Exact Figma Button specification */
.figma-add-note-btn {
    background: #3E97FF; /* Figma bg-[#3e97ff] */
    border: none;
    border-radius: 8px; /* Figma rounded-md */
    color: #FFFFFF; /* Figma text-[#ffffff] */
    padding: 12px 16px; /* Figma px-4 py-3 */
    font-family: 'Inter', sans-serif;
    font-weight: 600; /* Semi Bold */
    font-size: 13px; /* Figma text-[13px] */
    line-height: 14px; /* Figma leading-[14px] */
    cursor: pointer;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.figma-add-note-btn:hover {
    background: #2F80ED;
    color: #FFFFFF;
}

/* Notes List */
.figma-notes-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    align-self: stretch;
    width: 100%;
    margin-top: 16px;
}

/* Legacy custom button for backward compatibility */
.custom-btn {
    display: flex;
    padding: 12px 16px;
    align-items: center;
    gap: 10px;
    border-radius: 6px;
    background: #3E97FF;
    border: none;
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
}

.timeline .d-flex.align-items-start {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

img.rounded-circle {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

textarea.form-control {
    resize: none;
}

.timeline {
    max-height: 250px;
    height: 250px;
    overflow-y: auto;
    padding: 10px;
}

.timeline .d-flex {
    align-items: flex-start;
}

.timeline .rounded-circle {
    width: 40px;
    height: 40px;
    font-size: 14px;
    line-height: 40px;
    text-align: center;
}

.timeline .fw-bold {
    margin-bottom: 0;
}

#note-form {
    gap: 0.5rem;
}

#notes-list {
    margin-left: 0;
    width: 100%;
}

.notes-separator svg {
    display: block;
    width: 100%;
    height: 2px;
}

.notes-separator path {
    stroke: var(--Primary-Primary-Light, #ECF8FF);
    stroke-width: 1px;
}

#notes-list .d-flex.align-items-start {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.note-card {
    border-radius: 12px;
    border: 1px solid var(--Gray-Gray-200, #F1F1F2);
    background: #FFF;
    box-shadow: 0px 3px 4px 0px rgba(0, 0, 0, 0.03);
    padding: 16px;
}

/* Figma Note Card Design - Optimized for better space usage */
.figma-note-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #F1F1F2;
    box-shadow: 0px 3px 4px 0px rgba(0, 0, 0, 0.03);
    padding: 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

/* Note Card Header */
.figma-note-header {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

/* Avatar Styling */
.figma-note-avatar {
    width: 40px;
    height: 40px;
    border-radius: 40px;
    overflow: hidden;
    flex-shrink: 0;
    background: #E1E3EA;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #FFFFFF;
}

/* Header Content (Name + Timestamp + Edit Button) */
.figma-note-header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    min-width: 0; /* Allow text to truncate */
}

/* Title Section (Name + Timestamp) */
.figma-note-title-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    justify-content: flex-start;
    flex-grow: 1;
    min-width: 0; /* Allow text to truncate */
}

/* User Name Styling */
.figma-note-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600; /* Semi Bold */
    font-size: 14px;
    line-height: 14px;
    color: #3F4254; /* Gray/Gray-800 */
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Timestamp Styling */
.figma-note-timestamp {
    font-family: 'Inter', sans-serif;
    font-weight: 600; /* Semi Bold */
    font-size: 14px;
    line-height: 14px;
    color: #A1A5B7; /* Gray/Gray-500 */
    margin: 0;
    white-space: nowrap;
}

/* Edit Button Styling */
.figma-note-edit-button {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

/* Note Content Styling */
.figma-note-content {
    font-family: 'Inter', sans-serif;
    font-weight: 400; /* Medium */
    font-size: 14px;
    line-height: 25px;
    color: #5E6278; /* Gray/Gray-700 */
    width: 100%;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure trix-content within figma note inherits styling */
.figma-note-content .trix-content {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 25px;
    color: #5E6278;
    margin: 0;
    padding: 0;
}

.notes-list-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    align-self: stretch;
    width: 100%;
}

.edit-note-modal-content {
    border-radius: 16px;
    background: #FFF;
    box-shadow: 0px 8px 16px 0px rgba(54, 54, 54, 0.10);
}

.note-typography {
    color: #3F4254;

    /* Body/B-18-18-600 */
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
    line-height: 18px; /* 100% */
    letter-spacing: -0.18px;
}

.delete-modal {
    width: 400px;
    border-radius: 12px;
    background: #fff;
    z-index: 1000;
    box-shadow: 0px 20px 24px -4px rgba(10, 13, 18, 0.10),
    0px 8px 8px -4px rgba(10, 13, 18, 0.04);
}

/* Ensure delete modal is centered in viewport */
.modal.show .modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 1rem);
}

.modal-dialog-centered .modal-content.delete-modal {
    max-width: 400px;
    margin: 0 auto;
}

.delete-icon-wrapper {
    width: 56px;
    height: 56px;
    background: #FFE4E4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-message {
    font-size: 14px;
    line-height: 20px;
}

.cancel-button {
    flex: 1 0 0;
    background-color: #F1F7FF;
    color: #2F80ED;
    border: none;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    transition: background-color 0.2s ease;

    &:hover {
        background-color: #e0efff;
    }
}


.delete-button {
    display: flex;
    padding: 12px 16px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex: 1 0 0;

    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    border: none;
    border-radius: 6px;

    background: #3E97FF;

    transition: background-color 0.2s ease;

    &:hover {
        background-color: #1e7de9;
    }
}

.modal-actions {
    display: flex;
    width: 100%;
    padding: 0;
    gap: 12px;
    justify-content: flex-start;
    align-items: stretch;
}

.delete-form-class {
    flex: 1 0 0;
    display: flex;
}

/* ===== MODAL Z-INDEX FIXES ===== */
/* Fix z-index issues for modals opened from within offcanvas elements */

/* Ensure modals appear above offcanvas elements */
.modal {
    z-index: 1060 !important; /* Higher than offcanvas z-index (1055) */
}

/* Ensure modal backdrop is behind modal content but above offcanvas */
.modal-backdrop {
    z-index: 1058 !important; /* Between offcanvas (1055) and modal (1060) */
}

/* Fix for modals inside offcanvas - ensure proper stacking context */
.offcanvas .modal {
    z-index: 1060 !important;
}

/* Ensure modal dialog is properly positioned */
.modal-dialog {
    z-index: 1061 !important; /* Above modal background */
}

/* Fix specific edit modal positioning */
#edit-comment-modal .modal-dialog {
    z-index: 1061 !important;
}

/* Ensure Bootstrap modal functionality works correctly */
.modal.show {
    z-index: 1060 !important;
}

.modal.show .modal-backdrop {
    z-index: 1058 !important;
}