.main-library {
    width: 100%;
    height: calc(100vh - 65px);
    overflow: hidden;
    background-color: var(--color-bg);
}

.library-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    height: 100%;
}

.library-top-navbar {
    display: flex;
    top: 0;
    left: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 8px;
    gap: 16px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--color-border);
}

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40%;
    max-width: 625px;
    position: relative;
}
.search-container textarea {
    width: 100%;
    height: 50px;
    font-family: "PeydaWebVF", serif;
    font-weight: 450;
    font-size: clamp(12px, 1.2vw, 14px);
    direction: rtl;
    padding: 5px 10px 5px 60px;
    border-radius: 8px;
    color: var(--color-text);
    background-color: #F5F5F5;
    resize: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    border: 1px solid #D9D9D9;
    border: none;
    scrollbar-width: none;
}
.search-container textarea::-webkit-scrollbar {
    display: none;
}
.search-container textarea:focus {
    outline: none;
    background-color: #F2F2F2;
}

.search-container-send-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 56px;
    position: absolute;
    left: 2px;
    bottom: 2px;
    border-radius: 6px 0 0 6px;
    background-color: var(--color-bg);
    cursor: pointer;
    box-shadow: 0 0 1px rgba(10, 10, 10, 0.1);
    transition: background-color 0.3s ease;
}
.search-container-send-btn:hover {
    background-color: var(--color-bg-soft);
}

.search-container-send-btn img {
    width: 17px;
    height: 17px;
    pointer-events: none;
    user-select: none;
}

.library-top-navbar-search-options {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.switch-search-engine {
    display: flex;
    justify-content: center;
    align-items: center;
}

.switch-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 38px;
    height: 19px;
    padding: 1px;
    border-radius: 999px;
    background-color: #9f9f9f;
}
.switch-container.active {
    background-color: var(--color-primary-hover);
}
.toggle-switch {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 19px;
    height: 19px;
    background-color: var(--color-bg-soft);
    position: absolute;
    right: 1px;
    top: 1px;
    border-radius: 50%;
    transition: right 0.3s ease;
    cursor: pointer;
}
.toggle-switch.active {
    right: 20px;
}
.toggle-switch p {
    margin: 2px 0 0 0;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #8c8c8c;
}

.switch-search-engine-container {
    display: flex;
    position: relative;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    height: 60px;
    border-radius: 8px;
    padding: 0 16px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    animation: shadowShine 4s infinite;
}

@keyframes shadowShine {
    0% {box-shadow: 0 0 4px rgba(161, 155, 136, 0.2);}
    50% {box-shadow: 0 0 6px rgba(212, 177, 55, 0.4);}
    100% {box-shadow: 0 0 4px rgba(161, 155, 136, 0.2);}
}

.search-info-container {
    display: flex;
    justify-content: center;
    align-content: center;
    cursor: pointer;
    position: absolute;
    left: 3px;
    top: 3px;

}
.search-info-container img {
    width: 15px;
    height: 15px;
    pointer-events: none;
    user-select: none;
}

.keyword-engine-title-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.keyword-engine-title-container p {
    margin: 0;
    color: var(--color-text);
    font-size: clamp(12px, 1.4vw, 14px);
    font-weight: 500;
    width: max-content;
    text-align: center;
}

.ai-engine-title-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.ai-engine-title-container p{
    margin: 0;
    color: var(--color-text);
    font-size: clamp(12px, 1.4vw, 14px);
    font-weight: 500;
    width: max-content;
    text-align: center;
}


.keyword-search-modes {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: max-content;
}
.keyword-search-modes-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    padding: 4px;
    height: 60px;
    box-sizing: border-box;
    width: max-content;
    /*background-color: var(--color-border);*/
}

.keyword-search-modes-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    height: 100%;
    box-sizing: border-box;
    border-radius: 7px;
    font-weight: 550;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, font-weight 0.2s ease;
}
.keyword-search-modes-item:hover {
    font-weight: 550;
}
.keyword-search-modes-item p {
    margin: 0;
    font-size: clamp(12px, 1.4vw, 14px);
    text-align: center;
    color: var(--color-text);
}

