:root {
    --color-primary: #149546;
    --color-primary-hover: #2563EB;
    --color-bg: #F8F7F4;
    --color-text-dark: #1a1a1a;
    --color-text-medium: #4B5563;
    --color-text-light: #6B7280;
    --color-white: #ffffff;
    --color-border: #E5E7EB;
    --color-header-bg: rgba(255, 255, 255, 0.8);
    --color-card-bg: #F9FAFB;
    --color-card-border: #F3F4F6;
    --color-logo-dark: #1F2937;
    --color-hero-heading: #111827
}

body.dark-mode {
    --color-primary: #25b95f;
    --color-primary-hover: #3B82F6;
    --color-bg: #1A202C;
    --color-text-dark: #E2E8F0;
    --color-text-medium: #A0AEC0;
    --color-text-light: #718096;
    --color-white: #1A202C;
    --color-border: #2D3748;
    --color-header-bg: rgba(26, 32, 44, 0.8);
    --color-card-bg: #2D3748;
    --color-card-border: #4A5568;
    --color-logo-dark: #E2E8F0;
    --color-hero-heading: #E2E8F0
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease
}

*::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

*::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.126);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.8), rgba(168, 85, 247, 0.8));
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.9), rgba(79, 70, 229, 0.9));
}


.error {
    width: 320px;
    padding: 12px;
    position: fixed;
    top: 10%;
    right: 1%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: start;
    background: #defcdb;
    border-radius: 8px;
    border: 1px solid #00ff37;
    box-shadow: 0px 0px 5px -3px #111;
}

.error__icon {
    width: 20px;
    height: 20px;
    transform: translateY(-2px);
    margin-right: 8px;
}

.error__icon path {
    fill: #2cc921;
}

.error__title {
    font-weight: 500;
    font-size: 14px;
    color: #197123;
}

.error__close {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-left: auto;
}

.error__close path {
    fill: #01271a;
}

.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

:root {
    --bg-color: rgba(243, 243, 243, 0.881);
    --bg-hover-color: #e9e9e9;
    --text-color: #202020;
    --border-color: #e1e1e1;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --separator-color: #dcdcdc;
    --shortcut-color: #6a6a6a;
}

body.dark-mode {
    --bg-color: rgba(40, 40, 40, 0.836);
    --bg-hover-color: rgba(255, 255, 255, 0.1);
    --text-color: #e0e0e0;
    --border-color: rgba(255, 255, 255, 0.15);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --separator-color: rgba(255, 255, 255, 0.15);
    --shortcut-color: #a0a0a0;
}

.notify-dot {
    width: 10px;
    height: 10px;
    background: red;
    position: absolute;
    border-radius: 50%;
    top: 5px;
    right: 8px;
    border: 1px solid white;
}

/* --- Notification Box (The Dropdown) --- */
.notification-box {
    position: absolute;
    top: 130%;
    left: -100px; /* Adjusted based on your layout */
    width: 430px;
    max-width: 90vw;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px -5px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scale(0.8);
    transform-origin: top left;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Animation State: OPEN --- */
.notification-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Glass Header */
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.notif-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
}

.mark-read-text {
    background: none;
    border: none;
    color: #149585;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

/* List Area */
.notif-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch; 
    overscroll-behavior: contain;
    transform: translateZ(0);
}


/* Individual Item */
.notif-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #ededed;
    transition: background 0.1s;
    position: relative;
    cursor: pointer;
}

.notif-item:hover {
    background: #f0f8ff;
}

.notif-item.unread {
    background: rgb(125 255 240 / 13%);
}

/* Icons */
.notif-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon-box i {
    width: 20px;
    height: 20px;
}

