:root {
    --dark-bg: #121212;
    --darker-bg: #0a0a0a;
    --accent: #9c1e1e;
    --text: #e0e0e0;
    --text-muted: #9e9e9e;
}

body {
    background-color: var(--dark-bg);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.5s ease;
    position: relative;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 0%, rgba(156, 30, 30, 0.03) 0%, transparent 50%),
        linear-gradient(135deg, rgba(156, 30, 30, 0.01) 0%, transparent 50%),
        repeating-linear-gradient(45deg,
            rgba(255, 255, 255, 0.003) 0px,
            rgba(255, 255, 255, 0.003) 1px,
            transparent 1px,
            transparent 40px),
        repeating-linear-gradient(-45deg,
            rgba(156, 30, 30, 0.002) 0px,
            rgba(156, 30, 30, 0.002) 1px,
            transparent 1px,
            transparent 40px);
    opacity: 0.6;
    z-index: -2;
    pointer-events: none;
}


body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(ellipse at center, transparent 40%, rgba(10, 10, 10, 0.3) 100%),
        linear-gradient(0deg, rgba(10, 10, 10, 0.1) 0%, transparent 20%, transparent 80%, rgba(10, 10, 10, 0.1) 100%);
    opacity: 0.8;
    z-index: -1;
    pointer-events: none;
}

.navbar {
    background-color: var(--darker-bg) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 1px;
    margin: 0 10px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-dark .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover::after,
.navbar-dark .navbar-nav .nav-link.active::after {
    width: 100%;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #ffffff;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(156, 30, 30, 0.3);
}

.navbar-nav .nav-link {
    white-space: nowrap;
}

.blockquote p {
    white-space: normal;
    word-wrap: break-word;
}

.brand-accent {
    color: var(--accent);
}

.dropdown-menu {
    background-color: var(--darker-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.dropdown-item {
    color: var(--text-muted) !important;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--accent) !important;
    color: white !important;
}

.dropdown-divider {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

h1,
h2,
h3 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
}

h1::after,
h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--accent);
}

.hero-section {
    padding: 120px 0;
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(25, 25, 25, 0.8) 50%, rgba(0, 0, 0, 0.9) 100%),
        radial-gradient(ellipse at center, rgba(156, 30, 30, 0.05) 0%, transparent 70%);
    position: relative;
    text-align: center;
    overflow: hidden;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(90deg,
            transparent 0px,
            transparent 100px,
            rgba(156, 30, 30, 0.01) 100px,
            rgba(156, 30, 30, 0.01) 101px),
        repeating-linear-gradient(0deg,
            transparent 0px,
            transparent 100px,
            rgba(255, 255, 255, 0.01) 100px,
            rgba(255, 255, 255, 0.01) 101px);
    z-index: 1;
    pointer-events: none;
}

.hero-section>.container {
    position: relative;
    z-index: 2;
}

.card {
    background-color: rgba(25, 25, 25, 0.85);
    border: 1px solid rgba(156, 30, 30, 0.2);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow:
        0 15px 25px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(156, 30, 30, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(156, 30, 30, 0.4);
}

.card-img-container {
    position: relative;
    overflow: hidden;
    height: 280px;
    cursor: pointer;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.card:hover .card-img-overlay {
    opacity: 1;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
}

.card-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.btn-dark-theme {
    background-color: var(--accent);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-dark-theme:hover {
    background-color: #7a1818;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.genre-badge {
    background-color: rgba(156, 30, 30, 0.2);
    color: var(--text);
    border: 1px solid var(--accent);
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

footer {
    background-color: var(--darker-bg);
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.social-icons a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: var(--accent);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(156, 30, 30, 0.3);
}

.form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    padding: 0.75rem;
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: none;
}

.table {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.1);
}

.table thead th {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
}

.table td,
.table th {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
}

.book-cover {
    width: 80px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.book-cover:hover {
    transform: scale(1.1);
}

.pagination .page-link {
    background-color: var(--darker-bg);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.pagination .page-link:hover,
.pagination .page-item.active .page-link {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
}


.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    animation: modalFadeIn 0.3s ease;
}

.modal-content-img {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 85%;
    margin-top: 2%;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(156, 30, 30, 0.3);
    transition: transform 0.3s ease;
    cursor: zoom-out;
}

.modal-content-img:hover {
    transform: scale(1.02);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--accent);
    background: rgba(156, 30, 30, 0.2);
    transform: scale(1.1) rotate(90deg);
}

.modal-caption {
    text-align: center;
    color: #e0e0e0;
    padding: 20px;
    font-size: 18px;
    font-weight: 500;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    margin: 20px auto;
    max-width: 600px;
}


.clickable-image {
    position: relative;
    cursor: pointer;
}

.clickable-image::after {
    content: '🔍';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 10px;
    border-radius: 50%;
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    border: 2px solid var(--accent);
    z-index: 10;
}

.clickable-image:hover::after {
    opacity: 1;
    transform: scale(1.1);
}


.zoom-hover {
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zoom-hover img {
    transition: all 0.3s ease;
    transform: scale(1);
}

.zoom-hover:hover img {
    transform: scale(1.05);
}


.fade-in {
    animation: fadeIn 1s ease forwards;
}

.slide-up {
    animation: slideUp 0.8s ease forwards;
}

.pulse {
    animation: pulse 2s infinite;
}

.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.6s;
}

.delay-3 {
    animation-delay: 0.9s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}


@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-10px) rotate(1deg);
    }

    66% {
        transform: translateY(-5px) rotate(-1deg);
    }
}

/* Subtle glow animation for accent elements */
@keyframes subtleGlow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(156, 30, 30, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(156, 30, 30, 0.5), 0 0 30px rgba(156, 30, 30, 0.2);
    }
}

.brand-accent {
    animation: subtleGlow 3s ease-in-out infinite;
}
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.nav-item .nav-link:hover {
    animation: pulseLink 0.5s ease;
}

@keyframes pulseLink {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}


@media (max-width: 768px) {
    .modal-content-img {
        max-width: 95%;
        max-height: 80%;
        margin-top: 5%;
    }

    .close-modal {
        top: 15px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 30px;
    }

    .modal-caption {
        font-size: 16px;
        padding: 15px;
        margin: 15px;
    }
}

@media (max-width: 576px) {
    .modal-content-img {
        max-width: 98%;
        max-height: 75%;
        margin-top: 10%;
    }

    .close-modal {
        width: 45px;
        height: 45px;
        font-size: 25px;
    }
}

.author-tag {
    background-color: rgba(156, 30, 30, 0.15);
    color: var(--text);
    border: 1px solid rgba(156, 30, 30, 0.3);
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
    transition: all 0.3s ease;
}

.author-tag:hover {
    background-color: rgba(156, 30, 30, 0.3);
    border-color: rgba(156, 30, 30, 0.5);
    transform: scale(1.05);
}

.blockquote {
    font-style: italic;
    position: relative;
}

.blockquote::before {
    content: '"';
    font-size: 3rem;
    color: var(--accent);
    position: absolute;
    left: -20px;
    top: -10px;
    line-height: 1;
}