.keyword-search-modes-item.active {
    font-weight: 550;
    background-color: rgba(194, 160, 51, 0.2);
}



.keyword-search-modes-dropdown-btn {
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    height: 60px;
    padding: 0 16px;
    width: max-content;
    box-sizing: border-box;
    border-radius: 8px;
    gap: 5px;
    cursor: pointer;
    background-color: transparent;
    transition: background-color 0.3s ease;
}
.keyword-search-modes-dropdown-btn.active {
    background-color: var(--color-active-btn);
}
.keyword-search-modes-dropdown-btn p {
    margin: 0;
    font-weight: 500;
    font-size: clamp(12px, 1.4vw, 14px);
    text-align: center;
    color: var(--color-text);
}
.keyword-search-modes-dropdown-btn img {
    transform: rotate(90deg);
    width: 15px;
    height: 15px;
}

.keyword-search-modes-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    display: flex;
    opacity: 0;
    z-index: -600;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    border-radius: 8px;
    background-color: var(--color-bg);
    box-shadow: 0 2px 4px rgba(10, 10, 10, 0.15);
    transition: opacity 0.3s ease;
}
.keyword-search-modes-dropdown.show {
    opacity: 1;
    z-index: 600;
}

.keyword-search-modes-dropdown-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    width: 100%;
    font-weight: 550;
    box-sizing: border-box;
}
.keyword-search-modes-dropdown-item p {
    margin: 0;
    font-weight: 500;
    font-size: clamp(12px, 1.4vw, 14px);
    text-align: center;
    color: var(--color-text);
}
.keyword-search-modes-dropdown-item.active {
    background-color: rgba(194, 160, 51, 0.2);
}


.switch-search-engine-dropdown {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4px;
    border-radius: 8px;
    height: 60px;
    box-sizing: border-box;
    box-shadow:  0 0 2px rgba(10, 10, 10, 0.1);
}

.search-engine-option-ai, .search-engine-option-keyword {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 16px;
    height: 50%;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    color: var(--color-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}
.search-engine-option-ai.active, .search-engine-option-keyword.active {
    background-color: var(--color-primary);
    color: #FFFFFF;
}
.search-engine-option-ai p, .search-engine-option-keyword p {
    font-weight: 500;
    font-size: clamp(12px, 1.4vw, 14px);
    margin: 0;
    text-align: center;
}


.library-body-container {
    display: flex;
    position: relative;
    flex-direction: row;
    justify-content: flex-start;
    align-content: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border-right: 1px solid var(--color-border);
}



.library-sidebar-container {
    display: flex;
    position: absolute;
    right: 0;
    top: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-content: center;
    width: 20%;
    height: 100vh;
    border-left: 1px solid var(--color-border);
}

.library-sidebar-header-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
}
.library-sidebar-header-container img {
    height: 15px;
    width: 15px;
    pointer-events: none;
    user-select: none;
}
.library-sidebar-header-container p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text);
    font-weight: 550;
}

.sources-filtering-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
}
.sources-filtering-header {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
}
.sources-filtering-header p {
    margin: 0;
    font-size: 12px;
    color: var(--color-text);
    font-weight: 600;
    text-align: right;
}

.sources-filtering-item, .sources-filtering-item-panel {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 16px;
    box-sizing: border-box;
}
.sources-filtering-item:last-child, .sources-filtering-item-panel:last-child {
    border-bottom: 1px solid var(--color-border);
}

.sources-filtering-item-title, .sources-filtering-item-title-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #9d9d9d;
    transition: color 0.3s ease;
}
.sources-filtering-item-title p, .sources-filtering-item-title-panel p {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
}
.sources-filtering-item-title.active, .sources-filtering-item-title-panel.active {
    color: var(--color-text);
}

.sources-filtering-item-switch, .sources-filtering-item-switch-panel {
    display: flex;
    justify-content: center;
    align-items: center;
}