/* Icon Colors */
.bg-teal { background: #e0f2f1; color: #149585; }
.bg-blue { background: #e0f2fe; color: #0ea5e9; }
.bg-purple { background: #f3e8ff; color: #a855f7; }

/* Content */
.notif-content p {
    margin: 0 0 4px;
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.4;
}
body.dark-mode .notif-content strong{
    color: white;
}

.notif-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Footer */
.notif-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
}

.notif-footer a {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}

.notif-footer a:hover {
    color: #149585;
}

/* --- Dark Mode Support --- */
body.dark-mode .notif-btn {
    color: #cbd5e0;
}
body.dark-mode .notif-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
body.dark-mode .notif-badge {
    border-color: #0f172a; /* Match dark header bg */
}

body.dark-mode .notification-box {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 40px -5px rgba(0, 0, 0, 0.5);
}

body.dark-mode .notif-header {
    border-bottom-color: #334155;
}

body.dark-mode .notif-header h3 {
    color: #f1f5f9;
}

body.dark-mode .notif-item {
    border-bottom-color: #334155;
}

body.dark-mode .notif-item:hover {
    background: #0f172a;
}

body.dark-mode .notif-item.unread {
    background: rgba(20, 149, 133, 0.1);
}

body.dark-mode .notif-content p {
    color: #cbd5e0;
}

body.dark-mode .notif-time {
    color: #94a3b8;
}

body.dark-mode .notif-footer {
    border-top-color: #334155;
}

/* Dark mode icons */
body.dark-mode .bg-teal { background: rgba(20, 149, 133, 0.2); }
body.dark-mode .bg-blue { background: rgba(14, 165, 233, 0.2); }
body.dark-mode .bg-purple { background: rgba(168, 85, 247, 0.2); }


/* --- DROPDOWN CONTAINER --- */
.dropdown {
    position: relative;
    display: inline-block;

}

.btn {
    padding: 10px 18px;
    border-radius: 6px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

/* --- DROPDOWN MENU STYLES --- */
.dropdown-menu {
    list-style: none;
    padding: 6px;
    margin: 0;
    position: absolute;
    top: 110%;
    left: 0px;
    min-width: 175px;
    z-index: 1000;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 20px var(--shadow-color);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.dropdown-menu:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#dropdown-button {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dropdown-item:hover {
    background-color: var(--bg-hover-color);
}

.dropdown-item i {
    font-size: 18px;
}

.separator {
    height: 1px;
    background-color: var(--separator-color);
    margin: 6px 0;
}

a {
    text-decoration: none;
    color: inherit
}

ul {
    list-style: none
}

/* Default: light theme */
.logo-dark {
    display: none;
}

/* Dark mode */
body.dark-mode .logo-light {
    display: none;
}

body.dark-mode .logo-dark {
    display: inline-block;
}


.container {
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem
}

.header {
    background-color: var(--color-header-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.3s ease, border-color 0.3s ease
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 5px;
    padding-bottom: 5px
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo span {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-logo-dark);
    transition: color 0.3s ease
}

.logo i {
    color: var(--color-primary);
    transition: color 0.3s ease
}

.desktop-nav {
    display: none;
    align-items: center;
    gap: 2rem
}

.desktop-nav a {
    color: var(--color-text-light);
    transition: color 0.3s ease
}

.desktop-nav a:hover {
    color: var(--color-primary)
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem
}

.header-actions .login-btn {
    display: none;
    color: var(--color-text-light);
    font-weight: 500;
    transition: color 0.3s ease
}

.header-actions .login-btn:hover {
    color: var(--color-primary)
}

.theme-toggle-btn {
    background-color: #fff0;
    border: 1px solid var(--color-border);
    color: var(--color-text-medium);
    padding: .5rem;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    line-height: 1
}

.theme-toggle-btn:hover {
    background-color: var(--color-border);
    color: var(--color-text-dark);
    transform: translateY(-2px)
}

.theme-toggle-btn i {
    width: 1.25rem;
    height: 1.25rem;
    transition: color 0.3s ease
}

.btn {
    display: inline-block;
    font-weight: 600;
    border-radius: .5rem;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer
}

.primary-btn {
    background-color: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05)
}

.primary-btn:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px)
}

.secondary-btn {
    background-color: var(--color-white);
    color: #374151;
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    display: none;
    align-items: center;
    gap: .5rem
}

body.dark-mode .secondary-btn {
    color: var(--color-text-dark)
}

.secondary-btn:hover {
    background-color: #F9FAFB;
    transform: translateY(-2px)
}

body.dark-mode .secondary-btn:hover {
    background-color: #374151
}

.header-actions .primary-btn {
    padding: .625rem 1.25rem
}

section {
    padding: 5rem 0
}


/* Background */
.hero-bg {
    position: relative;
    background: radial-gradient(circle at 10% 20%, var(--color-primary-light), transparent 35%),
        radial-gradient(circle at 90% 80%, var(--color-primary-light), transparent 35%),
        var(--color-bg);
    min-height: 92vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0 1.5rem;
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeIn 1s ease-out forwards;
    animation-delay: 0.2s;
}


#animated-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.05), transparent 70%);
    pointer-events: none;
}

