@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   Design System & Global Variables
   ========================================================================== */
:root {
    --bg-primary: #0b0f19;
    --bg-surface: rgba(30, 41, 59, 0.45);
    --bg-surface-hover: rgba(30, 41, 59, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(99, 102, 241, 0.4);
    
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --color-primary: #6366f1; /* Indigo */
    --color-primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --color-accent-sunset: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    --color-accent-cyan: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --color-accent-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s ease;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
    padding-top: 120px;
    background-color: var(--bg-primary) !important;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(192, 132, 252, 0.12) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%) !important;
    background-attachment: fixed !important;
    background-size: cover !important;
    color: var(--text-secondary) !important;
    font-family: var(--font-sans) !important;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

pre {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    color: #e2e8f0 !important;
}

/* ==========================================================================
   Typography & Headers
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans) !important;
    font-weight: 800 !important;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

h1 {
    font-size: 2.5rem !important;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

hr {
    border-top: 1px solid var(--border-color) !important;
    margin: 2.5rem 0 !important;
    opacity: 0.5;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    background: rgba(11, 15, 25, 0.75) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3) !important;
    padding: 0.8rem 1.5rem !important;
    transition: var(--transition-fast);
}

.navbar-brand {
    font-weight: 800 !important;
    letter-spacing: -0.8px;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.45rem !important;
}

.navbar-nav .nav-link {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7) !important;
    transition: var(--transition-fast);
    padding: 0.5rem 1rem !important;
    border-radius: 10px;
    font-size: 0.925rem;
}

.navbar-nav .nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.05);
}

.navbar-nav .active > .nav-link,
.navbar-nav .nav-link.active,
.navbar-nav .nav-link:focus {
    color: var(--text-primary) !important;
    background: rgba(99, 102, 241, 0.15) !important;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 0.4rem 0.6rem !important;
}

/* ==========================================================================
   Dropdowns
   ========================================================================== */
.dropdown-menu {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    padding: 1rem !important;
    margin-top: 0.5rem !important;
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
    transition: var(--transition-fast) !important;
}

.dropdown-item:hover {
    color: var(--text-primary) !important;
    background: rgba(99, 102, 241, 0.2) !important;
    transform: translateX(4px);
}

.dropdown-menu.show[aria-labelledby="themes3"],
.dropdown-menu.show[aria-labelledby="themes2"] {
    display: flex !important;
    width: 460px !important;
    flex-wrap: wrap !important;
    gap: 4px 0;
}

.dropdown-menu.show[aria-labelledby="themes3"] .dropdown-item {
    width: 33.333% !important;
    font-size: 0.85rem !important;
}

.dropdown-menu.show[aria-labelledby="themes2"] .dropdown-item {
    width: 50% !important;
    font-size: 0.85rem !important;
}

/* ==========================================================================
   Jumbotron & Dashboard Panels
   ========================================================================== */
.jumbotron-light, .jumbotron {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 24px !important;
    padding: 2.2rem !important;
    margin-bottom: 2.5rem !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
}

.jumbotron h3, .jumbotron-light h3 {
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */
.form-control {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
    padding: 0.75rem 1.25rem !important;
    height: auto !important;
    font-size: 1rem !important;
    transition: var(--transition-fast) !important;
}

.form-control:focus {
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    outline: none;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Form layout in search headers */
.form-inline .form-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-size: 0.9rem !important;
    padding: 0.5rem 1rem !important;
    border-radius: 10px !important;
}

.form-inline button {
    padding: 0.5rem 1.25rem !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    border-radius: 12px !important;
    font-weight: 600 !important;
    letter-spacing: -0.2px;
    padding: 0.75rem 1.75rem !important;
    transition: var(--transition-smooth) !important;
    cursor: pointer;
}

.btn-primary {
    background: var(--color-primary-gradient) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3) !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.5) !important;
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: var(--text-secondary) !important;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

/* ==========================================================================
   Paginators & Alphabet Bars
   ========================================================================== */
.pagerbar {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.pagerbar .btn-group .btn-secondary {
    margin: 3px !important;
    border-radius: 10px !important;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 0.9rem !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
}

.pagerbar .btn-group .btn-secondary:hover {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

.btn-toolbar.center, .btn-toolbar {
    display: inline-flex !important;
    justify-content: center;
    width: 100%;
}

.btn-toolbar .btn-group {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.btn-toolbar .btn-group .btn {
    border-radius: 8px !important;
    padding: 0.45rem 0.95rem !important;
    font-size: 0.85rem !important;
    margin: 0 !important;
}

/* ==========================================================================
   Book Cards (Dynamic Grid)
   ========================================================================== */
.card.bg-secondary {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 18px !important;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    transition: var(--transition-smooth);
    margin-bottom: 2rem !important;
}

.card.bg-secondary:hover {
    transform: translateY(-8px) scale(1.015);
    background: var(--bg-surface-hover) !important;
    border-color: var(--border-color-hover) !important;
    box-shadow: 
        0 20px 35px rgba(0, 0, 0, 0.35), 
        0 0 20px rgba(99, 102, 241, 0.15);
}

.card-header.card-header-textoverflow {
    background: rgba(15, 23, 42, 0.25) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem !important;
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8;
    text-align: center;
    height: auto;
    min-height: 78px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-header.card-header-textoverflow b {
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: -0.2px;
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cover-image-card {
    padding: 0 !important;
    position: relative;
    overflow: hidden;
}

/* Dynamically loaded cover image element inside cardbody */
.cover-image-card a div {
    border-radius: 0 0 18px 18px !important;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.card.bg-secondary:hover .cover-image-card a div {
    transform: scale(1.06);
}

/* Series Badge overlay on cards */
.seriescard {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 6px 12px;
    border-radius: 12px 0 0 0;
    background: var(--color-accent-sunset) !important;
    color: #000000 !important;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: -2px -2px 10px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

/* ==========================================================================
   List Groups (Index Tables)
   ========================================================================== */
.list-group {
    background: transparent !important;
    margin-bottom: 0.5rem;
}

.list-group-item {
    background: rgba(30, 41, 59, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    margin-bottom: 8px;
    border-radius: 14px !important;
    transition: var(--transition-smooth) !important;
    padding: 0.85rem 1.25rem !important;
}

.list-group-item:hover {
    background: rgba(99, 102, 241, 0.08) !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
    transform: translateX(4px);
}

.list-group-item a {
    color: var(--text-secondary) !important;
    font-weight: 600;
    text-decoration: none !important;
    transition: var(--transition-fast);
}

.list-group-item:hover a {
    color: var(--text-primary) !important;
}

.list-group-item .badge-pill {
    background: var(--color-primary-gradient) !important;
    color: #ffffff !important;
    font-size: 0.8rem !important;
    padding: 0.4em 0.8em !important;
    border-radius: 20px !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    font-weight: 700;
}

/* Author page link specific classes */
.author_link a {
    color: var(--text-secondary);
}

.author_link a:hover {
    color: var(--text-primary);
}

.author_link a:visited {
    color: var(--text-secondary);
}

/* ==========================================================================
   Book Details Section (Shown dynamically on book click)
   ========================================================================== */
#book_div {
    margin-top: 1rem;
    animation: fadeIn 0.4s ease-out;
}

.breadcrumb {
    background: rgba(30, 41, 59, 0.35) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    padding: 0.8rem 1.5rem !important;
    margin-bottom: 2rem !important;
    font-weight: 500;
}

.breadcrumb-item a {
    color: #818cf8 !important;
    text-decoration: none !important;
    transition: var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: #a5b4fc !important;
}

.breadcrumb-item.active {
    color: #94a3b8 !important;
}

#big_cover {
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.45), 
        0 0 40px rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

#big_cover:hover {
    transform: scale(1.025);
}

.display-5 {
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    line-height: 1.25;
    color: var(--text-primary) !important;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.display-6 {
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    line-height: 1.2;
    color: #818cf8 !important;
    margin-bottom: 0.75rem;
}

.display-6-m {
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    line-height: 1.2;
    margin-top: 2rem !important;
    margin-bottom: 1.5rem !important;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
    padding-bottom: 0.5rem;
    display: inline-block;
}

#series_title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #f59e0b !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    display: inline-block;
}

#book_description {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 1.8rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 15px;
}

#book_description::-webkit-scrollbar {
    width: 6px;
}

#book_description::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

#book_description::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

#book_description::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

/* Badges styling inside book details */
#pub_year, #div_subjects .badge-light, .badge-black, .badge-primary {
    font-size: 0.85rem !important;
    padding: 0.55em 1.1em !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    margin-right: 8px !important;
    margin-bottom: 8px !important;
    display: inline-block;
    transition: var(--transition-smooth);
}

#pub_year {
    background: var(--color-accent-emerald) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

#pub_year:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

#div_subjects .badge-light {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-secondary) !important;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

#div_subjects .badge-light:hover {
    background: var(--color-primary) !important;
    color: #ffffff !important;
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.badge-black {
    background: rgba(15, 23, 42, 0.6) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

#epub_link {
    background: var(--color-accent-cyan) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    padding: 0.75rem 1.5rem !important;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3) !important;
}

#epub_link:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.5) !important;
    filter: brightness(1.1);
}

#kindle_link {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    padding: 0.75rem 1.5rem !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3) !important;
    margin-right: 12px !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#kindle_link:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.5) !important;
    filter: brightness(1.1);
}