.switch-container-filter, .switch-container-filter-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 32px;
    height: 16px;
    padding: 1px;
    border-radius: 999px;
    cursor: pointer;
    background-color: #9f9f9f;
}
.switch-container-filter.active, .switch-container-filter-panel.active {
    background-color: var(--color-primary-hover);
}
.toggle-switch-filter, .toggle-switch-filter-panel {
    width: 16px;
    height: 16px;
    background-color: var(--color-bg-soft);
    position: absolute;
    right: 1px;
    top: 1px;
    border-radius: 50%;
    transition: right 0.3s ease;
}
.toggle-switch-filter.active {
    right: 17px;
}


.library-body {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    justify-content: flex-start;
    align-items: center;
    width: calc(80% - 1px);
    height: 100%;
}

.library-body-table-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    height: 100%;
}

.library-body-table-tabs-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.library-body-table-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    width: 33.33%;
    color: var(--color-text);
    background-color: var(--color-bg-soft);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.library-body-table-tabs.active{
    /*background-color: var(--color-active-btn);*/
    color: var(--color-primary-hover);
    border-bottom: none;
    background-color: var(--color-bg);
}
.library-body-table-tabs p {
    margin: 0;
    font-size: clamp(12px, 1.2vw, 15px);
    font-weight: 600;
    text-align: center;
}


.library-body-table {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.library-gallery-container,.library-search-result-container, .library-word-desk-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: -500;
    transition: opacity 0.3s ease;
}
.library-gallery-container.show, .library-search-result-container.show, .library-word-desk-container.show  {
    z-index: 500;
    opacity: 1;
}

.library-gallery-tabs-container{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.library-gallery-tabs-slider {
    display: flex;
    flex-direction: row;
    align-content: center;
    justify-content: space-around;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    width: 100%;
    scrollbar-width: none;
    box-sizing: border-box;
}
.library-gallery-tabs-slider::-webkit-scrollbar {
    display: none;
}

.library-gallery-tabs, .library-gallery-tabs-search-result {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    flex: 0 0 max-content;
    scroll-snap-align: center;
    font-weight: 450;
    border-radius: 8px;
    background-color: transparent;
    margin-top: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, font-weight 0.2s ease;
}
.library-gallery-tabs:hover, .library-gallery-tabs-search-result:hover {
    font-weight: 550;
}
.library-gallery-tabs.active, .library-gallery-tabs-search-result.active {
    background-color: rgba(194, 160, 51, 0.2);
    font-weight: 550;
}
.library-gallery-tabs p, .library-gallery-tabs-search-result p {
    font-size: clamp(12px, 1.2vw, 14px);
    color: var(--color-text);
    text-align: center;
    margin: 0;
}

.library-gallery-content-container, .library-search-result-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-content: center;
    width: 100%;
    height: 100%;
}

.library-gallery-filter-bar {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    align-content: center;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 8px;
    border-bottom: 1px solid var(--color-border);
}

.filter-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #DCDCDC;
    border-radius: 999px;
}
.filter-btn p {
    margin: 0;
    font-size: clamp(11px, 1.3vw, 13px);
    color: var(--color-text);
    font-weight: 500;
}
.filter-btn img {
    width: 12px;
    height: 12px;
}

.filter-search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;

    position: relative;
}
.filter-search-container input {
    width: 100%;
    height: 38px;
    box-sizing: border-box;
    border-radius: 9999px;
    border: 1px solid transparent;
    direction: rtl;
    font-family: "PeydaWebVF", serif;
    font-size: clamp(12px, 1.4vw, 14px);
    padding: 3px 16px 4px 25px;
    background-color: #F5F5F5;
    color: var(--color-text);
    overflow-y: hidden;
    transition: background-color 0.5s ease, border-color 0.5s ease, height 0.3s ease-in;
}
.filter-search-container input:focus {
    outline: none;
    background-color: #F2F2F2;
}
.filter-search-container img {
    width: 12px;
    height: 12px;
    position: absolute;
    left: 10px;
    top: calc(50% - 6px);
}

.library-gallery-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.library-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    box-sizing: border-box;
    gap: 8px;
    width: 100%;
    padding: 8px;
    opacity: 0;
    z-index: -550;
    position: absolute;
    left: 0;
    top: 0px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}
