/* ========================================
   SEARCH BAR
\========================================= /

/* =========================================
   BOOK CARD INTERACTIONS
\========================================= */

/* Smooth hover effect */
.card-container {
    transition:
        transform 0.35s cubic-bezier(.2, .8, .2, 1),
        opacity 0.25s ease;
}

@media (hover: hover) and (pointer: fine){
    .card-container:not(.active):not(.hidden):hover {
        transform: translateY(-7px);
    }
}

/* More refined card flip */
.card {
    transition:
       transform 0.65s cubic-bezier(.2, .75, .25, 1);
}
/* Book tile animation */
.book-name {

    transition:
        transform 0.35s ease,
        background 0.35s ease,
       box-shadow 0.35s ease;

}

@media (hover: hover) and (pointer: fine){
    .card-container:hover .book-name {

        transform: translateY(-4px);
        background: rgba(255, 255, 255, 0.38);
    }
}

/* Download link interaction */
.detail a {
    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

.detail a:hover {
    transform: translateY(-2px);
}

/* Close button */
.close-btn {
    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

.close-btn:hover {
    transform: rotate(90deg) scale(1.12);
    opacity: 0.75;
}

/* Filter buttons */
.filter-buttons button {
    transition:        transform 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease;
}

.filter-buttons button:active {
    transform: scale(0.95);
}

/* Keyboard accessibility */
.filter-toggle:focus-visible,
.filter-buttons button:focus-visible,
.close-btn:focus-visible,
.detail a:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 4px;
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce){
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.search-container {
    position: fixed;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    width: min(92%, 600px);
    max-width: 600px;
    margin: 0;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 900;
    box-sizing: border-box;
    transition: width 0.3s ease;
}
#searchInput {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 17px 22px;
    box-sizing: border-box;
    font-size: 15px;
    font-family: inherit;
    color: var(--fg);
    background: color-mix(in srgb, var(--c-glass) 5%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
    border-radius: 50px;
    outline: none;
    box-shadow: var(--box-shadow);
    transition: transform 0.4s ease, background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    outline: none;
}
#searchInput::placeholder {
    color: var(--fg);
    opacity: 0.65;
}
#searchInput:hover,
#searchInput:focus {
    transform: scale(1.008);
    background: color-mix(in srgb, var(--c-glass) 25%, transparent);
    box-shadow: var(--box-shadow);
    transform: translateY(-1px);
}
/* Search overlay */
.overlay.no-translate {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    font-weight: 600;
}
/* =========================================
   BOOK GRID
\========================================= */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 300px));
    justify-content: center;
    gap: 25px;
    width: 100%;
    box-sizing: border-box;
    padding: 30px 20px;
    margin: 100px auto 40px;
}

.card-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: 400px;
    margin: 0 auto;
    perspective: 1200px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}



/* Both card sides */



.card {

    position: absolute;

    inset: 0;

    width: 100%;

    height: 100%;

    margin: 0;



    display: flex;

    flex-direction: column;

    align-items: center;



    border-radius: 35px;

    backface-visibility: hidden;

    -webkit-backface-visibility: hidden;

    transform-style: preserve-3d;



    box-shadow:

        inset 0 0 0 1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 60%), transparent),

        inset 2px 1px 0 -1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 20%), transparent),

        inset -1.5px -1px 0 -1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 20%), transparent),

        inset -2px -6px 1px -5px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 60%), transparent),

        inset -1px 2px 3px -1px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 30%), transparent),

        inset 0 -4px 1px -2px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 70%), transparent),

        0 3px 6px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 50%), transparent);



    cursor: pointer;

    transition: transform 0.6s ease;

}



/* Front of card */



.teaser {

    background-size: cover;

    background-position: center;

    background-repeat: no-repeat;

    transform: rotateY(0deg);



    display: flex;

    flex-direction: column;

    justify-content: flex-end;

}



/* Book name */



.book-name {
    width: 80%;
    box-sizing: border-box;
    padding: 10px;
    margin: 0 auto 5%;
    text-align: center;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-radius: 45px;
    box-shadow: var(--box-shadow);
}



/* Back of card */

.detail {
    transform: rotateY(180deg);
    justify-content: center;
    align-items: center;
    text-align: center;

    padding: 25px;
    box-sizing: border-box;

    background: none;
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(15px);
}

.detail h2 {
    margin-bottom: 20px;
    color: var(--fg);
}

.detail a {
    display: block;
    margin: 10px 0;
    color: var(--fg);
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.2s ease;
}

.detail a:hover {
    text-decoration: underline;
    opacity: 0.75;
}

/* Close button */

.close-btn {
    position: absolute;
    top: 12px;
    right: 18px;
    z-index: 30;
    font-size: 28px;

    line-height: 1;

    cursor: pointer;

    color: var(--fg);

    border-radius: 50px;

}



/* Card flip */



.card-container.active .teaser {

    transform: rotateY(-180deg);

}



.card-container.active .detail {

    transform: rotateY(0deg);

}



/* Hidden cards */



.card-container.hidden {

    display: none;

}


/* Files heading */

.files-title {
    padding: 12px 25px;
    box-shadow: var(--box-shadow);
}

/* Small book preview */

