:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --accent-color: #ff4081;
    --bg-light: #f8f9fa;
    --text-light: #212529;
    --bg-dark: #121212;
    --text-dark: #e0e0e0;
    --card-bg-light: #ffffff;
    --card-bg-dark: #1e1e1e;
    --nav-bg-light: #ffffff;
    --nav-bg-dark: #1e1e1e;
}

[data-bs-theme="dark"] {
    --bs-body-bg: var(--bg-dark);
    --bs-body-color: var(--text-dark);
    .card {
        background-color: var(--card-bg-dark);
        border-color: #333;
    }
    .navbar {
        background-color: var(--nav-bg-dark) !important;
        border-bottom: 1px solid #333;
    }
    .list-group-item {
        background-color: var(--card-bg-dark);
        color: var(--text-dark);
        border-color: #333;
    }
    .list-group-item-action:hover {
        background-color: #333;
        color: white;
    }
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background: linear-gradient(to right, #6a11cb, #2575fc); /* Default gradient for brand feel unless overwritten */
}
[data-bs-theme="dark"] .navbar {
    background: #1e1e1e !important; /* Dark mode override */
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Cards & Books */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 12px;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Aspect Ratio for Book Covers - Critical Requirement */
.book-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background-color: #eee;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

/* Hero Section */
.jumbotron-custom {
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    color: #ffffff !important; /* Force white text on the gradient background */
}
.jumbotron-custom h1, .jumbotron-custom p {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3); /* Improve readability */
}
.jumbotron-custom::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('../images/hero-pattern.png'); /* Optional pattern */
    opacity: 0.1;
}

/* Chapter Content */
.chapter-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: inherit;
    max-width: 800px;
    margin: 0 auto;
}

/* Admin Sidebar adjustments */
.sidebar {
    background-color: #1a1a2e !important;
    border-right: 1px solid #333;
}
.sidebar .nav-link {
    border-radius: 5px;
    margin-bottom: 5px;
}
.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
}
.sidebar .nav-link.active {
    background-color: var(--primary-color) !important;
}