.library-gallery.show {
    opacity: 1;
    z-index: 550;
}

.gallery-item-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    scroll-snap-align: center;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(100, 100, 100, 0.1);
    border: 1px solid var(--color-border);
    background-color: #FFFFFF;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.gallery-item-container:hover {
    box-shadow: 0 2px 4px rgba(194, 160, 51, 0.2);
    transform: scale(1.02);
}

.gallery-item-more {
    position: absolute;
    left: 5px;
    top: 5px;
    padding: 3px;
    display: flex;
    cursor: pointer;
    justify-content: center;
    border-radius: 5px;
    align-items: center;
    background-color: transparent;
    transition: background-color 0.3s ease;
}
.gallery-item-more.active {
    background-color: var(--color-active-btn);
}
.gallery-item-more:hover {
    background-color: var(--color-active-btn);
}
.gallery-item-more img {
    pointer-events: none;
    user-select: none;
    width: 20px;
    height: 20px;
}
.gallery-item-more p {
    margin: 0;
    font-size: 0px;
    font-weight: 400;
    color: var(--color-text);
}

.gallery-item-img-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 110px;
    border-radius: 10px;
    position: relative;
}

.gallery-item-img-placeholder {
    display: flex;
    justify-content: center;
    align-self: center;
    position: absolute;
    background-color: #ddd;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.gallery-item-img{
    object-fit: cover;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.gallery-item-info-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 4px;
}
.gallery-item-info-container h5 {
    width: 100%;
    font-style: normal;
    font-weight: 550;
    font-size: 13px;
    line-height: 21px;
    text-align: center;
    color: #464646;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gallery-item-info-container h6 {
    height: 18px;
    font-style: normal;
    font-weight: 500;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    color: #969696;
    flex: none;
    margin: 0;
    order: 1;
    flex-grow: 0;
}
.gallery-item-info-container p {
    height: 18px;
    font-style: normal;
    font-weight: 500;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    color: #969696;
    margin: 0;
    flex: none;
    order: 2;
    flex-grow: 0;
}



.library-result {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.library-result-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 4px rgba(10, 10, 10, 0.15);
}

.result-info-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    box-sizing: border-box;
    width: 100%;
}

.result-info-img {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
}

.result-img-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 120px;
    border-radius: 5px;
}
.result-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
    border-radius: 5px;
}

.result-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
}
.result-info h5 {
    margin: 0;
    font-size: clamp(14px, 1.4vw, 16px);
    font-weight: 700;
    color: var(--color-text);
    text-align: right;
}
.result-info h6 {
    margin: 0;
    font-size: clamp(12px, 1.4vw, 13px);
    font-weight: 600;
    color: var(--color-text);
    text-align: right;
}
.result-info p {
    margin: 0;
    font-size: clamp(12px, 1.4vw, 12px);
    font-weight: 500;
    color: #8d8d8d;
    text-align: right;
}

.result-info-buttons-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.read-full-btn, .show-hide-pages-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 150px;
    background-color: var(--color-primary);
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    gap: 8px;
    color: #FFFFFF;
    transition: background-color 0.3s ease;
}

.show-hide-pages-btn {
    background-color: var(--color-secondary);
}
.show-hide-pages-btn:hover {
    background-color: #162942;
}
.read-full-btn:hover {
    background-color: var(--color-primary-hover);
}
.read-full-btn p, .show-hide-pages-btn p{
    margin: 0;
    font-size: clamp(12px, 1.4vw, 13px);
    color: #FFFFFF;
    font-weight: 550;
    text-align: center;
}
.read-full-btn img, .show-hide-pages-btn img {
    width: 18px;
    height: 18px;
    pointer-events: none;
    user-select: none;
}

