.home-hero {
    position: relative;
    overflow: hidden;
    padding: 3rem 3rem 2.5rem;
    border-radius: 2.2rem;
    background:
        linear-gradient(135deg, rgba(13, 94, 71, 0.94), rgba(29, 101, 76, 0.88)),
        url('/img/banner1.png') center/cover;
    color: #fff;
    box-shadow: 0 24px 60px rgba(13, 94, 71, 0.25);
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: -60px auto auto -60px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 65%);
    pointer-events: none;
}

.home-hero::after {
    content: "";
    position: absolute;
    inset: auto -90px -90px auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 206, 120, 0.38), transparent 68%);
    pointer-events: none;
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8e3a8;
    font-size: 0.82rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.home-hero h2 {
    margin-top: 1rem;
    margin-bottom: 0.9rem;
    font-size: clamp(1.75rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1.08;
}

.home-hero p {
    max-width: 640px;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    line-height: 1.65;
}

.home-search-card {
    position: relative;
    z-index: 1;
    max-width: 680px;
    padding: 0.85rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.home-search-card .input-group {
    border-radius: 1rem;
    overflow: hidden;
}

.home-search-card .input-group-text,
.home-search-card .form-control,
.home-search-card .btn {
    border: 0;
    min-height: 52px;
}

.home-search-card .input-group-text {
    color: #1b4f3d;
    background: #fff;
    padding-left: 1rem;
}

.home-search-card .form-control {
    box-shadow: none;
    background: #fff;
    font-size: 0.97rem;
}

.home-search-card .form-control::placeholder {
    color: #8fa89e;
}

.home-search-card .btn {
    padding-inline: 1.4rem;
    border-radius: 0 1rem 1rem 0 !important;
    background: linear-gradient(135deg, #f2cf82, #dfb451);
    color: #173d2f;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.home-search-card .btn:hover {
    background: linear-gradient(135deg, #f7d98e, #e6bd5c);
    box-shadow: 0 8px 18px rgba(216, 177, 92, 0.28);
}

.home-stats {
    margin-top: 1.5rem;
}

.home-stat-card {
    height: 100%;
    padding: 1.5rem 1.4rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(244, 248, 245, 0.92));
    border: 1px solid rgba(24, 77, 59, 0.1);
    box-shadow: 0 18px 38px rgba(24, 77, 59, 0.1);
    transition: all 0.3s ease;
}

.home-stat-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 1rem;
    border-radius: 18px;
    color: #fff;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #2d8a6c 0%, #1d654c 100%);
    box-shadow: 0 12px 28px rgba(29, 101, 76, 0.22);
}

.home-stat-card h3 {
    margin: 0;
    color: #0d5e47;
    font-size: 2.1rem;
    font-weight: 900;
    line-height: 1;
}

.home-stat-card p {
    margin: 0.5rem 0 0;
    color: #5a6d67;
    font-size: 0.95rem;
    line-height: 1.5;
}

.home-section {
    margin-top: 2rem;
}

.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.home-section-title {
    margin: 0;
    color: #173d2f;
    font-size: 1.45rem;
    font-weight: 800;
}

.home-section-subtitle {
    margin: 0.3rem 0 0;
    color: #6c7d76;
    font-size: 0.95rem;
}

.home-link {
    color: #1d654c;
    text-decoration: none;
    font-weight: 700;
}

.home-link:hover {
    color: #124634;
}

.home-library-card {
    display: block;
    height: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 1.6rem;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 42px rgba(24, 77, 59, 0.12);
    color: inherit;
    text-decoration: none;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.home-library-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 28px 56px rgba(24, 77, 59, 0.18);
}

.home-library-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #dde9e2, #f4f2ea);
}

.home-library-body {
    padding: 1rem 1rem 1.15rem;
}

.home-library-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    margin-bottom: 0.75rem;
    border-radius: 999px;
    background: rgba(24, 77, 59, 0.08);
    color: #205842;
    font-size: 0.78rem;
    font-weight: 700;
}

.home-library-card h5 {
    color: #173d2f;
    font-weight: 800;
}

.home-library-card p {
    color: #6a7b74;
    margin-bottom: 0.9rem;
}

