/* ============================================================
   1. VARIABLES
   ============================================================ */
:root {
    --primary-color: #2c3e50;
    --accent-color:  #e74c3c;
    --light-color:   #ecf0f1;
    --dark-color:    #34495e;
    --font-main:     'Tajawal', sans-serif;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.10);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.20);

    --radius-sm: 5px;
    --radius-md: 10px;
    --radius-lg: 20px;

    --transition: all 0.3s ease;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--light-color);
    overflow-x: hidden;
    position: relative;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    background: #eee;
    padding: 10px;
    margin: 5px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

li:hover {
    background: #ddd;
}

/* ============================================================
   3. UTILITIES
   ============================================================ */
.visually-hidden {
    display: none !important;
}

/* ============================================================
   4. PAGE LOADER
   ============================================================ */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 0.7s ease 1.7s forwards;
}

/* ============================================================
   5. BOOK LOADER
   ============================================================ */
.book-loader {
    width: 75px;
    height: 90px;
    position: relative;
    perspective: 600px;
    animation: introZoom 0.8s ease-out;
}

/* --- Base styles shared by all pages --- */
.book-page {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    right: 0;
    transform-origin: right center;
    border-radius: 2px 0 0 2px;
    will-change: transform;
    animation: flip 1.5s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.22s);
    background: linear-gradient(
        135deg,
        hsl(9, 72%, calc(62% - var(--i, 0) * 5%)),
        hsl(9, 65%, calc(55% - var(--i, 0) * 5%))
    );
    box-shadow:
        inset 0 0 0 0.5px rgba(255, 255, 255, 0.55),
        inset 0 0 0 3px rgba(0, 0, 0, 0.18),
        2px 3px 8px rgba(0, 0, 0, 0.18);
}

/* --- Inner pages only (excludes cover) --- */
.book-page:not([style*="--i:0"])::before {
    content:
        "ــــــــــــــــــــ\A"
        "ــــــــــــــــــــ\A"
        "ــــــــــــــــــــ\A"
        "ــــــــــــــــــــ\A"
        "ــــــــــــــــــــ\A"
        "ــــــــــــــــــــ\A"
        "ــــــــــــــــــــ\A"
        "ــــــــــــــــــــ\A"
        "ــــــــــــــــــــ\A"
        "ــــــــــــــــــــ";
    white-space: pre;
    position: absolute;
    top: 8%;
    right: 8%;
    width: 84%;
    height: 84%;
    font-size: 6px;
    line-height: 1.65;
    color: rgba(44, 62, 80, 0.38);
    text-shadow: 0 0 1px rgba(44, 62, 80, 0.28);
    pointer-events: none;
}

/* ============================================================
   6. ANIMATIONS
   ============================================================ */
@keyframes flip {
    0%   { transform: translateX(-10px) rotateY(-25deg); }
    45%  { transform: translateX(-2px)  rotateY(0deg);   }
    55%  { transform: translateX(-2px)  rotateY(0deg);   }
    100% { transform: translateX(0px)   rotateY(195deg); }
}