/* Layout */
.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3.5rem;
    text-align: center;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}



@media (min-width: 992px) {
    .hero-container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        gap: 6rem;
    }

    .hero-content {
        flex: 0 0 44%;
        max-width: 500px;
    }

    .hero-visual {
        flex: 0 0 56%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* Typography */
.hero-content h1 {
    font-size: clamp(1.9rem, 3.5vw, 3rem);
    font-weight: 900;
    line-height: 1.15;
    color: var(--color-hero-heading);
    margin-bottom: 1.15rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

.hero-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-medium);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

/* Search Form */

.search-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid #ccc;
    border-radius: 8px;
    outline: none;
    background: transparent;
}

.static-placeholder {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
    font-size: 16px;
}

.dynamic-placeholder {
    position: absolute;
    left: 100px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 16px;
    color: #aaa;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.dynamic-placeholder.hide {
    transform: translateY(-150%);
    opacity: 0;
}

.search-input:not(:placeholder-shown)+.static-placeholder,
.search-input:not(:placeholder-shown)+.static-placeholder+.dynamic-placeholder {
    display: none;
}

.hero-search-form {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.5rem;
    max-width: 38rem;
    margin: 0 auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.25s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.8s;
}
/* SKELETON LOADER ANIMATION */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid #eee; /* Light mode border */
}
.skeleton-line {
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-grow: 1;
}

/* Dark mode support if needed, assuming parent handles theme */
.dark-mode .skeleton-item {
    border-bottom: 1px solid #333;
}

.skeleton-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: #e0e0e0;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.skeleton-line {
    height: 12px;
    border-radius: 4px;
    background: #e0e0e0;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.long { width: 80%; }

/* Dark mode adjustments for skeleton colors */
body.dark-mode .skeleton-icon,
body.dark-mode .skeleton-line {
    background: #333;
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
}

.results {
    display: none;
    background: rgb(251 251 251 / 90%);
    backdrop-filter: blur(8px);
    border-radius: 0 0 0.875rem 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.5rem;
    max-width: 38rem;
    margin: 0 auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.25s ease;
    opacity: 0;
    transform: translateY(5px);
    animation: fadeUp 0.5s ease forwards;
    animation-delay: 0.2s;
}
body.dark-mode .results{
    background: rgb(26 26 26 / 90%);

}

.search-history {
    overflow-y: auto;
    margin-top: 16px;
    width: 100%;
    height: 200px;
}

.search-history-title {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    text-align: start;
}

.history-item {
    padding: 5px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    color: inherit;
}

.history-item:hover {
    background-color: #7c7c7c18;
}

.history-item-img {
    width: 32px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 12px;
}

.history-item-title {
    font-weight: 500;
    color: #374151;
    line-height: 1.3;
}

body.dark-mode .history-item-title {
    color: #ffffff;
}

.history-item-author {
    font-size: 0.85rem;
    color: #6b7280;
}

body.dark-mode .hero-search-form {
    background: #12151d;
}

.hero-search-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

.hero-search-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
    color: var(--color-text-medium);
}

.hero-search-form input::placeholder {
    color: var(--color-text-light);
}

.hero-search-form .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.hero-search-form .btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

/* Book Visual */
.glass-box {
    position: relative;
    width: 700px;
    height: 530px;
    background: linear-gradient(135deg, rgba(63, 255, 124, 0.104), rgba(255, 191, 62, 0.203), rgba(68, 255, 218, 0.175));
    border-radius: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow: hidden;
    transition: transform 0.4s ease-in-out;
    perspective: 800px;
}