.little-book-page {
    position: absolute;
    top: 7%;
    left: 7%;
    width: 69px;
    height: 97px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 6px;
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 60%), transparent),
        inset 2px 1px 0 -1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 20%), transparent),
        inset -1.5px -1px 0 -1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 20%), transparent),
        inset -2px -6px 1px -5px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 60%), transparent),
        inset -1px 2px 3px -1px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 30%), transparent),
        inset 0 -4px 1px -2px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 70%), transparent),
        0 3px 6px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 50%), transparent);
    transform: rotate(-6deg);
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease 0.2s;
}

.card-container.active .detail .little-book-page {
    opacity: 1;
}

/* =========================================
   FILTER TOGGLE
\========================================= */

.filter-toggle,
.toggle-filters-button {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;

    align-items: center;

    justify-content: center;



    padding: 0;
    margin: 0;



    color: var(--fg);

    font-size: 12px;



    background: color-mix(in srgb, var(--c-glass) 5%, transparent);

    backdrop-filter: blur(12px);

    -webkit-backdrop-filter: blur(12px);



    border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);

    border-radius: 50px;



    box-shadow: var(--box-shadow);

    cursor: pointer;

    transition: background 0.3s ease, transform 0.3s ease,

                border-radius 0.3s ease;

}



.filter-toggle:hover,

.toggle-filters-button:hover {

    box-shadow: var(--box-shadow);
    transform: scale(1.05);

}



.arrow {

    display: inline-block;

    transition: transform 0.3s ease;

}



.arrow.rotated {

    transform: rotate(180deg);

}



/* =========================================

   FILTER PANEL

\========================================= */



/* =========================================

   SMOOTH FILTER PANEL

\========================================= */



.filter-sections {

    position: fixed;

    top: 200px;

    left: 50%;



    transform: translate(-50%, -12px) scale(0.97);

    transform-origin: top center;



    width: min(92%, 900px);

    max-height: min(70vh, 650px);



    overflow-x: hidden;

    overflow-y: auto;



    display: flex;

    flex-wrap: wrap;

    justify-content: center;

    align-content: flex-start;

    gap: 20px;



    margin: 0;

    padding: 20px 15px;

    box-sizing: border-box;



    opacity: 0;

    visibility: hidden;

    pointer-events: none;



    background: color-mix(in srgb, var(--c-glass) 12%, transparent);



    backdrop-filter: blur(12px);

    -webkit-backdrop-filter: blur(12px);



    border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);

    border-radius: 35px;



    box-shadow: var(--box-shadow);

    z-index: 1400;



    transition:

        opacity 0.22s ease,

        transform 0.28s cubic-bezier(.2, .8, .2, 1),

        visibility 0.22s;

}



.filter-sections.open {

    transform: translate(-50%, 0) scale(1);



    opacity: 1;

    visibility: visible;

    pointer-events: auto;

}



/* Filter groups enter smoothly */



.filter-group {

    min-width: 150px;

    margin: 0 10px;

}



.filter-sections .filter-group {

    opacity: 0;

    transform: translateY(8px);

    transition:

        opacity 0.25s ease,

        transform 0.3s ease;

}



.filter-sections.open .filter-group {

    opacity: 1;

    transform: translateY(0);

}



.filter-sections.open .filter-group:nth-child(2) {

    transition-delay: 0.04s;
}

.filter-sections.open .filter-group:nth-child(3) {

    transition-delay: 0.08s;
}

/* Arrow */

.arrow {
    display: inline-block;
    transition: transform 0.28s ease;
}



/* Mobile */

@media screen and (max-width: 480px){
    .filter-sections {
        top: 160px;
        width: 94%;
        max-height: 65vh;
        border-radius: 35px;
    }

    .filter-sections.open {
        padding: 15px 10px;
    }

    .filter-group {
        width: 100%;
        margin: 5px 0;
    }
}


/* Tablet */

@media screen and (min-width: 700px){
    .filter-sections {
        top: 200px;
        width: min(88%, 900px);
    }
}

/* Desktop */

@media screen and (min-width: 1000px){
    .filter-sections {
        top: 230px;
        width: min(85%, 1000px);
    }
}

.filter-group {
    margin: 0 10px;
    min-width: 150px;
}

.filter-group h4,
.filter-group label {
    display: block;
    text-align: center;
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--fg);
}
/* Filter buttons */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.filter-buttons button {
    margin: 0;
    padding: 9px 16px;
    color: var(--fg);
    font-weight: 550;
    background: color-mix(in srgb, var(--c-glass) 25%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-radius: 50px;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.25s ease, transform 0.25s ease;
}

.filter-buttons button:hover {
    background: color-mix(in srgb, var(--c-glass) 50%, transparent);
    transform: translateY(-2px);
}

.filter-buttons button.active {
    background: color-mix(in srgb, var(--fg) 50%, transparent);
    transform: scale(1.04);
}

/* Ripple effect */

.ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple{
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* =========================================
   COMING SOON
\========================================= */

#coming-soon {
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    color: var(--fg);
    padding: 20px;
    font-size: clamp(28px, 5vw, 48px);
}

/* =========================================
   TABLET
\========================================= */
@media screen and (min-width: 700px){
    .search-container {
        top: 120px;
        width: min(85%, 650px);
    }

    #searchInput {
        padding: 20px 25px;
        font-size: 16px;
    }



    .filter-toggle,

    .toggle-filters-button {

        width: 62px;

        height: 62px;

    }



    .filter-sections {

        top: 185px;

        width: min(88%, 900px);

    }



    .books-grid {

        grid-template-columns: repeat(auto-fit, minmax(260px, 300px));

        gap: 30px;

        margin-top: 120px;

    }

}