.result-pages-container {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
    max-height: 0px;
    transition: max-height 0.3s ease, padding-bottom 0.3s ease, padding-top 0.3s ease;
    gap: 8px;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.result-pages-container.expand {
    max-height: 1000px;
    padding-bottom: 8px;
    padding-top: 8px
}

.result-page-item {
    display: inline-block;
    justify-content: center;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    background-color: var(--color-bg-soft);
    border: 1px solid var(--color-border);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.result-page-item.show {
    opacity: 1;
}
.result-page-item p {
    margin: 0;
    font-size: 11px;
    font-weight: 450;
    color: var(--color-text);
    text-align: center;
}

.results-reference-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 32px;
    padding: 16px;
}

.download-reference {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-soft);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.download-reference:hover {
    background-color: var(--color-active-btn);
}
.download-reference p {
    margin: 0;
    font-size: 11px;
    font-weight: 450;
    color: var(--color-text);
    text-align: center;
}
.download-reference img {
    width: 18px;
    height: 18px;
    pointer-events: none;
    user-select: none;
}














.library-word-desk-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, 135px);
    width: 100%;
    padding: 16px;
    gap: 8px;
    align-items: flex-start;
    box-sizing: border-box;
}
.create-new-word-desk-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
    padding: 16px;
    width: 100px;
    height: 100px;
    gap: 8px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(100, 100, 100, 0.1);
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease;
}
.create-new-word-desk-btn:hover {
    transform: scale(0.95);
}
.create-new-word-desk-btn img {
    width: 50px;
    height: 50px;
    pointer-events: none;
    user-select: none;
}
.create-new-word-desk-btn p {
    font-size: 14px;
    color: var(--color-text);
    font-weight: 500;
    margin: 0;
}


.word-desk-item {
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-bg);
    padding: 16px;
    width: 100px;
    height: 100px;
    gap: 8px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(100, 100, 100, 0.1);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.word-desk-item.active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.2);
}
.word-desk-item-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}
.word-desk-item-title img {
    width: 25px;
    height: 25px;
    pointer-events: none;
    user-select: none;
}
.word-desk-item-title p {
    font-size: 13px;
    color: var(--color-text);
    font-weight: 500;
    margin: 0;
    line-height: 21px;
    display: -webkit-box;
    text-overflow: ellipsis;
    max-width: 98px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

.word-desk-item-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: flex-end;
    padding: 6px 0px;
    background-color: var(--color-bg-soft);
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    border: 1px solid var(--color-primary);
    transition: background-color 0.3s ease;
}
.word-desk-item-btn.active {
    background-color: var(--color-primary);
}
.word-desk-item-btn p {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
}


.work-desk-option-btn {
    position: absolute;
    left: 5px;
    top: 5px;
    width: 20px;
    height: 20px;
    padding: 0 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.work-desk-option-btn img {
    width: 100%;
    height: 100%;
    user-select: none;
    pointer-events: none;
}
.work-desk-option-btn:hover{
    background-color: var(--color-active-btn);
}
.work-desk-option-btn.active {
    background-color: var(--color-active-btn);
}









.library-gallery-items-option-panel, .create-new-work-desk-panel, .works-desk-option-panel, .filtering-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: absolute;
    bottom: -150%;
    left: 0;
    width: 100%;
    border-radius: 10px 10px 0 0;
    background-color: var(--color-bg);
    min-height: 50%;
    z-index: -1500;
    transition: bottom 0.3s ease;
}
.library-gallery-items-option-panel.show, .create-new-work-desk-panel.show, .works-desk-option-panel.show, .filtering-panel.show {
    bottom: 0;
    z-index: 1500;
}

.library-gallery-items-option-panel-header, .create-new-work-desk-panel-header, .work-desk-option-panel-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 16px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--color-border);
}
.library-gallery-items-option-panel-header p, .create-new-work-desk-panel-header p, .work-desk-option-panel-header p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
}
.library-gallery-items-option-panel-header img, .create-new-work-desk-panel-header img, .work-desk-option-panel-header img {
    cursor: pointer;
    user-select: none;
}


.library-gallery-items-option {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    gap: 16px;
}

.library-gallery-items-option-img-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    width: 282px;
    min-height: 350px;
    border-radius: 10px;
    padding: 16px;
    box-sizing: border-box;
    position: relative;
}
.library-gallery-items-option-img-placeholder {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: #ddd;
    border-radius: 10px;
}
.library-gallery-items-option-img {
    width: 250px;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
}