body.dark-mode .glass-box {
    background: linear-gradient(145deg, rgba(0, 80, 100, 0.35), rgba(0, 30, 60, 0.35), rgba(0, 150, 100, 0.25));
}


.book-image {
    width: 100%;
    height: 100%;
    display: block;
    margin: 0 auto;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}

/* Light mode by default */
.light-image {
    display: block;
}

.dark-image {
    display: none;
}

/* Dark mode toggle */
body.dark-mode .light-image {
    display: none;
}

body.dark-mode .dark-image {
    display: block;
}

.glass-box:hover .book-image {
    transform: rotateY(var(--tilt-x, 0deg)) rotateX(var(--tilt-y, 0deg)) scale(1.02);
}

.hero-light {
    position: absolute;
    width: 160%;
    height: 160%;
    background: radial-gradient(circle at 50% 50%, var(--color-primary-light), transparent 70%);
    opacity: 0.35;
    mix-blend-mode: overlay;
    animation: pulse 8s infinite ease-in-out;
}

/* Animations */
@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}


.section-header {
    text-align: center;
    margin-bottom: 3rem
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-logo-dark);
    transition: color 0.3s ease
}

.section-header p {
    font-size: 1.125rem;
    color: var(--color-text-light);
    margin-top: .5rem;
    transition: color 0.3s ease
}

.bg-white {
    background-color: var(--color-white);
    transition: background-color 0.3s ease
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Tablets */
@media (min-width: 640px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small desktops */
@media (min-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}

/* Large desktops */
@media (min-width: 1240px) {
    .books-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}


.book-item {
    width: 100%;
    max-width: 180px;
    margin: 0px auto 30px auto;
}

.imgbook {
    width: 100%;
    height: 260px;
    object-fit: cover;
}

.book-item img {
    width: 95%;
    height: 210px;
    border-radius: .5rem .5rem 0 0;
    box-shadow: 4px 0 20px -1px rgb(0 0 0 / .64), 4px -4px 10px 0 rgb(0 0 0 / .64);
    aspect-ratio: 2 / 3;
    object-fit: fill;
    border-bottom: none;
    transition: transform 0.5s ease, box-shadow 0.5s ease
}

body.dark-mode .book-item img {
    box-shadow: 5px 0 8px -1px #171717, 4px -3px 8px 0 #000
}

.book-item:hover img {
    border-radius: .5rem;
    transform: scale(1.05) translateY(-8px) rotateZ(1deg);
}

.imgbook:hover {
    transform: scale(1.05) translateY(-8px) rotateZ(1deg);
}

body.dark-mode .book-item img:hover {
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / .5), 0 8px 10px -6px rgb(0 0 0 / .5)
}

.book-item h3 {
    font-weight: 600;
    color: var(--color-logo-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
    padding: 5px 0 5px 0;
}

.book-item p {
    font-size: .875rem;
    color: var(--color-text-light);
    transition: color 0.3s ease;
    padding-bottom: 2px;
    width: 65%;
    text-overflow: ellipsis;
    overflow: hidden;
}

.book-item div {
    color: var(--color-text-light);
    transition: color 0.3s ease;
}

.readby {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.views {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 2px 5px;
    font-size: 14px;
}


.features-grid {
    display: grid;
    gap: 3rem
}

.feature-item {
    text-align: center
}

.feature-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease
}

.feature-icon.bg-blue {
    background-color: #DBEAFE;
    color: #3B82F6
}

.feature-icon.bg-green {
    background-color: #D1FAE5;
    color: #10B981
}

.feature-icon.bg-purple {
    background-color: #E9D5FF;
    color: #9333EA
}

.truncate {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

body.dark-mode .feature-icon.bg-blue {
    background-color: #1E3A8A;
    color: #60A5FA
}

body.dark-mode .feature-icon.bg-green {
    background-color: #065F46;
    color: #34D399
}

body.dark-mode .feature-icon.bg-purple {
    background-color: #581C87;
    color: #C084FC
}

.feature-icon:hover {
    transform: scale(1.1)
}

.feature-icon i {
    width: 2rem;
    height: 2rem
}

.feature-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: .5rem;
    color: var(--color-logo-dark);
    transition: color 0.3s ease
}

.books-category-grid .category-card {
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .04);
    transition: box-shadow 0.5s, transform 0.5s, background 0.5s
}

.books-category-grid .category-card:hover {
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 8px 24px 0 rgb(59 130 246 / .15);
    transform: translateY(-6px) scale(1.04)
}

.books-category-grid .category-card:hover i {
    color: var(--color-white) !important
}

.feature-item p {
    color: var(--color-text-medium);
    transition: color 0.3s ease
}

.btn-donate {
    --clr-font-main: hsla(0 0% 20% / 100);
    --btn-bg-1: rgb(40, 255, 97);
    --btn-bg-2: rgb(0, 142, 45);
    --btn-bg-color: hsla(360 100% 100% / 1);
    --radii: 0.5em;
    cursor: pointer;
    padding: .9em 1em;
    margin: 5% auto auto auto;
    width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    transition: 0.8s;
    background-size: 280% auto;
    background-image: linear-gradient(325deg, var(--btn-bg-2) 0%, var(--btn-bg-1) 55%, var(--btn-bg-2) 90%);
    border-radius: var(--radii);
    color: var(--btn-bg-color);
    box-shadow: 0 0 20px rgb(71 184 255 / .5), 0 5px 5px -1px rgb(58 125 233 / .25), inset 4px 4px 8px rgb(175 230 255 / .5), inset -4px -4px 8px rgb(19 95 216 / .35)
}

.btn-donate:hover {
    background-position: right top
}

.btn-donate:is(:focus, :focus-visible, :active) {
    outline: none;
    box-shadow: 0 0 0 3px var(--btn-bg-color), 0 0 0 6px var(--btn-bg-2)
}

@media (prefers-reduced-motion:reduce) {
    .btn-donate {
        transition: linear
    }
}

.testimonials-grid {
    display: grid;
    gap: 1rem;
    max-width: 85rem;
    margin: 0 auto
}

.testimonial-card {
    background-color: var(--color-card-bg);
    padding: 2rem;
    border-radius: .75rem;
    border: 1px solid var(--color-card-border);
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease
}

.testimonial-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .06)
}