/* =========================================

   DESKTOP

\========================================= */



@media screen and (min-width: 1000px){

    .search-container {

        top: 150px;

        width: min(75%, 700px);

    }



    #searchInput {

        padding: 21px 28px;

        font-size: 17px;

    }



    .filter-toggle,

    .toggle-filters-button {

        width: 66px;

        height: 66px;

    }



    .filter-sections {

        top: 230px;

        width: min(85%, 1000px);

    }



    .books-grid {

        gap: 35px;

        margin-top: 130px;

    }

}



/* =========================================

   SMALL MOBILE

\========================================= */



@media screen and (max-width: 480px){

    .search-container {

        top: 100px;

        width: 94%;

        gap: 8px;

        padding: 5px;

    }



    #searchInput {

        padding: 15px 17px;

        font-size: 13px;

    }



    .filter-toggle,

    .toggle-filters-button {

        width: 48px;

        height: 48px;

        font-size: 10px;

    }



    .filter-sections {

        top: 145px;

        width: 94%;

        border-radius: 35px;

    }



    .filter-sections.open {

        max-height: 65vh;

        padding: 15px 10px;

    }



    .filter-group {

        width: 100%;

        margin: 5px 0;

    }



    .filter-buttons button {

        padding: 8px 12px;

        font-size: 12px;

    }



    .books-grid {

        grid-template-columns: minmax(0, 300px);

        gap: 22px;

        padding: 20px 12px;

        margin-top: 100px;

    }



    .card-container {

        height: 380px;

    }



    .book-name {

        font-size: 14px;

    }



    .detail a {

        font-size: 14px;

    }

}



/* =========================================

   ACCESSIBILITY

\========================================= */



@media (prefers-reduced-motion: reduce){

    .card,

    .card-container,

    .search-container,

    #searchInput,

    .filter-sections,

    .filter-buttons button {

        transition: none !important;
    }
}

/* =========================================================
   RASHT ENGLISH LIBRARY — BOOK CARD ACTIONS & INFORMATION
   These rules extend the uploaded stylesheet and preserve
   its existing search, filters, grid, and flip-card layou
\========================================================= */

/* Make the front a positioning context for its controls */
.card.teaser {
    position: absolute;
    overflow: hidden;
    isolation: isolate;
    justify-content: flex-end;

}



/* Readable cover overlay */

.card.teaser::before {

    content: "";

    position: absolute;

    inset: 0;

    z-index: 0;

    pointer-events: none;

    background: linear-gradient(

        to bottom,

        rgba(0, 0, 0, .30) 0%,

        rgba(0, 0, 0, 0) 34%,

        rgba(0, 0, 0, .10) 52%,

        rgba(0, 0, 0, .78) 100%

    );

}



/* Keep all front content above the overlay */

.card.teaser > * {

    position: relative;

    z-index: 1;

}



/* Top-right icon-only action buttons */

.book-card-actions {

    position: absolute !important;

    top: 13px;

    right: 13px;

    z-index: 8 !important;

    display: flex;

    align-items: center;

    gap: 8px;

    direction: ltr;

}



.book-icon-btn {
    width: 35px;
    height: 35px;
    min-width: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    color: #fff;
    background: rgba(25, 30, 42, .30);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: transform .22s ease, background .22s ease,
                color .22s ease, box-shadow .22s ease;
   -webkit-tap-highlight-color: transparent;
}

.book-icon-btn:hover {
    transform: translateY(-2px) scale(1.07);
    background: rgba(255,255,255,.30);
    box-shadow: 0 7px 18px rgba(0,0,0,.22);
}

.book-icon-btn:active {
    transform: scale(.91);
}

.book-icon-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.book-favourite-btn.is-favourite {
    color: #ff5577;
    background: rgba(255,255,255,.88);
    border-color: rgba(255,255,255,.9);
}

/* Front title */
.card.teaser .book-name {
    z-index: 2;
    width: calc(100% - 34px);
    margin: 0 auto 11px;
    padding: 11px 13px;
    color: #fff;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 750;
    text-align: center;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 9px rgba(0,0,0,.65);
    background: rgba(255,255,255,.17);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 20px;
    backdrop-filter: blur(13px);
    -webkit-backdrop-filter: blur(13px);
    box-shadow: 0 5px 18px rgba(0,0,0,.12);
}
/* Genre and level pills */
.book-tags {
    position: relative;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0 1px 17px;
    margin-bottom: -8%;
}
.book-tag {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    padding: 7px 11px;

    border: 1px solid rgba(255,255,255,.40);

    border-radius: 30px;

    color: #fff;

    background: rgba(255,255,255,.20);

    backdrop-filter: blur(12px);

    -webkit-backdrop-filter: blur(12px);

    box-shadow: 0 3px 10px rgba(0,0,0,.12);

    font-size: 11px;

    font-weight: 650;

    line-height: 1;

    white-space: nowrap;

}



.book-tag i {

    font-size: 10px;

}



.book-tag.level-tag[data-level="starter"] {

    background: rgba(36, 170, 115, .34);

}



.book-tag.level-tag[data-level="intermediate"] {

    background: rgba(225, 151, 42, .36);

}



.book-tag.level-tag[data-level="advanced"] {

    background: rgba(147, 91, 220, .38);

}



/* Do not let hover title styling affect action controls */