.library-gallery-items-option-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: calc(100% - 256px);

}

.library-gallery-items-option-info-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 16px;
    box-sizing: border-box;
    gap: 8px;
    width: 100%;
}

.library-gallery-items-option-info {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
}
.library-gallery-items-option-info h5 {
    margin: 0;
    font-size: clamp(14px, 1.4vw, 16px);
    font-weight: 700;
    color: var(--color-text);
    text-align: right;
    display: -webkit-box;
    text-overflow: ellipsis;
    max-width: 100%;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.library-gallery-items-option-info p {
    margin: 0;
}

.library-gallery-items-option-btn-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    padding: 16px;
    gap: 16px;
    box-sizing: border-box;
}

.add-to-desk-btn, .read-full-btn-option {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 180px;
    background-color: var(--color-secondary);
    border-radius: 6px;
    padding: 10px 16px;
    box-sizing: border-box;
    cursor: pointer;
    gap: 8px;
    color: #FFFFFF;
    transition: background-color 0.3s ease;
}
.add-to-desk-btn:hover {
    background-color: #162942;
}
.read-full-btn-option {
    background-color: var(--color-primary);
}
.read-full-btn-option:hover {
    background-color: var(--color-primary-hover);
}
.add-to-desk-btn p, .read-full-btn-option p {
    margin: 0;
    font-size: clamp(12px, 1.4vw, 13px);
    color: #FFFFFF;
    font-weight: 550;
    text-align: center;
}
.add-to-desk-btn img, .read-full-btn-option img {
    width: 18px;
    height: 18px;
    pointer-events: none;
    user-select: none;
}

.create-new-work-desk-panel, .work-desk-option-panel-header {
    min-height: max-content;
}

.create-new-work-desk-panel-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.create-new-work-desk-panel-input {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 16px;
    padding: 16px 0;
}
.create-new-work-desk-panel-input p {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    margin: 0;
    box-sizing: border-box;
}
.create-new-work-desk-panel-input input {
    font-family: 'PeydaWebVF', serif;
    font-size: 14px;
    background-color: #F5F5F5;
    padding: 5px 10px 5px 36px;
    width: calc(100% - 46px);
    height: 40px;
    border-radius: 10px;
    direction: rtl;
    border: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.create-new-work-desk-panel-input input:focus {
    outline: none;
    background-color: #F2F2F2;
}

.create-new-work-desk-panel-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 10px 0;
    width: 100%;
    background-color: var(--color-primary);
    border-radius: 10px;
    transition: background-color 0.3s ease;
}
.create-new-work-desk-panel-btn p {
    font-size: 16px;
    font-weight: 500;
    color: #FFFFFF;
    margin: 0;
}
.create-new-work-desk-panel-btn img {
    width: 20px;
    height: 20px;
}
.create-new-work-desk-panel-btn:hover {
    background-color: var(--color-primary-hover);
}


.works-desk-option-panel-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.work-desk-content-list-container {
    display: flex;
    align-items: center;
    height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.work-desk-content-list-title {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 16px 16px 8px 16px;
    box-sizing: border-box;
}
.work-desk-content-list-title p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
    text-align: right;
}

.work-desk-content-list {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    overflow: hidden;
    height: max-content;
}

.work-desk-content-list-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 16px;
    width: 100%;
    box-sizing: border-box;
}

.work-desk-content-list-item p{
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
}

.work-desk-rename-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.work-desk-rename-title {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 16px 16px 8px 16px;
    box-sizing: border-box;
}

.work-desk-rename-title p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
    text-align: right;
}

.work-desk-rename-body {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 8px 16px;
    gap: 10px;
    box-sizing: border-box;
}

.work-desk-rename-body input {
    font-family: 'PeydaWebVF', serif;
    font-size: 14px;
    background-color: #F5F5F5;
    padding: 5px 10px 5px 36px;
    width: calc(100% - 80px);
    height: 35px;
    border-radius: 10px;
    direction: rtl;
    border: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.work-desk-rename-body input:focus {
    outline: none;
    background-color: #F2F2F2;
}

.work-desk-rename-submit-btn {
    width: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.work-desk-rename-submit-btn p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.delete-work-desk-container{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.work-desk-delete-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 0;
    background-color: var(--color-danger);
    border-radius: 10px;
}

.work-desk-delete-btn p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
}



.filtering-panel-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--color-border);
}