body.dark-mode .testimonial-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / .2), 0 2px 4px -2px rgb(0 0 0 / .12)
}

.testimonial-card>p {
    color: var(--color-text-medium);
    margin-bottom: 1.5rem;
    transition: color 0.3s ease
}

.testimonial-author {
    display: flex;
    align-items: center
}

.testimonial-author img {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    margin-right: 1rem;
    object-fit: cover
}

.author-name {
    font-weight: 600;
    color: var(--color-logo-dark);
    transition: color 0.3s ease
}

.author-title {
    color: var(--color-text-light);
    transition: color 0.3s ease
}

/* --- CTA Section: Base Styles --- */
.cta-section {
    padding: 4rem 0;
    background-color: #f8fafc;
}

.cta-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

/* Left Side: Image Area */
.cta-image {
    position: relative;
}

.cta-image img {
    width: 100%;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 1;
}

.cta-blob {
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100%;
    height: 100%;
    background: #149585;
    opacity: 0.1;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    z-index: 0;
}

.cta-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: #1e293b; /* Dark slate text */
}

.text-highlight {
    color: #149585; /* Brand Teal */
}

.cta-description {
    color: #64748b; /* Medium slate text */
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Features List */
.cta-features {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
    color: #475569; /* Slate text */
}

.cta-features li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cta-icon {
    color: #149585;
    width: 20px;
    height: 20px;
}

/* Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
}

.cta-buttons .btn {
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.secondary-btn {
    background: white;
    border: 1px solid #cbd5e0;
    color: #475569;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #1e293b;
}

/* --- Dark Mode Overrides --- */
body.dark-mode .cta-section {
    background-color: #111827; /* Dark background */
}

body.dark-mode .cta-title {
    color: #f1f5f9; /* Light text */
}

body.dark-mode .cta-description {
    color: #cbd5e0; /* Light gray text */
}

body.dark-mode .cta-features {
    color: #94a3b8; /* Muted light gray text */
}

body.dark-mode .cta-blob {
    opacity: 0.15; /* Slightly more visible on dark bg */
}

/* Dark Mode Secondary Button */
body.dark-mode .secondary-btn {
    background: transparent;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-mode .secondary-btn:hover {
    background: #1e293b;
    border-color: #94a3b8;
    color: #ffffff;
}

.faq-grid{
    width: 80%;
    margin: auto;
}

.faq-section {
    padding: 4rem 0;
    background-color: #fff;
}


.section-header {
    text-align: center;
}

.faq-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 1rem;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.faq-item:hover {
    background-color: #f8fafc;
}

.faq-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: #e0f2f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #149585;
}

.faq-icon i {
    width: 20px;
    height: 20px;
}

.faq-content {
    width: 100%;
}

/* Accordion */
.faq-question {
    all: unset;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.faq-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.faq-answer p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #64748b;
    margin-top: 0.5rem;
}

.faq-item.active .faq-answer {
    max-height: 300px;
}

/* Arrow */
.arrow {
    font-size: 0.9rem;
    color: #64748b;
    transition: transform 0.3s ease;
}

.faq-item.active .arrow {
    transform: rotate(180deg);
}

/* --- Dark Mode --- */
body.dark-mode .faq-section {
    background-color: #1f2937;
}

body.dark-mode .faq-item:hover {
    background-color: #111827;
}

body.dark-mode .faq-icon {
    background-color: rgba(20, 149, 133, 0.2);
}

body.dark-mode .faq-content h3 {
    color: #f1f5f9;
}

body.dark-mode .faq-answer p,
body.dark-mode .arrow {
    color: #94a3b8;
}

.footer {
    background-color: #1F2937;
    color: var(--color-white);
    transition: color 0.3s ease
}

body.dark-mode .footer {
    background-color: #111827
}

.footer-content {
    padding: 3rem 0 1rem 0;
    ;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    text-align: center;
}

.footer-about {
    grid-column: span 2 / span 2
}

.footer h4 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff;
    transition: color 0.3s ease
}