.home-library-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #1f674d;
    font-weight: 700;
}

.home-book-card {
    display: block;
    height: 100%;
    border: 0;
    border-radius: 1.6rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 42px rgba(24, 77, 59, 0.1);
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: inherit;
    text-decoration: none;
}

.home-book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 28px 58px rgba(24, 77, 59, 0.18);
}

.home-book-cover-wrap {
    padding: 1rem 1rem 0;
}

.home-book-cover {
    width: 100%;
    height: 300px;
    object-fit: contain;
    border-radius: 1rem;
    background: linear-gradient(180deg, #fbfaf5, #eef2ec);
    padding: 0.85rem;
}

.home-book-body {
    display: flex;
    flex-direction: column;
    min-height: 245px;
    padding: 1rem 1rem 1.1rem;
}

.home-book-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.6rem;
    margin-bottom: 0.65rem;
    border-radius: 999px;
    background: rgba(216, 177, 92, 0.16);
    color: #946418;
    font-size: 0.77rem;
    font-weight: 700;
}

.home-book-card h6 {
    margin-bottom: 0.45rem;
    color: #1c4032;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.35;
    min-height: 2.7rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-book-authors {
    min-height: 2.9rem;
    color: #6c7d76;
    font-size: 0.9rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-book-rating {
    margin-top: 0.75rem;
}

.home-book-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
}

.home-book-meta small {
    color: #688078;
}

.home-book-button {
    padding: 0.55rem 0.85rem;
    border-radius: 0.9rem;
    color: #fff;
    background: linear-gradient(135deg, #1f7a5c, #145340);
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(20, 83, 64, 0.14);
}

.home-library-card:focus-visible,
.home-book-card:focus-visible,
.home-link:focus-visible {
    outline: 3px solid rgba(43, 122, 93, 0.45);
    outline-offset: 4px;
}

.home-activity-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.1rem;
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 16px 36px rgba(24, 77, 59, 0.08);
    border: 1px solid rgba(24, 77, 59, 0.08);
}

.home-activity-meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.home-activity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(24, 77, 59, 0.08);
    color: #205842;
    font-size: 0.78rem;
    font-weight: 700;
}

.home-activity-date {
    color: #6b7d76;
    font-size: 0.85rem;
    font-weight: 700;
}

.home-activity-card h6 {
    margin-bottom: 0.55rem;
    color: #1c4032;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.35;
}

.home-activity-copy {
    color: #6c7d76;
    line-height: 1.55;
    margin-bottom: 1rem;
}

.home-activity-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: auto;
    color: #1f674d;
    font-weight: 700;
}

body.library-dark .home-hero {
    background: linear-gradient(135deg, rgba(18, 26, 35, 0.96), rgba(12, 18, 26, 0.93)), url('/img/banner1.png') center/cover !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4) !important;
}

body.library-dark .home-eyebrow {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f4d18a !important;
}

body.library-dark .home-hero h2 {
    color: #f8fafc !important;
}

body.library-dark .home-hero p {
    color: rgba(255, 255, 255, 0.78) !important;
}

body.library-dark .home-stat-card {
    background: linear-gradient(135deg, rgba(18, 26, 35, 0.94), rgba(12, 18, 26, 0.91)) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease !important;
}

body.library-dark .home-stat-card:hover {
    background: linear-gradient(135deg, rgba(18, 26, 35, 0.98), rgba(12, 18, 26, 0.95)) !important;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.38) !important;
}

body.library-dark .home-stat-card span {
    background: linear-gradient(135deg, #3fa883 0%, #2d8a6c 100%) !important;
    box-shadow: 0 12px 28px rgba(63, 168, 131, 0.22) !important;
}

body.library-dark .home-stat-card h3 {
    color: #f8fafc !important;
}

body.library-dark .home-stat-card p {
    color: #aebdca !important;
}

body.library-dark .home-library-card,
body.library-dark .home-book-card,
body.library-dark .home-activity-card {
    background: linear-gradient(180deg, rgba(18, 26, 35, 0.96), rgba(12, 18, 26, 0.93)) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.32) !important;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

body.library-dark .home-library-card:hover,
body.library-dark .home-book-card:hover,
body.library-dark .home-activity-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.4) !important;
}

