/* Shared gallery UI — ManageFileUploadPage + MediaGalleryHost modal */

.rs-card {
    border-radius: 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(14px);
}

[data-bs-theme="dark"] .rs-card {
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(20, 20, 20, 0.55);
}

.rs-dropzone {
    position: relative;
    border-radius: 1.25rem;
    border: 1px dashed rgba(122, 85, 255, 0.35);
    background:
        radial-gradient(600px 260px at 15% 15%, rgba(122, 85, 255, 0.14), transparent 60%),
        radial-gradient(520px 240px at 85% 35%, rgba(0, 203, 255, 0.10), transparent 55%),
        rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(12px);
    overflow: hidden;
    transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

[data-bs-theme="dark"] .rs-dropzone {
    border-color: rgba(152, 120, 255, 0.35);
    background:
        radial-gradient(600px 260px at 15% 15%, rgba(122, 85, 255, 0.20), transparent 60%),
        radial-gradient(520px 240px at 85% 35%, rgba(0, 203, 255, 0.14), transparent 55%),
        rgba(20, 20, 20, 0.55);
}

.rs-dropzone--drag {
    transform: translateY(-1px);
    border-color: rgba(122, 85, 255, 0.70);
    box-shadow: 0 18px 50px rgba(122, 85, 255, 0.16);
}

.rs-dropzone__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.rs-dropzone__label {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2.25rem 1.25rem;
    min-height: 240px;
    cursor: pointer;
    user-select: none;
}

.rs-dropzone__icon {
    width: 76px;
    height: 76px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(122, 85, 255, 0.22);
    background: rgba(255, 255, 255, 0.70);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
    transition: transform .18s ease, box-shadow .18s ease;
    margin-bottom: .75rem;
}

.rs-dropzone--drag .rs-dropzone__icon {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 22px 58px rgba(122, 85, 255, 0.18);
}

[data-bs-theme="dark"] .rs-dropzone__icon {
    border-color: rgba(152, 120, 255, 0.30);
    background: rgba(24, 24, 30, 0.65);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.35);
}

.rs-dropzone__title {
    font-weight: 950;
    letter-spacing: -0.02em;
    font-size: 1.25rem;
}

.rs-dropzone__sub {
    color: rgba(33, 37, 41, 0.70);
    margin-top: .25rem;
    font-weight: 700;
}

[data-bs-theme="dark"] .rs-dropzone__sub {
    color: rgba(248, 249, 250, 0.70);
}

.rs-dropzone__hint {
    margin-top: .8rem;
    color: rgba(33, 37, 41, 0.58);
    font-size: .92rem;
    max-width: 68ch;
    line-height: 1.35;
}

[data-bs-theme="dark"] .rs-dropzone__hint {
    color: rgba(248, 249, 250, 0.60);
}

.rs-file-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .rs-file-pill {
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(24, 24, 30, 0.55);
}

.rs-file-pill__meta {
    min-width: 0;
    flex: 1 1 auto;
}

.rs-variant-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    cursor: pointer;
    padding: 0.58rem 1.15rem;
    border-radius: 999px;
    font-weight: 850;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #fff !important;
    box-shadow:
        0 3px 14px rgba(15, 23, 42, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition:
        transform 0.16s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease,
        border-color 0.2s ease;
}

.rs-variant-cta:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow:
        0 6px 22px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.32);
}

.rs-variant-cta:active:not(:disabled) {
    transform: translateY(0);
    filter: brightness(0.98);
}

.rs-variant-cta:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.rs-variant-cta:focus-visible {
    outline: none;
}