.footer ul li {
    margin-bottom: .75rem
}

.footer a {
    color: #9CA3AF;
    transition: color 0.3s ease
}

.footer a:hover {
    color: var(--color-white)
}


.footer-copyright {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #374151;
    text-align: center;
    color: #9CA3AF;
    transition: border-color 0.3s ease, color 0.3s ease
}

body.dark-mode .footer-copyright {
    border-color: #4A5568;
    color: #718096
}

@keyframes heroBgPulse {
    0% {
        background-image: radial-gradient(circle at 10% 20%, rgb(136 176 224 / .1), transparent 30%), radial-gradient(circle at 90% 80%, rgb(224 136 176 / .1), transparent 30%)
    }

    50% {
        background-image: radial-gradient(circle at 15% 25%, rgb(136 176 224 / .15), transparent 35%), radial-gradient(circle at 85% 75%, rgb(224 136 176 / .15), transparent 35%)
    }

    100% {
        background-image: radial-gradient(circle at 10% 20%, rgb(136 176 224 / .1), transparent 30%), radial-gradient(circle at 90% 80%, rgb(224 136 176 / .1), transparent 30%)
    }
}

body.dark-mode .hero-bg {
    background-image: radial-gradient(circle at 10% 20%, rgb(59 130 246 / .05), transparent 30%), radial-gradient(circle at 90% 80%, rgb(147 51 234 / .05), transparent 30%)
}

.theme-toggle-btn i {
    transform-origin: center center;
    transition: transform 0.4s ease-out
}

.theme-toggle-btn.toggled i {
    transform: rotate(360deg)
}

@media (min-width:640px) {
    .header-actions .login-btn {
        display: inline
    }

}


@media (min-width:900px) {
    .desktop-nav {
        display: flex
    }

    .section-header h2 {
        font-size: 2.25rem
    }


    .features-grid {
        grid-template-columns: repeat(3, 1fr)
    }

    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr)
    }

    .footer-grid {
        grid-template-columns: repeat(4, 1fr)
    }

    .footer-about {
        grid-column: span 1 / span 1
    }
}

@media (min-width:1024px) {
    .footer-grid {
        grid-template-columns: repeat(5, 1fr)
    }

    .footer-about {
        grid-column: span 1 / span 1
    }
}