@media (hover: hover) and (pointer: fine){

    .card-container:hover .book-card-actions .book-icon-btn {

        transform: none;

    }

    .card-container:hover .book-card-actions .book-icon-btn:hover {

        transform: translateY(-2px) scale(1.07);

    }

}



/* Ensure detail-side action links and controls are clickable */

.detail {
    overflow: hidden;
}

.detail .book-info-btn,
.detail .book-favourite-btn {
    display: none; /* Actions now live on the front of each card */
}

/* =========================================================
   BOOK INFORMATION MODAL
\========================================================= */

.book-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
}

.book-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.book-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 13, 24, .52);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

.book-modal-content {
    position: relative;
    z-index: 1;
    width: min(100%, 540px);
    max-height: min(86vh, 760px);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding: 27px;
    border: none;
    border-radius: 35px;
    color: var(--fg, #202638);
    background: color-mix(in srgb, var(--c-glass, #fff) 10%, transparent);
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(28px) saturate(155%);
    -webkit-backdrop-filter: blur(28px) saturate(155%);
    transform: translateY(16px) scale(.98);
    transition: transform .3s cubic-bezier(.2,.8,.2,1);
}

.book-modal.active .book-modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 13px;
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    color: var(--fg, #222);
    background: none;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}
.modal-book-header {
    display: flex;
    align-items: center;
    gap: 19px;
    padding-right: 20px;

}



.modal-book-cover {

    flex: 0 0 104px;

    width: 104px;

    height: 145px;

    overflow: hidden;

    border-radius: 12px;

    background: rgba(120,130,150,.14);

    box-shadow: 0 7px 20px rgba(0,0,0,.17);

}



.modal-book-cover img {

    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

}



.modal-book-heading {

    min-width: 0;

}



.modal-label {

    display: block;

    margin-bottom: 8px;

    color: var(--fg, #526078);

    opacity: .65;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1.4px;

}



.modal-book-heading h2 {

    margin: 0 0 10px;

    color: var(--fg, #202638);

    font-size: 21px;

    line-height: 1.35;

    overflow-wrap: anywhere;

}



.modal-book-rating {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    color: #d69b22;

    font-size: 14px;

    font-weight: 750;

}



.modal-book-rating span:first-child {

    font-size: 18px;

}



.modal-book-divider {

    height: 1px;

    margin: 21px 0;

    background: color-mix(in srgb, var(--fg, #222) 14%, transparent);

}



.modal-book-details {

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;

}

.modal-info-item {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 12px;
    border: none;
    border-radius: 35px;
    background: color-mix(in srgb, var(--c-glass, #fff) 28%, transparent);

}

.modal-info-label {
    color: var(--fg, #526078);
    opacity: .65;
    font-size: 10px;
    font-weight: 650;
}

.modal-info-item span:last-child {
    color: var(--fg, #202638);
    font-size: 12px;
    font-weight: 750;
    overflow-wrap: anywhere;

}



.modal-book-description {

    margin-top: 22px;

}



.modal-book-description h3 {

    margin: 0 0 9px;

    color: var(--fg, #202638);

    font-size: 16px;

}



.modal-book-description p {

    margin: 0;

    color: var(--fg, #526078);

    font-size: 13px;

    line-height: 1.8;
    opacity: .82;
}

.modal-book-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 23px;
}


.modal-done-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 35px;
    color: var(--fg, #fff);
    background:none;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease;
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(15px);
}

.modal-done-btn:hover {
    transform: translateY(-2px);
    opacity: .86;
}



/* Small screens */

@media (max-width: 600px){

    .book-card-actions {

        top: 10px;

        right: 10px;

        gap: 6px;

    }






    .card.teaser .book-name {

        width: calc(100% - 24px);

        font-size: 16px;

    }



    .book-tags {

        gap: 2px;

        padding-bottom: 13px;

    }



    .book-tag {

        padding: 6px 9px;

        font-size: 10px;

    }



    .book-modal {

        padding: 11px;

    }



    .book-modal-content {
        padding: 22px 25px;

    }



    .modal-book-cover {

        flex-basis: 82px;

        width: 82px;

        height: 116px;

    }



    .modal-book-heading h2 {

        font-size: 17px;

    }



    .modal-book-details {

        grid-template-columns: repeat(2, minmax(0, 1fr));

    }

}



@media (prefers-reduced-motion: reduce){

    .book-icon-btn,

    .book-modal,

    .book-modal-content,

    .modal-close,

    .modal-done-btn {

        transition: none !important;

    }

}












































/* =========================================================
   RASHT ENGLISH — PREMIUM BOOK CARD DESIGN
   ========================================================= */

:root {
    --book-radius: 25px;

    --book-text: #ffffff;
    --book-glass: rgba(255, 255, 255, 0.13);
    --book-glass-border: rgba(255, 255, 255, 0.25);
    --book-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

/* ---------- CARD CONTAINER ---------- */

.books-grid {
    align-items: stretch;
}

.card-container {
    position: relative;
    isolation: isolate;
    border-radius: var(--book-radius);
    perspective: 1200px;
    overflow: visible;

    transition:
        transform .35s cubic-bezier(.2,.8,.2,1),
        filter .35s ease;
}

.card-container:hover {
    transform: translateY(-7px);
}

/* ---------- CARD FRONT ---------- */

.card.teaser {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    isolation: isolate;
    overflow: hidden;
    min-height: 400px;
    height: 100%;
    padding: 20px;
    color: var(--book-text); 
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border: none;
    cursor: pointer;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Dark cinematic gradient over the cover */
.card.teaser::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(
            180deg,
            rgba(8, 15, 28, .16) 0%,
            rgba(8, 15, 28, .02) 32%,
            rgba(8, 15, 28, .42) 55%,
            rgba(8, 15, 28, .94) 100%
        );
    transition: opacity .35s ease;
}

.card.teaser::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background:

        linear-gradient(

            135deg,

            rgba(255,255,255,.15),

            transparent 35%,

            transparent 70%,

            rgba(255,255,255,.07)

        );

    pointer-events: none;

}



.card-container:hover .card.teaser::before {

    opacity: .88;

}

/* ---------- SERIES LABEL ---------- */

.book-series-label {
    position: relative;
    z-index: 3;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 100px);
    padding: 9px 13px;
    border: 1px solid var(--book-glass-border);
    border-radius: 999px;
    background: none;
    color: rgba(255,255,255,.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.1px;
    line-height: 1;
    box-shadow: 0 5px 18px rgba(0,0,0,.12);
}

.book-series-label i {
    font-size: 11px;
    color: #a5d8ff;
}



/* ---------- ACTION BUTTONS ---------- */



.book-card-actions {

    position: absolute;

    z-index: 8;

    top: 17px;

    right: 17px;

    display: flex;

    align-items: center;

    gap: 9px;

}






.book-icon-btn:hover {

    transform: translateY(-3px) scale(1.07);

    background: rgba(255,255,255,.25);

    border-color: rgba(255,255,255,.65);

    box-shadow: 0 9px 22px rgba(0,0,0,.25);

}



.book-icon-btn:active {

    transform: scale(.92);

}



.book-info-btn:hover {

    color: #a5d8ff;

}



.book-favourite-btn.is-favourite {

    color: #ff6b81;
    background: rgba(255, 80, 110, .2);
    border-color: rgba(255, 130, 150, .65);
}

.book-favourite-btn.is-favourite i {
    color: #ff7189;
}

/* ---------- FRONT CONTENT ---------- */

.book-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    margin-top: auto;
    padding-top: 105px;
}
/* ---------- TAGS ---------- */
.book-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    width: 100%;
}

.book-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    background: rgba(255,255,255,.13);
    color: rgba(255,255,255,.96);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .15px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 3px 10px rgba(0,0,0,.08);
    white-space: nowrap;
}



/* Individual tag colours */

.tag-category {
    background: rgba(76, 175, 145, .22);
   border-color: rgba(115, 225, 190, .35);

}

.tag-language {
    background: rgba(68, 145, 235, .22);
    border-color: rgba(125, 185, 255, .35);
}

.tag-level {
    background: rgba(158, 116, 255, .23);
   border-color: rgba(190, 160, 255, .38);

}

.tag-type {
    background: rgba(235, 169, 76, .2);
    border-color: rgba(255, 205, 125, .35);
}

/* ---------- BOOK TITLE ---------- */

.book-name {

    width: 100%;
    margin: 0;
    padding: 0;
    color: #fff;
    font-family: inherit;
    font-size: clamp(21px, 2vw, 27px);
    font-weight: 850;
    line-height: 1.2;
    letter-spacing: -.65px;
    text-align: left;
    text-shadow: 0 3px 16px rgba(0,0,0,.45);
    overflow-wrap: anywhere;
}

/* ---------- BOTTOM ROW ---------- */

.book-card-bottom {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 13px;
    border-top: 1px solid rgba(255,255,255,.24);
}

.book-series-name {
    color: rgba(255,255,255,.76);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
}

.book-open-hint {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    transition: gap .25s ease;
}

.card-container:hover .book-open-hint {
    gap: 12px;
}

.book-open-hint i {
    font-size: 10px;
}

/* ---------- KEYBOARD ACCESSIBILITY ---------- */

.book-icon-btn:focus-visible,
.close-btn:focus-visible,
.card.detail a:focus-visible {
    outline: 3px solid #8ecbff;
    outline-offset: 4px;
}

/* ---------- CARD BACK ---------- */



.card.detail .files-title {
    font-weight: 800;
    letter-spacing: -.3px;
}

.card.detail a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 19px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 750;
    transition: transform .25s ease, box-shadow .25s ease;
}

.card.detail a:hover {
    transform: translateY(-2px);
}

/* ---------- HIDDEN FILTERED CARDS ---------- */

.card-container.hidden {
    display: none !important;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 600px){
    .card.teaser {
        min-height: 360px;
        padding: 16px;
    }

    .book-card-actions {
        top: 13px;
        right: 13px;
        gap: 7px;
    }

    .book-icon-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .book-series-label {
        padding: 8px 10px;
        font-size: 9px;
    }



    .book-card-content {

        gap: 12px;

        padding-top: 85px;

    }



    .book-tags {

        gap: 2px;

    }



    .book-tag {

        padding: 7px 9px;

        font-size: 9px;

    }



    .book-name {

        font-size: 22px;

    }



    .book-series-name,

    .book-open-hint {

        font-size: 10px;

    }

}



@media (prefers-reduced-motion: reduce){

    .card-container,

    .book-icon-btn,

    .book-open-hint {

        transition: none !important;

    }

}




/* =========================================================
   FINAL STRUCTURAL FIXES
   Keep both faces in the same card plane so the flip works.
   ========================================================= */



.card {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    box-sizing: border-box;
}



.card-container.active .teaser {
    transform: rotateY(-180deg);
    z-index: 1;
}

.card-container.active .detail {
    transform: rotateY(0deg);
    z-index: 2;
}

.card.teaser::before {
    z-index: 0;
}

.card.teaser::after {
    z-index: 1;
}

.card.teaser > * {
    position: relative;
    z-index: 2;
}

.card.teaser .book-card-actions {
    position: absolute;
    z-index: 8;
}

.card.teaser .book-card-content {
    position: relative;
    z-index: 2;
}

.card-container:not(.active):not(.hidden) {
    cursor: pointer;
}

.card-container.active {
    z-index: 5;
}

@media (max-width: 600px){
    .card-container {
        height: 380px;
        min-height: 380px;
    }

    .card.teaser {
        min-height: 0;
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce){
    .card,
    .card-container {
        transition: none !important;
    }
}

































/* =========================================================
   RASHT ENGLISH — REFINED LIBRARY DESIGN
   Append this block at the END of your stylesheet.
   ========================================================= */

:root {
    --library-radius: 35px;
    --library-transition: .32s cubic-bezier(.2, .8, .2, 1);
}

/* ---------- BOOK GRID ---------- */

.books-grid {
    grid-template-columns: repeat(
        auto-fit,
        minmax(min(100%, 270px), 300px)
    );
    gap: 32px;
    padding: 35px 22px 55px;
}

/* ---------- CARD CONTAINER ---------- */



@media (hover: hover) and (pointer: fine){
    .card-container:not(.active):not(.hidden):hover {
        transform: translateY(-8px);
    }
}

/* More balanced cover gradient */

.card.teaser::before {
    background: linear-gradient(
        180deg,
        rgba(5, 12, 24, .08) 0%,
        rgba(5, 12, 24, .02) 28%,
        rgba(5, 12, 24, .42) 58%,
        rgba(5, 12, 24, .94) 100%
    );
    transition: opacity .4s ease;
}

.card-container:hover .card.teaser::before {
    opacity: .78;
}

/* ---------- SERIES LABEL ---------- */

.book-series-label {
    padding: 10px 14px;
    border-radius: 35px;
    background: rgba(15, 23, 42, .38);
    border: none;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    letter-spacing: 1.15px;
    font-size: 10px;
}

/* ---------- ACTION BUTTONS ---------- */

.book-card-actions {
    top: 16px;
    right: 16px;
    gap: 8px;
}



/* ---------- CARD CONTENT ---------- */

.book-card-content {
    gap: 16px;
    padding-top: 100px;
}

.book-tags {
    gap: 2px;
}

/* Three remaining tags */

.book-tag {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, .14);
    border: none;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}







/* ---------- BOOK TITLE ---------- */

.card.teaser .book-name {
    width: 100%;
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: clamp(21px, 2vw, 26px);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.5px;
    text-align: left;
    text-shadow: 0 3px 14px rgba(0, 0, 0, .45);
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* ---------- BOTTOM ROW ---------- */

.book-card-bottom {
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, .2);
}

.book-series-name {
    font-size: 11px;
    opacity: .78;
}

.book-open-hint {
    padding: 9px 12px;
    border-radius: 30px;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .2);
    transition:
        background .25s ease,
        gap .25s ease,
        transform .25s ease;
}

.card-container:hover .book-open-hint {
    background: rgba(255, 255, 255, .23);
}

/* ---------- BACK OF CARD ---------- */



.card.detail .files-title {
    margin: 0 0 25px;
    padding: 12px 20px;
    border-radius: 35px;
    font-size: 20px;
    font-weight: 800;
    background: color-mix(in srgb, var(--c-glass) 35%, transparent);
    border: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
}

.card.detail a {
    width: min(100%, 230px);
    box-sizing: border-box;
    padding: 14px 20px;
    margin: 9px 0;
    color: var(--fg);
    background: color-mix(in srgb, var(--c-glass) 45%, transparent);
    border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
    box-shadow: var(--box-shadow);
    font-size: 14px;
    font-weight: 750;
    transition:
        transform .25s ease,
        background .25s ease,
        box-shadow .25s ease;
}

.card.detail a:hover {
    transform: translateY(-3px);
    background: color-mix(in srgb, var(--c-glass) 15%, transparent);
}

.card.detail a i {
    font-size: 16px;
}

/* ---------- CLOSE BUTTON ---------- */

.close-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    top: 13px;
    right: 13px;
    background: none;
    border: none;
    font-size: 25px;
    transition:
        transform .25s ease,
        background .25s ease;
}

.close-btn:hover {
    transform: translateY(-2px);
}

/* ---------- SEARCH BAR ---------- */




/* ---------- FILTER PANEL ---------- */




/* =========================================
   PREMIUM FLOATING BOOK HEARTS
========================================= */

.card-container {
    position: relative;
    overflow: visible !important;
}

.floating-like-heart {
    position: absolute;
    z-index: 999;
    left: 50%;
    bottom: 0;

    display: block;
    pointer-events: none;
    user-select: none;

    color: #ff477e;
    font-size: var(--heart-size, 17px);
    line-height: 1;

    opacity: 0;

    transform: translate(-50%, 0) scale(.3);

    filter:
        drop-shadow(0 3px 5px rgba(255, 55, 120, .25));

    will-change: transform, opacity;

    animation:
        premium-heart-float
        var(--heart-duration, 1.7s)
        cubic-bezier(.18, .65, .35, 1)
        forwards;
}

@keyframes premium-heart-float{

    0% {
        opacity: 0;
        transform:
            translate(
                calc(-50% + var(--heart-x-start)),
                0
            )
            rotate(0deg)
            scale(.3);
    }

    12% {
        opacity: 1;
        transform:
            translate(
                calc(-50% + var(--heart-x-start)),
                -15px
            )
            rotate(var(--heart-rotation))
            scale(1);
    }

    45% {
        opacity: .95;
    }

    75% {
        opacity: .7;
    }

    100% {
        opacity: 0;
        transform:
            translate(
                calc(-50% + var(--heart-x-end)),
                var(--heart-rise)
            )
            rotate(calc(var(--heart-rotation) * 1.8))
            scale(.55);
    }
}

@media (prefers-reduced-motion: reduce){
    .floating-like-heart {
        display: none !important;
        animation: none !important;
    }
}


/* =========================================
   LIBRARY VIEW SWITCHER
========================================= */

.library-view-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0;
}

.library-view-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 12px 20px;
    min-height: 46px;

    border: 1px solid rgba(130, 130, 130, .17);
    border-radius: 50px;

    background: rgba(140, 140, 140, .07);
    color: var(--text-color, inherit);

    font: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background .3s ease,
        color .3s ease,
        border-color .3s ease,
        transform .3s ease,
        box-shadow .3s ease;
}

.library-view-btn:hover {
    transform: translateY(-2px);
    background: rgba(140, 140, 140, .13);
}

.library-view-btn:active {
    transform: scale(.96);
}

.library-view-btn.active {
    background: rgba(255, 71, 126, .12);
    border-color: rgba(255, 71, 126, .4);
    color: #ff477e;

    box-shadow:
        0 4px 18px rgba(255, 71, 126, .08);
}

.library-view-btn i {
    font-size: 15px;
}

.favourites-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 21px;
    height: 21px;
    padding: 0 6px;

    border-radius: 20px;

    background: rgba(255, 71, 126, .15);
    color: #ff477e;

    font-size: 11px;
    font-weight: 700;

    transition: transform .25s ease;
}

.library-view-btn.active .favourites-count {
    background: #ff477e;
    color: white;
}

/* Mobile */
@media (max-width: 480px){
    .library-view-switch {
        gap: 7px;
    }

    .library-view-btn {
        padding: 10px 15px;
        font-size: 12px;
    }
}
/* =========================================
   SEARCH + FAVOURITES BAR
========================================= */

.search-container {
    position: fixed;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);

    width: min(94%, 850px);
    max-width: 850px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px;
    box-sizing: border-box;

    z-index: 10;
}

/* Search input */

#searchInput {
    flex: 1 1 auto;
    min-width: 0;
}

/* Favourites button */

.favourites-search-btn {
    flex: 0 0 auto;
    min-height: 56px;
    padding: 0 17px;

    white-space: nowrap;

    border-radius: 50px;

    background: color-mix(
        in srgb,
        var(--c-glass) 5%,
        transparent
    );
    border: none;

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    transition:
        transform .25s ease,
        background .25s ease,
        border-color .25s ease;
        box-shadow: var(--box-shadow);
}

.favourites-search-btn:hover {
    transform: translateY(-2px);
    background: color-mix(in srgb, var(--c-glass) 25%, transparent);

}

.favourites-search-btn.active {
    color: #ff477e;
    background: rgba(255, 71, 126, .13);
    /* border-color: rgba(255, 71, 126, .4); */
    box-shadow: var(--box-shadow);
}

.favourites-search-btn i {
    color: #ff477e;
}

/* Filter button */

.search-container .filter-toggle {
    flex: 0 0 56px;
}

/* Tablet */

@media (min-width: 700px){
    .search-container {
        top: 100px;
        width: min(94%, 850px);
    }

    .favourites-search-btn {
        min-height: 62px;
    }
}

/* Desktop */

@media (min-width: 1000px){
    .search-container {
        top: 150px;
    }

    .favourites-search-btn {
        min-height: 66px;
    }

    .search-container .filter-toggle {
        flex-basis: 66px;
    }
}

/* Mobile */

@media (max-width: 600px){
    .search-container {
        top: 85px;
        width: 96%;
        gap: 6px;
        padding: 5px;
    }

    #searchInput {
        padding: 15px 12px;
        font-size: 12px;
    }

    .search-container .filter-toggle {
        flex: 0 0 45px;
        width: 45px;
        height: 48px;
        font-size: 9px;
    }

    .favourites-search-btn {
        min-height: 48px;
        padding: 0 10px;
        gap: 5px;
        font-size: 11px;
    }

    .favourites-search-btn i {
        font-size: 12px;
    }

    .favourites-count {
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        font-size: 9px;
    }
}