.badge-margin {
    margin-left: 0 !important;
}

/* ==========================================================================
   Adjustments Settings Box
   ========================================================================== */
.op-div-sel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1.25rem;
    background: rgba(15, 23, 42, 0.35);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.op-div-sel span {
    font-weight: 600;
    color: var(--text-secondary);
}

.form-select-op {
    color: #ffffff !important;
    background-color: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 10px !important;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.form-select-op:focus {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   Checkboxes Styling
   ========================================================================== */
.checkbox-bundle {
    padding-top: 15px;
    display: flex;
    gap: 15px;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    margin-right: 20px;
    cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.checkbox-inline label {
    margin-left: 8px;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ==========================================================================
   Footer
   ========================================================================== */
#footer {
    margin-top: 6rem !important;
    margin-bottom: 4rem !important;
    padding-top: 2rem !important;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    clear: both;
}

#footer p {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Light Theme Custom Styles
   ========================================================================== */
body.light-theme {
    --bg-primary: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.7);
    --bg-surface-hover: rgba(255, 255, 255, 0.9);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-color-hover: rgba(99, 102, 241, 0.4);
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
}

body.light-theme {
    background-color: var(--bg-primary) !important;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.06) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(192, 132, 252, 0.06) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(6, 182, 212, 0.04) 0px, transparent 50%) !important;
    color: var(--text-secondary) !important;
}