.filtering-panel-header-title {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
}
.filtering-panel-header-title img {
    width: 16px;
    height: 16px;
    user-select: none;
    pointer-events: none;
}
.filtering-panel-header-title p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
}

.filtering-panel-header-close {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3px;
}
.filtering-panel-header-close img {
    pointer-events: none;
    user-select: none;
}

.filtering-panel-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.filtering-panel-sources {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.doc-viewer-navigator {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    left: 8px;
    bottom: 60px;
    z-index: 3001;
    height: max-content;
}

.doc-viewer-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    cursor: pointer;
}
.doc-viewer-btn img {
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
}



/* Mobile */
@media (max-width: 410px) {
    .library-top-navbar-search-options {
        flex-direction: column;
        width: 100% !important;
    }
    .switch-search-engine-container {
        width: 100% !important;
    }
    .keyword-search-modes-dropdown-btn {
        display: none !important;
    }
    .keyword-search-modes {
        display: flex !important;
        width: calc(100vw - 16px) !important;
        box-sizing: border-box !important;
    }
    .keyword-search-modes-container {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .library-gallery {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    .gallery-item-container {
        flex-direction: row;
        justify-content: space-between;
        border-radius: 0px;
        padding: 8px;
        border: none !important;
        border-bottom: 1px solid var(--color-border) !important;
        box-shadow: none !important;

    }
    .gallery-item-info-container {
        align-items: flex-start;
        width: calc(100% - 80px);
        padding: 0 8px 0 0;
        box-sizing: border-box;
    }
    .library-gallery-content-container {
        padding: 8px 0;
    }
    .gallery-item-info-container h5 {
        text-align: right;

    }
    .gallery-item-info-container h6 {
        text-align: right;

    }
    .gallery-item-info-container p {
        text-align: right;

    }
    .gallery-item-container:hover {
        box-shadow: none;
        transform: scale(1);
    }

}

/* Mobile */
@media (max-width: 552px) {
    .search-container {
        width: 100% !important;
    }
    .library-top-navbar {
        flex-direction: column;
        gap: 8px !important;
    }
    .switch-search-engine-dropdown {
        display: none !important;
        height: 40px;
    }
    .switch-search-engine-container {
        display: flex !important;
        box-sizing: border-box;
        height: 40px;
    }
    .keyword-search-modes {
        height: 40px;
    }
    .keyword-search-modes-container {
        height: 40px;
    }
    .library-top-navbar-search-options {
        width: 100% !important;
        gap: 8px !important;
    }
    .library-gallery-tabs {
        padding: 8px 16px;
    }
    .library-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
/* Mobile */
@media (max-width: 750px) {
    .switch-search-engine-container {
        display: none;
    }
    .switch-search-engine-dropdown {
        display: flex;
    }
    .search-container {
        width: calc(100% - 250px);
    }
    .library-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
    .library-gallery-items-option {
        flex-direction: column;
    }
    .library-gallery-items-option-img-container {
        min-height: unset;
        width: 100%;
    }
    .library-gallery-items-option-img {
        width: 200px;
    }
    .library-gallery-items-option-body {
        width: 100%;
    }
    .add-to-desk-btn {
        width: 100%;
    }
    .read-full-btn-option {
        width: 100%;
    }
}
/* Mobile */
@media (max-width: 991.999px) {
    .keyword-search-modes {
        display: none;
    }
    .keyword-search-modes-dropdown-btn {
        display: flex;
    }
    .library-sidebar-container {
        display: none;
    }
    .library-body {
        width: 100%;
    }
    .main-library {
        height: calc(100vh - 133px);
    }

}

/* desktop */
@media (min-width: 992px) {
    .keyword-search-modes {
        display: flex;
    }
    .keyword-search-modes-dropdown-btn {
        display: none;
    }
    .filter-btn {
        display: none;
    }
}