/* Very small screens */

@media (max-width: 360px){
    .search-container {
        gap: 4px;
    }

    .favourites-search-btn {
        padding: 0 7px;
        font-size: 10px;
    }

    .search-container .filter-toggle {
        flex-basis: 40px;
        width: 40px;
    }
}







/* ---------- TABLET ---------- */

@media (max-width: 900px){
    .books-grid {
        gap: 25px;
    }

    .card-container {
        height: 395px;
        min-height: 395px;
    }
}

/* ---------- MOBILE ---------- */

@media (max-width: 600px){
    .books-grid {
        grid-template-columns: minmax(0, 320px);
        gap: 24px;
        padding: 20px 14px 40px;
    }

    .card-container {
        height: 385px;
        min-height: 385px;
    }

    .card.teaser {
        padding: 17px;
        border-radius: 35px;
    }

    .book-card-content {
        gap: 13px;
        padding-top: 85px;
    }

    .book-tags {
        gap: 2px;
    }

    .book-tag {
        padding: 8px 10px;
        font-size: 10px;
    }

    .card.teaser .book-name {
        font-size: 22px;
    }

    .book-card-bottom {
        gap: 8px;
        padding-top: 13px;
    }

    .book-series-name,
    .book-open-hint {
        font-size: 10px;
    }

    .card.detail {
        padding: 25px 18px;
    }
}
.filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    line-height: 1;
    transition: transform 0.25s ease, background 0.25s ease;
}