/* Base modifications for light theme */
body.light-theme pre {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: var(--border-color) !important;
    color: #1e293b !important;
}

body.light-theme h1 {
    background: linear-gradient(135deg, #0f172a 0%, #475569 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

body.light-theme .jumbotron h3, 
body.light-theme .jumbotron-light h3,
body.light-theme .display-6-m {
    background: linear-gradient(135deg, #0f172a 0%, #475569 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

body.light-theme .navbar {
    background: rgba(248, 250, 252, 0.8) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 30px rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .navbar-brand {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .navbar-nav .nav-link {
    color: rgba(15, 23, 42, 0.7) !important;
}

body.light-theme .navbar-nav .nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .navbar-nav .active > .nav-link,
body.light-theme .navbar-nav .nav-link.active,
body.light-theme .navbar-nav .nav-link:focus {
    color: var(--text-primary) !important;
    background: rgba(99, 102, 241, 0.1) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
}

body.light-theme .navbar-toggler {
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

/* Dropdown modifications */
body.light-theme .dropdown-menu {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08) !important;
}

body.light-theme .dropdown-item {
    color: rgba(15, 23, 42, 0.7) !important;
}

body.light-theme .dropdown-item:hover {
    color: #4f46e5 !important;
    background: rgba(99, 102, 241, 0.06) !important;
}

/* Form inputs */
body.light-theme .form-control {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    color: var(--text-primary) !important;
}

body.light-theme .form-control:focus {
    background: #ffffff !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

body.light-theme .form-control::placeholder {
    color: rgba(15, 23, 42, 0.4) !important;
}

body.light-theme .form-inline .form-control {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* Buttons */
body.light-theme .btn-secondary {
    background: rgba(15, 23, 42, 0.05) !important;
    border: 1px solid rgba(15, 23, 42, 0.05) !important;
    color: var(--text-secondary) !important;
}

body.light-theme .btn-secondary:hover {
    background: rgba(15, 23, 42, 0.1) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: var(--text-primary) !important;
}

body.light-theme .pagerbar .btn-group .btn-secondary {
    background: rgba(15, 23, 42, 0.04) !important;
    border: 1px solid rgba(15, 23, 42, 0.04) !important;
}

/* Book Cards */
body.light-theme .card.bg-secondary {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .card.bg-secondary:hover {
    background: var(--bg-surface-hover) !important;
    border-color: var(--border-color-hover) !important;
    box-shadow: 
        0 15px 30px rgba(15, 23, 42, 0.1), 
        0 0 20px rgba(99, 102, 241, 0.1) !important;
}

body.light-theme .card-header.card-header-textoverflow {
    background: rgba(15, 23, 42, 0.03) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: #64748b !important;
}

/* List Groups */
body.light-theme .list-group-item {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .list-group-item:hover {
    background: rgba(99, 102, 241, 0.05) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

/* Breadcrumb & covers */
body.light-theme .breadcrumb {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid var(--border-color) !important;
}

body.light-theme .breadcrumb-item.active {
    color: #64748b !important;
}

body.light-theme #big_cover {
    box-shadow: 
        0 15px 30px rgba(15, 23, 42, 0.15), 
        0 0 30px rgba(99, 102, 241, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.light-theme #book_description::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02) !important;
}

body.light-theme #book_description::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1) !important;
}

body.light-theme #book_description::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.3) !important;
}

body.light-theme #div_subjects .badge-light {
    background: rgba(15, 23, 42, 0.04) !important;
    color: var(--text-secondary) !important;
    border: 1px solid rgba(15, 23, 42, 0.04) !important;
}

body.light-theme .badge-black {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #475569 !important;
    border: 1px solid rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .op-div-sel {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .form-select-op {
    color: var(--text-primary) !important;
    background-color: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

/* Kindle Modal Styles */
.kindle-modal-content {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}
.kindle-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 1.25rem 1.5rem !important;
}
.kindle-modal-title {
    font-weight: 700 !important;
    color: #ffffff !important;
}
.kindle-modal-close {
    background: none !important;
    border: none !important;
    font-size: 1.5rem !important;
    outline: none !important;
    opacity: 0.8 !important;
    color: #ffffff !important;
}
.kindle-modal-body {
    padding: 1.5rem !important;
}
.kindle-modal-label {
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
    color: rgba(255, 255, 255, 0.7) !important;
}
.kindle-modal-help {
    margin-top: 0.6rem !important;
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
    color: #94a3b8 !important;
}
.kindle-modal-checkbox-label {
    cursor: pointer !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    margin-left: 8px !important;
    margin-bottom: 0 !important;
    color: rgba(255, 255, 255, 0.7) !important;
}
.kindle-modal-content #saveKindleEmailCheck {
    position: relative !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    width: 16px !important;
    height: 16px !important;
    accent-color: #6366f1 !important;
    margin: 0 !important;
}
.kindle-modal-content .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 1.25rem 1.5rem !important;
}

body.light-theme .kindle-modal-content {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1) !important;
}
body.light-theme .kindle-modal-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}
body.light-theme .kindle-modal-title {
    color: #0f172a !important;
}
body.light-theme .kindle-modal-close {
    color: #0f172a !important;
}
body.light-theme .kindle-modal-label {
    color: #334155 !important;
}
body.light-theme .kindle-modal-help {
    color: #64748b !important;
}
body.light-theme .kindle-modal-checkbox-label {
    color: #334155 !important;
}
body.light-theme .kindle-modal-content .modal-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
}

/* Theme Toggle Button Styling */
.btn-theme-toggle {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    padding: 0.35rem 0.85rem !important;
    border-radius: 20px !important;
    font-size: 0.825rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    margin-left: 10px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.btn-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.05);
}

body.light-theme .btn-theme-toggle {
    background: rgba(15, 23, 42, 0.05) !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    color: #0f172a !important;
}

body.light-theme .btn-theme-toggle:hover {
    background: rgba(15, 23, 42, 0.1) !important;
}

/* ==========================================================================
   Netflix-style Book Reels Styles
   ========================================================================== */
.netflix-reel-container {
    margin-bottom: 2.8rem;
    position: relative;
}

.netflix-reel-title {
    font-size: 1.45rem !important;
    font-weight: 800 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.8rem !important;
    color: var(--text-primary);
    padding-left: 5px;
    letter-spacing: -0.4px;
}

.netflix-reel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.netflix-reel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 16px;
    padding: 15px 5px;
    width: 100%;
    scrollbar-width: none; /* Firefox */
}

.netflix-reel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.netflix-book-card {
    flex: 0 0 160px;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 0.6666;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--border-color);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
}

.netflix-book-card:hover {
    transform: scale(1.08) translateY(-6px);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.5), 
        0 0 20px rgba(99, 102, 241, 0.25);
    border-color: var(--border-color-hover);
    z-index: 10;
}

.netflix-book-cover {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 13px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.netflix-book-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(11, 15, 25, 0.95) 0%, rgba(11, 15, 25, 0.5) 70%, rgba(11, 15, 25, 0) 100%);
    padding: 25px 12px 12px 12px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
    height: 65%;
}