body.library-dark .home-library-card h5,
body.library-dark .home-book-card h6,
body.library-dark .home-section-title,
body.library-dark .home-activity-card h6 {
    color: #f8fafc !important;
}

body.library-dark .home-library-card p,
body.library-dark .home-section-subtitle,
body.library-dark .home-book-authors,
body.library-dark .home-book-meta small,
body.library-dark .home-activity-copy,
body.library-dark .home-activity-date {
    color: #aebdca !important;
}

body.library-dark .home-search-card {
    background: rgba(12, 21, 18, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

body.library-dark .home-search-card .input-group-text,
body.library-dark .home-search-card .form-control {
    background: rgba(244, 248, 246, 0.96) !important;
    color: #10211a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.library-dark .home-search-card .form-control:focus {
    border-color: rgba(43, 122, 93, 0.4) !important;
    box-shadow: 0 0 0 0.18rem rgba(43, 122, 93, 0.12) !important;
}

body.library-dark .home-link {
    color: #86e2c0 !important;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.22s ease;
}

body.library-dark .home-link:hover {
    color: #b8edd5 !important;
}

body.library-dark .home-library-footer,
body.library-dark .home-activity-footer {
    color: #86e2c0 !important;
}

body.library-dark .home-library-badge,
body.library-dark .home-activity-badge,
body.library-dark .home-book-tag {
    background: rgba(78, 181, 145, 0.15) !important;
    color: #f4d18a !important;
    border-color: rgba(78, 181, 145, 0.16) !important;
}

body.library-dark .home-book-button {
    background: linear-gradient(135deg, #3fa883 0%, #2d8a6c 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 28px rgba(63, 168, 131, 0.22) !important;
    transition: all 0.22s ease !important;
}

body.library-dark .home-book-button:hover {
    background: linear-gradient(135deg, #2d8a6c 0%, #1f6950 100%) !important;
    box-shadow: 0 16px 36px rgba(63, 168, 131, 0.28) !important;
}

body.library-dark .home-section-title {
    color: #f8fafc !important;
}

body.library-dark .alert {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #aebdca !important;
}

body.library-dark .alert-light {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.library-dark .home-book-cover {
    background: linear-gradient(180deg, #1c2821, #121a16) !important;
}

body.library-dark .home-library-cover {
    background: linear-gradient(135deg, #1a2823, #121a15) !important;
}

@media (max-width: 767.98px) {
    .home-hero {
        padding: 2rem 1.75rem 1.75rem;
        border-radius: 1.6rem;
    }

    .home-hero h2 {
        font-size: clamp(1.45rem, 5.5vw, 2rem);
    }

    .home-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {
    .home-stats {
        margin-top: 1rem;
    }

    .home-stat-card {
        padding: 0.85rem 0.6rem;
        text-align: center;
        border-radius: 1.1rem;
    }

    .home-stat-card span {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    .home-stat-card h3 {
        font-size: 1.5rem;
    }

    .home-stat-card p {
        font-size: 0.75rem;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-top: 0.3rem;
    }
}

@media (max-width: 575.98px) {
    .home-hero {
        padding: 1.4rem 1.2rem 1.5rem;
        border-radius: 1.3rem;
    }

    .home-eyebrow {
        font-size: 0.74rem;
        padding: 0.35rem 0.7rem;
        gap: 0.4rem;
    }

    .home-hero h2 {
        margin-top: 0.75rem;
        margin-bottom: 0.65rem;
        font-size: 1.4rem;
        line-height: 1.15;
    }

    .home-hero p {
        font-size: 0.88rem;
        margin-bottom: 1.1rem;
        line-height: 1.55;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .home-search-card {
        padding: 0.65rem;
        border-radius: 1.1rem;
    }

    .home-search-card .input-group-text,
    .home-search-card .form-control,
    .home-search-card .btn {
        min-height: 44px;
        font-size: 0.9rem;
    }

    .home-search-card .btn {
        padding-inline: 0.9rem;
    }
}