.rs-variant-cta--create {
    background: linear-gradient(135deg, #166534 0%, #15803d 55%, #0f766e 120%);
}

.rs-variant-cta--cancel {
    background: linear-gradient(135deg, #0f172a 0%, #334155 55%, #475569 120%);
}

[data-bs-theme="dark"] .rs-variant-cta {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.45),
        0 2px 12px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Breadcrumbs (modal picker) */
.rs-app-bc-root {
    --bs-breadcrumb-divider-color: rgba(122, 85, 255, 0.45);
    --bs-breadcrumb-item-padding-x: 0.45rem;
}

.rs-app-bc-root--inline {
    padding: 0;
    margin-top: 0;
}

.rs-app-bc-track {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: .4rem .85rem .45rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background:
        radial-gradient(520px 120px at 0% 50%, rgba(122, 85, 255, 0.10), rgba(122, 85, 255, 0) 55%),
        rgba(255, 255, 255, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.75),
        0 2px 14px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .rs-app-bc-track {
    border-color: rgba(255, 255, 255, 0.10);
    background:
        radial-gradient(520px 120px at 0% 50%, rgba(122, 85, 255, 0.16), rgba(122, 85, 255, 0) 55%),
        rgba(22, 22, 26, 0.75);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 4px 18px rgba(0, 0, 0, 0.28);
}

.rs-app-bc-root ol.breadcrumb,
.rs-app-bc-root .breadcrumb {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    flex-wrap: wrap;
    align-items: center;
    row-gap: .2rem;
    background: transparent !important;
}

.rs-app-bc-root .breadcrumb-item {
    font-size: .875rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

.rs-app-bc-root .breadcrumb-item a,
.rs-app-bc-root .breadcrumb-item button.rs-media-gallery__bc-link {
    color: rgba(90, 55, 200, 0.95) !important;
    text-decoration: none !important;
    border-radius: .45rem;
    padding: .12rem .4rem;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
}

.rs-app-bc-root .breadcrumb-item a:hover,
.rs-app-bc-root .breadcrumb-item button.rs-media-gallery__bc-link:hover {
    color: rgba(55, 35, 150, 1) !important;
    background: rgba(122, 85, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(122, 85, 255, 0.18);
}

[data-bs-theme="dark"] .rs-app-bc-root .breadcrumb-item a,
[data-bs-theme="dark"] .rs-app-bc-root .breadcrumb-item button.rs-media-gallery__bc-link {
    color: rgba(198, 185, 255, 0.98) !important;
}

[data-bs-theme="dark"] .rs-app-bc-root .breadcrumb-item a:hover,
[data-bs-theme="dark"] .rs-app-bc-root .breadcrumb-item button.rs-media-gallery__bc-link:hover {
    color: rgba(245, 242, 255, 1) !important;
    background: rgba(122, 85, 255, 0.18);
    box-shadow: 0 0 0 1px rgba(152, 120, 255, 0.35);
}

.rs-app-bc-root .breadcrumb-item.active {
    color: rgba(33, 37, 41, 0.58) !important;
    font-weight: 750;
    padding: .12rem .35rem;
}

[data-bs-theme="dark"] .rs-app-bc-root .breadcrumb-item.active {
    color: rgba(248, 249, 250, 0.55) !important;
}

.rs-app-bc-root .breadcrumb-item + .breadcrumb-item::before {
    font-weight: 800;
    opacity: 0.9;
}

/* Pagination */
.rs-section-pager-outer {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}

.rs-section-pager {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: .35rem .45rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background:
        radial-gradient(640px 140px at 50% 0%, rgba(122, 85, 255, 0.12), rgba(122, 85, 255, 0) 60%),
        rgba(255, 255, 255, 0.78);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 2px 14px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .rs-section-pager {
    border-color: rgba(255, 255, 255, 0.10);
    background:
        radial-gradient(640px 140px at 50% 0%, rgba(122, 85, 255, 0.18), rgba(122, 85, 255, 0) 60%),
        rgba(24, 24, 28, 0.82);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 4px 20px rgba(0, 0, 0, 0.3);
}

.rs-section-pager ul.pagination {
    margin: 0 !important;
    padding: 0 .15rem !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem;
    row-gap: .4rem;
    background: transparent !important;
}

.rs-section-pager .page-item {
    list-style: none;
}

.rs-section-pager .page-item > .page-link,
.rs-section-pager .page-item > a,
.rs-section-pager .page-item > button,
.rs-section-pager .page-item > span.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.45rem;
    min-height: 2.45rem;
    padding: .35rem .55rem;
    font-weight: 750;
    font-size: .9rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: rgba(48, 30, 120, 0.92);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(122, 85, 255, 0.22);
    border-radius: .75rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease, color .15s ease;
}

[data-bs-theme="dark"] .rs-section-pager .page-item > .page-link,
[data-bs-theme="dark"] .rs-section-pager .page-item > a,
[data-bs-theme="dark"] .rs-section-pager .page-item > button,
[data-bs-theme="dark"] .rs-section-pager .page-item > span.page-link {
    color: rgba(235, 235, 245, 0.95);
    background: rgba(36, 36, 42, 0.95);
    border-color: rgba(152, 120, 255, 0.28);
    box-shadow: none;
}

.rs-section-pager .page-item > .page-link:hover,
.rs-section-pager .page-item > a:hover,
.rs-section-pager .page-item > button:hover,
.rs-section-pager .page-item > span.page-link:hover {
    color: rgba(35, 22, 110, 1);
    background: rgba(122, 85, 255, 0.12);
    border-color: rgba(122, 85, 255, 0.45);
    box-shadow: 0 4px 14px rgba(122, 85, 255, 0.18);
    transform: translateY(-1px);
}

[data-bs-theme="dark"] .rs-section-pager .page-item > .page-link:hover,
[data-bs-theme="dark"] .rs-section-pager .page-item > a:hover,
[data-bs-theme="dark"] .rs-section-pager .page-item > button:hover,
[data-bs-theme="dark"] .rs-section-pager .page-item > span.page-link:hover {
    color: rgba(255, 255, 255, 0.98);
    background: rgba(122, 85, 255, 0.2);
    border-color: rgba(170, 145, 255, 0.5);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.rs-section-pager .page-item.active > .page-link,
.rs-section-pager .page-item.active > a,
.rs-section-pager .page-item.active > span {
    color: #fff !important;
    background: linear-gradient(145deg, rgba(122, 85, 255, 1) 0%, rgba(90, 55, 200, 1) 100%) !important;
    border-color: rgba(90, 55, 200, 0.85) !important;
    box-shadow: 0 6px 18px rgba(122, 85, 255, 0.35);
    cursor: default;
    transform: none;
}

[data-bs-theme="dark"] .rs-section-pager .page-item.active > .page-link,
[data-bs-theme="dark"] .rs-section-pager .page-item.active > a,
[data-bs-theme="dark"] .rs-section-pager .page-item.active > span {
    box-shadow: 0 6px 22px rgba(122, 85, 255, 0.35);
}

.rs-section-pager .page-item.disabled > .page-link,
.rs-section-pager .page-item.disabled > a,
.rs-section-pager .page-item.disabled > button,
.rs-section-pager .page-item.disabled > span {
    opacity: 0.42;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

@media (hover: none) and (pointer: coarse) {
    .rs-section-pager,
    .rs-app-bc-track {
        backdrop-filter: none;
    }
}

@media (max-width: 767.98px) {
    .rs-section-pager-outer .rs-section-pager {
        display: inline-flex;
        width: auto;
        max-width: 100%;
        border-radius: 1rem;
        padding: .3rem .4rem .45rem;
    }

    .rs-section-pager ul.pagination {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        width: max-content;
        max-width: calc(100vw - 2.25rem);
        overflow-x: auto;
        overflow-y: hidden;
        gap: .28rem;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
        padding: .2rem .15rem .35rem !important;
    }

    .rs-section-pager ul.pagination::-webkit-scrollbar {
        height: 5px;
    }

    .rs-section-pager ul.pagination::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(122, 85, 255, 0.35);
    }

    .rs-section-pager ul.pagination::-webkit-scrollbar-track {
        background: rgba(15, 23, 42, 0.06);
        border-radius: 999px;
    }

    .rs-section-pager .page-item > .page-link,
    .rs-section-pager .page-item > a,
    .rs-section-pager .page-item > button,
    .rs-section-pager .page-item > span.page-link {
        min-width: 2.05rem;
        min-height: 2.05rem;
        padding: .22rem .38rem;
        font-size: .8rem;
        border-radius: .55rem;
    }
}

/* Gallery table + CTA */
.btn.rs-gallery-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    cursor: pointer;
    padding: 0.52rem 1.05rem;
    border-radius: 999px;
    font-weight: 850;
    font-size: 0.92rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #fff !important;
    box-shadow:
        0 3px 14px rgba(15, 23, 42, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition:
        transform 0.16s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease,
        border-color 0.2s ease;
}

.btn.rs-gallery-cta.btn-sm {
    padding: 0.36rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 800;
}

.btn.rs-gallery-cta:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow:
        0 6px 22px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.32);
}

.btn.rs-gallery-cta:active:not(:disabled) {
    transform: translateY(0);
    filter: brightness(0.98);
}

.btn.rs-gallery-cta:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.btn.rs-gallery-cta:focus-visible {
    outline: none;
}

.rs-gallery-cta--refresh {
    background: linear-gradient(135deg, #075985 0%, #0e7490 45%, #166534 120%);
}

.rs-gallery-cta--copy {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 48%, #0f766e 120%);
}

[data-bs-theme="dark"] .btn.rs-gallery-cta {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.45),
        0 2px 12px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] .rs-gallery-cta--refresh {
    background: linear-gradient(135deg, #0c4a6e 0%, #155e75 42%, #14532d 120%);
}

[data-bs-theme="dark"] .rs-gallery-cta--copy {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 46%, #0d9488 120%);
}

.rs-gallery-cta--folder {
    background: linear-gradient(135deg, #b45309 0%, #d97706 48%, #ca8a04 120%);
}

[data-bs-theme="dark"] .rs-gallery-cta--folder {
    background: linear-gradient(135deg, #92400e 0%, #b45309 50%, #a16207 120%);
}

.rs-gallery-table-wrap {
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
    background: rgba(255, 255, 255, 0.72);
}

[data-bs-theme="dark"] .rs-gallery-table-wrap {
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(24, 24, 30, 0.55);
}

.rs-gallery-table {
    margin-bottom: 0;
    min-width: 52rem;
    width: 100%;
    --bs-table-bg: transparent;
    --bs-table-color: inherit;
    --bs-table-border-color: rgba(15, 23, 42, 0.08);
}

[data-bs-theme="dark"] .rs-gallery-table {
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
}

.rs-gallery-table thead th {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(33, 37, 41, 0.58);
    border-bottom-width: 1px;
    white-space: nowrap;
}

[data-bs-theme="dark"] .rs-gallery-table thead th {
    color: rgba(248, 249, 250, 0.58);
}

.rs-gallery-table__col-date {
    width: 12rem;
}

.rs-gallery-table__col-size {
    width: 6.5rem;
    white-space: nowrap;
}

.rs-gallery-table__col-type {
    width: 11rem;
}

.rs-gallery-table__col-actions {
    width: 1%;
    white-space: nowrap;
}

.rs-gallery-table__row--folder {
    background: rgba(217, 119, 6, 0.04);
}

[data-bs-theme="dark"] .rs-gallery-table__row--folder {
    background: rgba(217, 119, 6, 0.08);
}

.rs-gallery-table__name {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    max-width: 100%;
    font-weight: 800;
    text-decoration: none;
}

button.rs-gallery-table__name {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.rs-gallery-table__name > .text-truncate {
    min-width: 0;
}

.rs-gallery-table__name .rs-gallery-table__type-icon,
.rs-gallery-table__name .bi {
    flex-shrink: 0;
    font-size: 1.05rem;
    line-height: 1;
}

.rs-gallery-table__type-icon--folder,
.rs-gallery-table__name .bi-folder-fill {
    color: #d97706;
}

.rs-gallery-table__type-icon--image,
.rs-gallery-table__name .bi-file-earmark-image {
    color: rgba(72, 45, 168, 0.92);
}

.rs-gallery-table__type-icon--audio,
.rs-gallery-table__name .bi-file-earmark-music {
    color: rgba(14, 116, 144, 0.95);
}

.rs-gallery-table__type-icon--file,
.rs-gallery-table__name .bi-file-earmark {
    color: rgba(71, 85, 105, 0.88);
}

[data-bs-theme="dark"] .rs-gallery-table__type-icon--folder,
[data-bs-theme="dark"] .rs-gallery-table__name .bi-folder-fill {
    color: #fbbf24;
}

[data-bs-theme="dark"] .rs-gallery-table__type-icon--image,
[data-bs-theme="dark"] .rs-gallery-table__name .bi-file-earmark-image {
    color: rgba(196, 181, 253, 0.98);
}

[data-bs-theme="dark"] .rs-gallery-table__type-icon--audio,
[data-bs-theme="dark"] .rs-gallery-table__name .bi-file-earmark-music {
    color: rgba(103, 232, 249, 0.95);
}

[data-bs-theme="dark"] .rs-gallery-table__type-icon--file,
[data-bs-theme="dark"] .rs-gallery-table__name .bi-file-earmark {
    color: rgba(203, 213, 225, 0.88);
}

.rs-gallery-table__name--folder {
    color: rgba(180, 83, 9, 0.98);
}

.rs-gallery-table__name--folder:hover {
    color: rgba(146, 64, 14, 1);
    text-decoration: underline;
}

.rs-gallery-table__name--file {
    color: rgba(72, 45, 168, 0.98);
}

.rs-gallery-table__name--file:hover {
    color: rgba(55, 34, 130, 1);
    text-decoration: underline;
}

[data-bs-theme="dark"] .rs-gallery-table__name--folder {
    color: rgba(253, 230, 138, 0.98);
}

[data-bs-theme="dark"] .rs-gallery-table__name--file {
    color: rgba(196, 181, 253, 0.98);
}

.rs-gallery-table__actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
    align-items: center;
}

.rs-gallery-table__action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    white-space: nowrap;
}