.netflix-book-card:hover .netflix-book-info {
    opacity: 1;
}

.netflix-book-title {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.netflix-book-author {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* Arrow controls overlay */
.netflix-reel-arrow {
    position: absolute;
    top: 15px;
    bottom: 15px;
    width: 45px;
    background: rgba(11, 15, 25, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    color: #ffffff;
    font-size: 1.6rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease, background-color 0.2s ease, transform 0.2s ease;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none !important;
}

.netflix-reel-wrapper:hover .netflix-reel-arrow {
    opacity: 1;
}

.netflix-reel-arrow:hover {
    background-color: var(--color-primary) !important;
    transform: scaleY(1.03);
}

.netflix-reel-arrow:active {
    transform: scale(0.95);
}

.netflix-reel-arrow.prev {
    left: -10px;
    border-radius: 8px;
}

.netflix-reel-arrow.next {
    right: -10px;
    border-radius: 8px;
}

/* Light Theme overrides for reels */
body.light-theme .netflix-book-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

body.light-theme .netflix-book-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 
        0 12px 25px rgba(15, 23, 42, 0.12), 
        0 0 15px rgba(99, 102, 241, 0.1) !important;
}

body.light-theme .netflix-book-info {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.6) 70%, rgba(255, 255, 255, 0) 100%);
    color: #0f172a;
}

body.light-theme .netflix-book-author {
    color: #475569;
}

body.light-theme .netflix-reel-arrow {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

body.light-theme .netflix-reel-arrow:hover {
    background-color: var(--color-primary) !important;
    color: #ffffff;
}


