.note-detail-page {
    min-height: calc(100vh - 76px);
    padding: 48px 20px 90px;
    color: #17213c;
    background:
        radial-gradient(
            circle at 90% 5%,
            rgba(78, 99, 232, 0.12),
            transparent 28%
        ),
        #f6f8fc;
}

.note-detail-container {
    width: min(100%, 1080px);
    margin-inline: auto;
}

/* مسیر صفحه */

.note-breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    color: #7b849a;
    font-size: 0.84rem;
}

.note-breadcrumb a {
    color: #4b62df;
    font-weight: 800;
    text-decoration: none;
}

.note-breadcrumb a:hover {
    color: #334ac9;
}

/* بدنه اصلی یادداشت */

.note-article {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e4e8f1;
    border-radius: 26px;
    box-shadow: 0 18px 55px rgba(28, 42, 82, 0.08);
}

.note-article-header {
    max-width: 850px;
    margin-inline: auto;
    padding: 60px 40px 42px;
    text-align: center;
}

.note-detail-category {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    margin-bottom: 18px;
    padding: 5px 14px;
    color: #ffffff;
    background: linear-gradient(135deg, #4c63e7, #7658df);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
}

.note-article-header h1 {
    margin: 0;
    color: #111c3d;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.note-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 24px;
    margin-top: 24px;
    color: #7b8498;
    font-size: 0.82rem;
}

.note-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* دکمه‌های مدیریت */

.note-management-actions {
    display: flex;
    max-width: 920px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto 34px;
    padding: 16px 18px;
    background: #f8f9fd;
    border: 1px solid #e2e6f0;
    border-radius: 15px;
}

.note-management-description {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.note-management-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    color: #5268df;
    background: #e9edff;
    border: 1px solid #dce2ff;
    border-radius: 11px;
    font-size: 1rem;
}

.note-management-description > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.note-management-description strong {
    color: #2d3854;
    font-size: 0.8rem;
}

.note-management-description small {
    color: #8992a6;
    font-size: 0.68rem;
}

.note-management-buttons {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
}

.note-edit-button,
.note-delete-button {
    display: inline-flex;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.note-edit-button {
    color: #4e64dc;
    background: #edf0ff;
    border: 1px solid #d9dfff;
}

.note-edit-button:hover {
    color: #ffffff;
    background: #5368df;
    border-color: #5368df;
    box-shadow: 0 7px 18px rgba(83, 104, 223, 0.22);
    transform: translateY(-1px);
}

.note-delete-button {
    color: #c43e54;
    background: #ffffff;
    border: 1px solid #edcbd2;
}

.note-delete-button:hover {
    color: #ffffff;
    background: #d9475d;
    border-color: #d9475d;
    box-shadow: 0 7px 18px rgba(217, 71, 93, 0.2);
    transform: translateY(-1px);
}

/* تصویر شاخص */

.note-cover {
    max-width: 820px;
    margin: 0 auto;
    padding-inline: 40px;
}

.note-cover img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    background: #f8f9fd;
    border: 1px solid #e7eaf2;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(24, 38, 75, 0.08);
}

/* متن یادداشت */

.note-body {
    max-width: 820px;
    margin-inline: auto;
    padding: 55px 40px;
    color: #384158;
    font-size: 1rem;
    line-height: 2.25;
    overflow-wrap: anywhere;
}

.note-body p {
    margin: 0 0 22px;
}

.note-body p:last-child {
    margin-bottom: 0;
}

.note-body img {
    max-width: 100%;
    height: auto;
}

/* فایل‌های پیوست */

.note-attachments {
    max-width: 920px;
    margin: 0 auto 50px;
    padding: 30px;
    background: #f8f9fd;
    border: 1px solid #e5e9f3;
    border-radius: 20px;
}

.attachments-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.section-label {
    display: block;
    margin-bottom: 5px;
    color: #596ee4;
    font-size: 0.74rem;
    font-weight: 800;
}

.attachments-heading h2 {
    margin: 0;
    color: #182341;
    font-size: 1.25rem;
}

.attachments-count {
    color: #768096;
    font-size: 0.78rem;
}

.attachments-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.attachment-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    padding: 15px;
    color: #26314d;
    background: #ffffff;
    border: 1px solid #e1e5ef;
    border-radius: 14px;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.attachment-card:hover {
    border-color: #bec8f8;
    box-shadow: 0 10px 25px rgba(57, 76, 159, 0.09);
    transform: translateY(-2px);
}

.attachment-icon {
    display: grid;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    color: #4d63df;
    background: #edf0ff;
    border-radius: 11px;
    font-size: 1.1rem;
    font-weight: 900;
}

.attachment-info {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.attachment-info strong {
    overflow: hidden;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-info small {
    color: #8a92a5;
    font-size: 0.69rem;
}

.attachment-action {
    color: #566be1;
    font-size: 0.72rem;
    font-weight: 800;
}

/* اطلاعات نویسنده */

.note-article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 40px;
    background: #fbfcff;
    border-top: 1px solid #e8ebf3;
}

.note-author-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, #4861e1, #7655dd);
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 900;
}

.note-author-card div:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.note-author-card small {
    color: #8991a4;
    font-size: 0.7rem;
}

.note-author-card strong {
    color: #202b47;
    font-size: 0.86rem;
}

.back-to-notes {
    padding: 10px 17px;
    color: #4d62d8;
    background: #f0f2ff;
    border: 1px solid #dce1ff;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.back-to-notes:hover {
    color: #ffffff;
    background: #4d63df;
    border-color: #4d63df;
}

/* یادداشت قبلی و بعدی */

.note-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.note-navigation-card {
    display: flex;
    min-height: 100px;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    padding: 20px 22px;
    color: #1e2946;
    background: #ffffff;
    border: 1px solid #e2e6ef;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(28, 42, 82, 0.05);
    text-decoration: none;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.note-navigation-card:hover {
    border-color: #bcc6f7;
    transform: translateY(-2px);
}

.note-navigation-card small {
    color: #6575d7;
    font-size: 0.72rem;
    font-weight: 800;
}

.note-navigation-card strong {
    overflow: hidden;
    font-size: 0.87rem;
    line-height: 1.8;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-navigation-card.is-disabled {
    opacity: 0.55;
    box-shadow: none;
}

/* پنجره تأیید حذف */

.note-delete-dialog {
    width: min(calc(100% - 30px), 510px);
    max-width: none;
    margin: auto;
    padding: 0;
    overflow: visible;
    color: #17213c;
    background: transparent;
    border: 0;
    border-radius: 20px;
    direction: rtl;
}

.note-delete-dialog::backdrop {
    background: rgba(13, 21, 43, 0.6);
    backdrop-filter: blur(5px);
}

.note-delete-dialog[open] {
    animation: delete-dialog-open 0.22s ease-out;
}

.delete-dialog-content {
    position: relative;
    padding: 31px;
    background: #ffffff;
    border: 1px solid #e1e5ed;
    border-radius: 20px;
    box-shadow: 0 28px 85px rgba(12, 20, 43, 0.34);
}

.delete-dialog-close {
    position: absolute;
    top: 14px;
    left: 14px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #778095;
    background: #f3f4f8;
    border: 0;
    border-radius: 9px;
    font-family: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.delete-dialog-close:hover {
    color: #c33e53;
    background: #fcecef;
}

.delete-dialog-icon {
    display: grid;
    width: 60px;
    height: 60px;
    margin: 0 auto 17px;
    place-items: center;
    color: #cf4056;
    background: #fce9ed;
    border: 1px solid #f3cad2;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 900;
}

.delete-dialog-text {
    text-align: center;
}

.delete-dialog-label {
    display: block;
    color: #cc3e54;
    font-size: 0.7rem;
    font-weight: 900;
}

.delete-dialog-text h2 {
    margin: 6px 0 11px;
    color: #17223e;
    font-size: 1.2rem;
    line-height: 1.7;
}

.delete-dialog-text p {
    margin: 0;
    color: #6d768b;
    font-size: 0.78rem;
    line-height: 2;
}

.delete-dialog-text p strong {
    color: #2d3853;
    overflow-wrap: anywhere;
}

.delete-dialog-text small {
    display: block;
    margin-top: 9px;
    color: #c4475a;
    font-size: 0.65rem;
    font-weight: 800;
}

.delete-dialog-actions {
    display: grid;
    margin-top: 25px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.delete-dialog-actions form {
    width: 100%;
    margin: 0;
}

.delete-dialog-cancel,
.delete-dialog-confirm {
    display: inline-flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        filter 0.2s ease,
        transform 0.2s ease;
}

.delete-dialog-cancel {
    color: #60697e;
    background: #ffffff;
    border: 1px solid #d8dee8;
}

.delete-dialog-cancel:hover {
    background: #f4f5f8;
    transform: translateY(-1px);
}

.delete-dialog-confirm {
    color: #ffffff;
    background: linear-gradient(135deg, #dc495f, #b93149);
    border: 0;
    box-shadow: 0 9px 22px rgba(202, 57, 79, 0.24);
}

.delete-dialog-confirm:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

@keyframes delete-dialog-open {
    from {
        opacity: 0;
        transform: translateY(13px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* تبلت */

@media (max-width: 760px) {
    .note-detail-page {
        padding: 30px 13px 65px;
    }

    .note-article {
        border-radius: 19px;
    }

    .note-article-header {
        padding: 42px 20px 30px;
    }

    .note-management-actions {
        align-items: stretch;
        flex-direction: column;
        margin: 0 15px 28px;
    }

    .note-management-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .note-edit-button,
    .note-delete-button {
        width: 100%;
    }

    .note-cover {
        padding-inline: 15px;
    }

    .note-cover img {
        border-radius: 14px;
    }

    .note-body {
        padding: 38px 21px;
        font-size: 0.94rem;
        line-height: 2.15;
    }

    .note-attachments {
        margin: 0 15px 35px;
        padding: 21px 16px;
    }

    .attachments-grid,
    .note-navigation {
        grid-template-columns: 1fr;
    }

    .note-article-footer {
        align-items: stretch;
        flex-direction: column;
        padding: 22px 20px;
    }

    .back-to-notes {
        text-align: center;
    }
}

/* موبایل */

@media (max-width: 480px) {
    .note-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .note-management-actions {
        padding: 13px;
    }

    .note-management-description small {
        display: none;
    }

    .note-management-buttons {
        grid-template-columns: 1fr;
    }

    .attachments-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .attachment-action {
        display: none;
    }

    .delete-dialog-content {
        padding: 27px 18px 19px;
    }

    .delete-dialog-text h2 {
        padding-inline: 15px;
        font-size: 1.03rem;
    }

    .delete-dialog-actions {
        grid-template-columns: 1fr;
    }
}