.filter-toggle i {
    pointer-events: none;
}

.filter-toggle:hover {
    transform: translateY(-2px);
}

.filter-toggle:active {
    transform: scale(0.94);
}


/* =========================================================
   LIBRARY PERFORMANCE TUNING
   Keeps the existing visual design and interactions.
   ========================================================= */

/* Limit repaint work to the properties used by the UI. */
.search-container {
    transition: width 0.3s ease, transform 0.3s ease;
}

.filter-sections {
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.book-modal-content {
    overscroll-behavior: contain;
}

/* Avoid sticky hover effects on touchscreens. */
@media (hover: none), (pointer: coarse) {
    .card-container:hover {
        filter: none;
    }

    .card-container:hover .book-name {
        transform: none;
    }
}

/* Respect reduced-motion preferences without changing layout. */
@media (prefers-reduced-motion: reduce) {
    .card,
    .card-container,
    .book-name,
    .book-open-hint,
    .filter-sections,
    .filter-group,
    .book-icon-btn,
    .modal-close,
    .modal-done-btn,
    #searchInput {
        transition: none !important;
        animation: none !important;
    }
}




























/* =========================================================
   RASHT ENGLISH — MOBILE PERFORMANCE OPTIMIZATION
   Preserve the design while reducing mobile rendering costs.
   ========================================================= */