@keyframes introZoom {
    0%   { transform: scale(0.6);  opacity: 0; }
    60%  { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

@keyframes fadeOut {
    0%   { opacity: 1; visibility: visible;  pointer-events: auto; }
    100% { opacity: 0; visibility: hidden;   pointer-events: none; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1);    }
}

@keyframes fadeInFixed {
    from {
        opacity: 0;
        transform: translate(-50%, -55%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}
/* ============================================================
   7. LAYOUT — INTRO CONTAINER
   ============================================================ */
.intro-container {
    height: 100vh;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* ============================================================
   8. COMPONENT — BOOK SPINE
   ============================================================ */
.book-spine {
    width: 15%;
    height: 100%;
    background: var(--accent-color);
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: width 1s ease;
    flex-shrink: 0;
}

.book-spine:hover {
    width: 12%;
}

.book-spine h1 {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    color: white;
    font-size: 3rem;
    letter-spacing: 8px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ============================================================
   9. COMPONENT — BOOK PAGES AREA
   ============================================================ */
.book-pages {
    flex: 1;
    height: 100%;
    background: var(--light-color);
    position: relative;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* ============================================================
   10. COMPONENT — NAV BOOKMARKS
   ============================================================ */
.nav-bookmark {
    position: absolute;
    top: 30px;
    right: 50px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bookmark {
    background: var(--primary-color);
    color: white;
    padding: 10px 25px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    transform: translateX(20px);
    transition: transform 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
    white-space: nowrap;
}

.bookmark:hover {
    transform: translateX(0);
}

/* ============================================================
   11. COMPONENT — BOOKS SHOWCASE GRID
   ============================================================ */
.books-showcase {
    padding: 50px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.books-showcase a {
    text-decoration: none;
    color: inherit;
}

.books-showcase a:hover,
.books-showcase a:focus,
.books-showcase a:visited {
    text-decoration: none;
    color: inherit;
}

/* ============================================================
   12. COMPONENT — BOOK CARD (FLIP)
   ============================================================ */
.book-card {
    height: 350px;
    perspective: 1500px;
    position: relative;
}

.book-inner {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 1.6s ease-in-out;
    position: relative;
}

.book-card:hover .book-inner {
    transform: rotateY(180deg);
}

.book-front,
.book-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.book-front {
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.book-cover {
    height: 200px;
    width: 150px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover {
    transform: scale(1.05);
}

.book-title {
    margin-top: 15px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
}

.book-author {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-top: 5px;
    text-align: center;
}

.book-back {
    background-color: var(--dark-color);
    color: white;
    transform: rotateY(180deg);
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-description {
    font-size: 0.9rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
}

.book-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    gap: 10px;
}

.book-btn {
    position: relative;
    overflow: hidden;

    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: var(--font-main);

    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;

    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.book-btn:hover {
    background: white;
    color: var(--accent-color);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.25);
}

.book-btn:active {
    transform: scale(0.94);
}

.book-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.25);
    border-radius: inherit;

    transform: scale(0);
    opacity: 0;
}

.book-btn:active::after {
    animation: ripple 0.4s ease;
}

/* ============================================================
   13. COMPONENT — FEATURED BOOK
   ============================================================ */
.featured-book {
    padding: 100px 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: white;
    display: flex;
    gap: 50px;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.featured-book::before {
    content: "";
    position: absolute;
    right: -50px;
    top: -50px;
    width: 200px;
    height: 200px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0.3;
    pointer-events: none;
}

.featured-book::after {
    content: "";
    position: absolute;
    left: -30px;
    bottom: -30px;
    width: 150px;
    height: 150px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0.2;
    pointer-events: none;
}

.featured-cover {
    width: 300px;
    height: 450px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    transform: rotate(-5deg);
    transition: transform 0.5s ease;
    flex-shrink: 0;
}

.featured-cover:hover {
    transform: rotate(0deg) scale(1.05);
}

.featured-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.featured-label {
    background: var(--accent-color);
    color: white;
    padding: 5px 15px;
    border-radius: var(--radius-lg);
    display: inline-block;
    margin-bottom: 20px;
    font-size: 0.9rem;
    width: fit-content;
}

.featured-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.featured-author {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.featured-description {
    line-height: 1.8;
    margin-bottom: 30px;
}

.featured-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: bold;
    font-family: var(--font-main);
    cursor: pointer;
    width: fit-content;
    transition: var(--transition);
}

.featured-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   14. COMPONENT — CATEGORIES SECTION
   ============================================================ */
.categories-section {
    padding: 50px;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

.categories-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 20px;
}

.category-item {
    width: 150px;
    height: 200px;
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.category-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.category-item:visited {
    color: inherit;
    text-decoration: none;
}

.category-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-name {
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 10px;
    font-size: 0.95rem;
    text-align: center;
    padding: 0 5px;
}

.category-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ============================================================
   15. COMPONENT — FOOTER
   ============================================================ */
footer {
    background: var(--primary-color);
    color: white;
    padding: 50px;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-content > p {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    font-size: 0.95rem;
}

.logo-footer {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 2px;
    color: white;
}

.footer {
    margin-top: 10px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
}

.glow-btn {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 8px 18px;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-family: var(--font-main);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    white-space: nowrap;
}

.glow-btn:hover {
    color: white;
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.35);
    text-decoration: none;
}

.glow-btn:visited {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.glow-btn:visited:hover {
    color: white;
}

.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
}

.social-icons .glow-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 0;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-icons .glow-btn:hover {
    transform: translateY(-5px);
}

.social-icons .glow-btn.facebook:hover {
    background: #3b5998;
    border-color: #3b5998;
    box-shadow: 0 5px 15px rgba(59, 89, 152, 0.4);
}

.social-icons .glow-btn.twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
    box-shadow: 0 5px 15px rgba(29, 161, 242, 0.4);
}

.social-icons .glow-btn.linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
    box-shadow: 0 5px 15px rgba(0, 119, 181, 0.4);
}

.social-icons .glow-btn.instagram:hover {
    background: #e4405f;
    border-color: #e4405f;
    box-shadow: 0 5px 15px rgba(228, 64, 95, 0.4);
}

.footer-link {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--accent-color);
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--accent-color);
    transform: translateY(-5px);
}

.copyright {
    margin-top: 30px;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ============================================================
   16. COMPONENT — SEARCH FLOAT BUTTON
   ============================================================ */
.search-float {
    position: fixed;
    bottom: 30px;
    left: 15px;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 100;

    overflow: hidden;

    transition: transform 0.2s ease, box-shadow 0.2s ease;

    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.search-float:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
}

.search-float:active {
    transform: scale(0.92);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.search-float::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
}

.search-float:active::after {
    animation: ripple 0.4s ease;
}
/* ============================================================
   17. COMPONENT — SEARCH PANEL
   ============================================================ */
.search-panel {
    position: fixed;
    inset: 0;
    background: rgba(44, 62, 80, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 12vh;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow-y: auto;
}

.search-panel.active {
    opacity: 1;
    visibility: visible;
}

.search-form {
    width: 80%;
    max-width: 800px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    padding: 20px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-family: var(--font-main);
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.search-btn {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-search {
    position: fixed;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 201;
}

.close-search:hover {
    transform: rotate(90deg);
    color: var(--accent-color);
}

.close-search {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 201;

    border-radius: 50%;
    overflow: hidden;

    transition: transform 0.3s ease;

    outline: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.close-search:hover {
    transform: rotate(90deg) scale(1.1);
    color: var(--accent-color);
}

.search-panel .books-showcase.search-results {
    width: 90%;
    max-width: 800px;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    padding: 20px 0;
    margin-top: 15px;
}

.search-panel .book-card {
    height: auto;
    perspective: none;
    background: linear-gradient(to bottom, #f9f9f9, #ffffff);
    padding: 15px 10px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-panel .books-showcase.hidden,
.search-panel .books-showcase.visually-hidden {
    display: none;
}

.search-panel .books-showcase.fade-out {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.search-panel .book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-panel .book-cover {
    width: 100%;
    max-width: 80px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease-in-out;
}

.search-panel .book-cover:hover {
    transform: scale(1.1);
}

.search-panel .book-title {
    font-size: 13px;
    font-weight: bold;
    margin-top: 8px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.search-panel .book-author {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.search-panel #no-results {
    display: none;
    color: #ff6b6b;
    font-size: 15px;
    text-align: center;
    margin-top: 20px;
    font-weight: bold;
    animation: fadeIn 0.5s ease-in-out;
}

.reset-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: bold;
    font-family: var(--font-main);
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.reset-btn:hover {
    background: #cc0000;
    transform: scale(1.05);
}

/* ============================================================
   18. COMPONENT — MODAL
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: var(--radius-md);
    width: 50%;
    text-align: center;
}

.close {
    color: red;
    float: right;
    font-size: 28px;
    cursor: pointer;
}

/* ============================================================
   19. COMPONENT — ELEGANT LINK
   ============================================================ */
.elegant-link {
    color: var(--accent-color);
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease;
}

.elegant-link::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.elegant-link:hover {
    color: #c0392b;
}

.elegant-link:hover::after {
    width: 100%;
}

/* ============================================================
   20. COMPONENT — CUSTOM ALERT
   ============================================================ */
.custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 350;
    background: var(--light-color);

border: 1.5px solid rgba(231, 76, 60, 0.4);

box-shadow:
    0 0 0 9999px rgba(44, 62, 80, 0.55),
    0 15px 40px rgba(0, 0, 0, 0.25);
    padding: 25px 30px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    animation: fadeInFixed 0.3s ease;
}

.custom-alert p {
    color: #333;
    font-size: 16px;
    margin-bottom: 20px;
    font-family: var(--font-main);
}

.custom-alert button {
    background: var(--light-color);
    color: var(--primary-color);

    border: none;
    padding: 12px 28px;
    border-radius: 25px;

    font-weight: bold;
    font-family: var(--font-main);
    font-size: 0.95rem;

    cursor: pointer;
    transition: all 0.3s ease;

    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.custom-alert button:hover {
    background: var(--accent-color);
    color: white;

    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(231, 76, 60, 0.35);
}

/* ============================================================
   21. COMPONENT — FAV TOAST
   ============================================================ */
.fav-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--dark-color);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-family: var(--font-main);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 500;
    white-space: nowrap;
}

.fav-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   22. RESPONSIVE — LARGE DESKTOPS (≥ 1400px)
   ============================================================ */
@media (min-width: 1400px) {
    .featured-book {
        padding: 120px 80px;
    }

    .books-showcase {
        padding: 60px 80px;
    }

    .categories-section {
        padding: 60px 80px;
    }
}

/* ============================================================
   23. RESPONSIVE — TABLETS LANDSCAPE / SMALL DESKTOPS (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .featured-book {
        padding: 70px 35px;
        gap: 35px;
    }

    .featured-cover {
        width: 250px;
        height: 375px;
    }

    .featured-title {
        font-size: 2rem;
    }

    .books-showcase {
        padding: 35px;
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 25px;
    }
}

/* ============================================================
   24. RESPONSIVE — TABLETS (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    .book-spine {
        width: 50px;
        min-width: 50px;
        flex-shrink: 0;
    }

    .book-spine:hover {
        width: 45px;
    }

    .book-spine h1 {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .book-pages {
        flex: 1;
    }

    .featured-book {
        flex-direction: column;
        padding: 50px 20px;
        align-items: center;
        text-align: center;
    }

    .featured-cover {
        width: 200px;
        height: 300px;
        margin-bottom: 20px;
    }

    .featured-info {
        align-items: center;
    }

    .featured-title {
        font-size: 1.8rem;
    }

    .featured-description {
        font-size: 0.9rem;
        text-align: center;
    }

    .books-showcase {
        padding: 20px;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    .categories-section {
        padding: 30px 20px;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .categories-container {
        gap: 15px;
    }

    .category-item {
        width: 140px;
        height: 190px;
    }

    footer {
        padding: 30px 20px;
    }

    .footer-nav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .social-icons {
        gap: 12px;
    }

    .book-card {
        width: 100%;
        margin: 0;
    }

    .nav-bookmark {
        top: 15px;
        right: 15px;
        gap: 10px;
    }

    .bookmark {
        padding: 8px 18px;
        font-size: 0.85rem;
    }

    .search-panel {
        padding-top: 10vh;
    }

    .search-form {
        width: 90%;
    }

    .search-input {
        padding: 15px 20px;
        font-size: 1rem;
    }

    .search-panel .books-showcase.search-results {
        width: 95%;
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }
}

/* ============================================================
   25. RESPONSIVE — SMALL PHONES (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    .book-spine {
        width: 40px;
        min-width: 40px;
    }

    .book-spine:hover {
        width: 38px;
    }

    .book-spine h1 {
        font-size: 1.4rem;
        letter-spacing: 3px;
    }

    .featured-book {
        padding: 40px 15px;
    }

    .featured-cover {
        width: 170px;
        height: 255px;
    }

    .featured-title {
        font-size: 1.5rem;
    }

    .featured-label {
        font-size: 0.8rem;
    }

    .featured-author {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 30px;
    }

    .categories-container {
        gap: 12px;
        justify-content: center;
    }

    .category-item {
        width: 130px;
        height: 175px;
    }

    .category-icon {
        width: 65px;
        height: 65px;
        margin-bottom: 10px;
    }

    .category-name {
        font-size: 0.85rem;
    }

    .books-showcase {
        padding: 15px;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .book-card {
        height: 320px;
    }

    .book-description {
        -webkit-line-clamp: 6;
        font-size: 0.8rem;
    }

    .book-actions {
        flex-direction: column;
        gap: 8px;
    }

    .book-actions .featured-btn,
    .book-actions .book-btn {
        width: 100%;
        text-align: center;
    }

    .nav-bookmark {
        top: 10px;
        right: 10px;
        gap: 8px;
    }

    .bookmark {
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    footer {
        padding: 25px 15px;
    }

    .logo-footer {
        font-size: 1.6rem;
    }

    .footer-nav {
        gap: 8px;
    }

    .glow-btn {
        padding: 6px 14px;
        font-size: 0.85rem;
    }

    .social-icons .glow-btn {
        width: 38px;
        height: 38px;
        font-size: 0.8rem;
    }

    .search-panel {
        padding-top: 8vh;
    }

    .search-form {
        width: 95%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-input {
        width: 100%;
        padding: 14px 18px;
        font-size: 0.95rem;
        border-radius: 30px;
    }

    .search-btn {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
    }

    .search-panel .books-showcase.search-results {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .search-panel .book-card {
        padding: 10px 8px;
    }

    .search-panel .book-cover {
        max-width: 65px;
    }

    .search-panel .book-title {
        font-size: 11px;
    }

    .search-panel .book-author {
        font-size: 10px;
    }

    .custom-alert {
        max-width: 280px;
        padding: 20px;
    }
}

/* ============================================================
   GLOBAL BUTTON SYSTEM
   ============================================================ */
.btn {
    position: relative;
    overflow: hidden;

    cursor: pointer;

    transition: transform 0.2s ease, box-shadow 0.2s ease;

    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn:hover {
    transform: scale(1.06);
}

.btn:active {
    transform: scale(0.92);
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.25);
    border-radius: inherit;

    transform: scale(0);
    opacity: 0;
}

.btn:active::after {
    animation: ripple 0.4s ease;
}