@media screen and (max-width: 600px) and (hover: none) {

    /* 1. Reduce expensive glass rendering */
    #searchInput,
    .filter-toggle,
    .toggle-filters-button,
    .filter-sections,
    .filter-buttons button,
    .favourites-search-btn,
    .book-icon-btn,
    .book-series-label,
    .book-tag,
    .card.teaser .book-name {

        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    /* Preserve translucent glass-like backgrounds */
    #searchInput {
        background: rgba(130, 140, 160, .16);
    }


    

    .filter-buttons button {
        background: rgba(150, 160, 180, .20);
    }

    .book-icon-btn {
        background: rgba(25, 30, 42, .55);
    }

    .book-series-label,
    .book-tag {
        background: rgba(35, 45, 65, .65);
    }

    /* 2. Reduce expensive card shadows */
    .card {
        box-shadow:
            inset 0 0 0 1px rgba(255,255,255,.16),
            0 3px 8px rgba(0,0,0,.13);
    }

    .book-tag,
    .book-series-label,
    .book-icon-btn {
        box-shadow: 0 2px 6px rgba(0,0,0,.10);
    }

    /* 3. Avoid unnecessary card-container animations */
    .card-container {
        transition: none !important;
        filter: none !important;
    }

    /* Keep the important book flip animation */
    .card {
        transition: transform .45s ease !important;
    }

    /* 4. Make button interactions lighter */
    .filter-buttons button,
    .book-icon-btn,
    .favourites-search-btn,
    .filter-toggle,
    .library-view-btn {
        transition:
            background .18s ease,
            color .18s ease,
            border-color .18s ease !important;
    }

    .filter-buttons button:active,
    .book-icon-btn:active,
    .library-view-btn:active {
        transform: scale(.97);
    }

    /* 5. Avoid unnecessary hover effects */
    .card-container:hover {
        transform: none !important;
        filter: none !important;
    }

    .card-container:hover .card.teaser::before {
        opacity: 1;
    }

    .card-container:hover .book-open-hint {
        gap: 7px;
    }

    /* 6. Reduce filter-panel rendering cost */
    .filter-sections {
        transition:
            opacity .18s ease,
            transform .18s ease,
            visibility .18s !important;
    }

    .filter-sections .filter-group {
        transition: opacity .18s ease !important;
    }

    /* 7. Keep scrolling natural */
    .books-grid {
        touch-action: pan-y;
    }

    .filter-sections,
    .book-modal-content {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* Do not affect users who request reduced motion */
@media (prefers-reduced-motion: reduce) {
    .card {
        transition: none !important;
    }
}

/* MOBILE — LIGHT LIQUID GLASS BLUR */
@media screen and (max-width: 600px) and (hover: none) {

    #searchInput,
    .filter-toggle,
    .toggle-filters-button,
    .filter-sections,
    .filter-buttons button,
    .favourites-search-btn,
    .book-icon-btn,
    .book-series-label,
    .book-tag,
    .card.teaser {

        -webkit-backdrop-filter: blur(7px) saturate(135%) !important;
        backdrop-filter: blur(7px) saturate(135%) !important;
    }

    .filter-sections {
        -webkit-backdrop-filter: blur(9px) saturate(140%) !important;
        backdrop-filter: blur(9px) saturate(140%) !important;
    }
}

