
/* CSS Stylesheet for EduBooks (Optimized & Universal) */

:root {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-navbar: rgba(255, 255, 255, 0.85);
    --bg-footer: #f1f5f9;
    --border-color: #64748b;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-light: #94a3b8;
    --text-footer: #475569;
    --text-footer-light: #0f172a;
    
    --accent: #3b82f6;
    --accent-hover: #1d4ed8;
    --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
}

[data-theme="dark"] {
    --bg-body: #090d16;
    --bg-card: #151c2c;
    --bg-navbar: rgba(21, 28, 44, 0.85);
    --bg-footer: #080c14;
    --border-color: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
    --text-footer: #94a3b8;
    --text-footer-light: #f8fafc;
    
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #60a5fa, #a78bfa);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

/* Universal Square Menu Toggle Button (Desktop & Mobile) */
.menu-toggle-btn, .mobile-menu-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    background-color: var(--bg-card) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.2s ease !important;
    outline: none !important;
}

.menu-toggle-btn:hover, .menu-toggle-btn.active,
.mobile-menu-toggle:hover, .mobile-menu-toggle.active {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background-color: var(--border-color) !important;
}

.navbar-nav-panel.collapsed {
    display: none !important;
}

/* Full Cover Image Display (No Truncation) */
.book-card-cover-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 220px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-sm);
    padding: 6px;
    overflow: hidden;
}

.book-card-cover {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain !important;
    border-radius: 4px;
}

/* Full Book Title Display (No Truncation) */
.book-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.35;
    display: block !important;
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    word-break: break-word;
    color: var(--text-primary);
}

/* Minimalist Compact Horizontal Subject & Class Lists */
.compact-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.compact-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.compact-pill:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-md);
}

.compact-pill-count {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background-color: rgba(100, 116, 139, 0.15);
    color: var(--text-secondary);
}

/* Light Theme 5 Pastel Color Varieties */
[data-theme="light"] .compact-pill:nth-child(5n+1),
[data-theme="light"] .section-card-link:nth-child(5n+1) .section-card,
[data-theme="light"] .book-card:nth-child(5n+1) {
    background-color: #ecfdf5 !important;
    border: 2px solid #10b981 !important;
}

[data-theme="light"] .compact-pill:nth-child(5n+2),
[data-theme="light"] .section-card-link:nth-child(5n+2) .section-card,
[data-theme="light"] .book-card:nth-child(5n+2) {
    background-color: #f0f9ff !important;
    border: 2px solid #0284c7 !important;
}

[data-theme="light"] .compact-pill:nth-child(5n+3),
[data-theme="light"] .section-card-link:nth-child(5n+3) .section-card,
[data-theme="light"] .book-card:nth-child(5n+3) {
    background-color: #fff7ed !important;
    border: 2px solid #f97316 !important;
}

[data-theme="light"] .compact-pill:nth-child(5n+4),
[data-theme="light"] .section-card-link:nth-child(5n+4) .section-card,
[data-theme="light"] .book-card:nth-child(5n+4) {
    background-color: #fdf2f8 !important;
    border: 2px solid #ec4899 !important;
}

[data-theme="light"] .compact-pill:nth-child(5n+5),
[data-theme="light"] .section-card-link:nth-child(5n+5) .section-card,
[data-theme="light"] .book-card:nth-child(5n+5) {
    background-color: #f8fafc !important;
    border: 2px solid #64748b !important;
}

/* Universal Vertical Floating Action Bar (Always Visible Everywhere) */
.floating-actions-bar {
    position: fixed !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    z-index: 999999 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.floating-scroll-bar {
    position: fixed !important;
    right: 12px !important;
    bottom: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    z-index: 999999 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.floating-btn {
    width: 42px !important;
    height: 42px !important;
    border-radius: 10px !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: transform 0.2s, filter 0.2s !important;
    text-decoration: none !important;
}

.floating-btn:hover {
    transform: scale(1.12) !important;
    filter: brightness(1.15) !important;
}

#float-search { background-color: #f39c12 !important; }
#float-theme { background-color: #3b82f6 !important; }
#float-copy { background-color: #9b59b6 !important; }
#float-share-tg { background-color: #0088cc !important; }
#float-share-wa { background-color: #25d366 !important; }
#float-share-vk { background-color: #4a76a8 !important; }
#float-scroll-up { background-color: #475569 !important; }
#float-scroll-down { background-color: #475569 !important; }

/* CSS Stylesheet for EduBooks (Optimized) */

:root {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-navbar: rgba(255, 255, 255, 0.85);
    --bg-footer: #f1f5f9;
    --border-color: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-light: #94a3b8;
    --text-footer: #475569;
    --text-footer-light: #0f172a;
    
    --accent: #3b82f6;
    --accent-hover: #1d4ed8;
    --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
}

[data-theme="dark"] {
    --bg-body: #090d16;
    --bg-card: #151c2c;
    --bg-navbar: rgba(21, 28, 44, 0.85);
    --bg-footer: #080c14;
    --border-color: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
    --text-footer: #94a3b8;
    --text-footer-light: #f8fafc;
    
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #60a5fa, #a78bfa);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

/* Navbar styling */
.navbar {
    position: relative;
    z-index: 100;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.navbar-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 8px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.navbar-nav-panel {
    border-top: 1px solid var(--border-color);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 6px 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.nav-row-label {
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    min-width: 80px;
}

.nav-links-wrap {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}

.nav-pill {
    padding: 2px 6px;
    border-radius: 6px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.15s;
    font-size: 0.74rem;
    white-space: nowrap;
}

.nav-pill:hover, .nav-pill.active {
    background-color: var(--accent);
    color: white;
    border-color: transparent;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    padding-right: 32px;
    border-radius: 16px;
    outline: none;
    color: var(--text-primary);
    width: 140px;
    transition: all 0.25s;
    font-size: 0.8rem;
}

.search-box input:focus {
    width: 200px;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.search-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-btn svg {
    width: 14px;
    height: 14px;
}

.search-results-overlay {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    padding: 8px;
    z-index: 110;
    max-height: 480px;
    overflow-y: auto;
}

.search-results-overlay.active {
    display: flex;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: var(--bg-body);
}

.search-result-cover {
    width: 38px;
    height: 53px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.search-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-result-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.search-no-results {
    padding: 12px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background-color: var(--border-color);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

[data-theme="light"] .theme-sun { display: none; }
[data-theme="light"] .theme-moon { display: block; }
[data-theme="dark"] .theme-sun { display: block; }
[data-theme="dark"] .theme-moon { display: none; }

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.menu-toggle .bar {
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s;
}

/* Main Content Area */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 1200px;
    width: 100%;
    margin: 15px auto 0 auto;
    padding: 0 24px;
}

.breadcrumbs-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumbs-separator {
    color: var(--text-light);
}

.breadcrumbs-current {
    color: var(--text-light);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 50px 24px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.4rem;
    line-height: 1.2;
    margin-bottom: 12px;
}

.hero p {
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Sections Grid */
.sections-heading {
    font-size: 1.6rem;
    margin-bottom: 24px;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.section-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.section-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    height: 100%;
}

.section-card-link:hover .section-card {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.section-icon {
    width: 40px;
    height: 40px;
    color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-icon svg {
    width: 20px;
    height: 20px;
}

.section-card h3 {
    font-size: 1.15rem;
}

.section-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

/* Category Detail Header */
.category-header {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.category-header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.category-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 800px;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.book-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.book-card-cover-wrapper {
    position: relative;
    padding-top: 140%; /* 5:7 Aspect Ratio */
    background-color: var(--bg-body);
    overflow: hidden;
}

.book-card-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.book-card:hover .book-card-cover {
    transform: scale(1.05);
}

.book-card-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.book-card-grade {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.book-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.3rem;
    color: var(--text-primary);
}

.book-card-footer {
    border-top: 1px solid var(--border-color);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-card-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #eab308;
}

.book-card-rating svg {
    width: 12px;
    height: 12px;
}

.book-card-btn {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.page-link:hover, .page-link.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.page-ellipsis {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0 4px;
    font-size: 0.85rem;
}

/* Book Details Page Layout */
.book-details-wrapper {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.book-details-left {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.book-cover-large {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    aspect-ratio: 5/7;
    object-fit: cover;
}

.book-meta-list {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.book-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 6px;
}

.book-meta-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.book-meta-row span:first-child {
    color: var(--text-secondary);
}

.book-meta-row span:last-child {
    font-weight: 600;
}

.book-details-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.book-title-header h1 {
    font-size: 1.8rem;
    line-height: 1.25;
    margin-bottom: 6px;
}

.book-description-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.book-description-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.book-description-card p {
    font-size: 0.9rem;
    margin: 0;
}

/* Collapsible Book Description */
.book-description-content {
    position: relative;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.book-description-content.collapsed {
    max-height: 95px;
}

/* Fade overlay for collapsed state */
.book-description-content.collapsed .book-description-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--bg-card));
    pointer-events: none;
    transition: opacity 0.2s;
}

/* Hide fade when expanded */
.book-description-content:not(.collapsed) .book-description-fade {
    opacity: 0;
    pointer-events: none;
}

/* Button to toggle description */
.btn-toggle-desc {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0;
    margin-top: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.btn-toggle-desc:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.btn-toggle-desc svg {
    transition: transform 0.2s ease;
}

.btn-toggle-desc.expanded svg {
    transform: rotate(180deg);
}

.book-actions-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Beautiful Download PDF Button */
.btn-download {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2), 0 2px 4px -2px rgba(16, 185, 129, 0.2);
    font-weight: 700;
}

.btn-download:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3), 0 4px 6px -4px rgba(16, 185, 129, 0.3);
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* Share Bar */
.share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.share-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.share-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.share-tg { background-color: #229ED9; }
.share-tg:hover { background-color: #1c82b3; transform: scale(1.1); }
.share-wa { background-color: #25D366; }
.share-wa:hover { background-color: #1eaf53; transform: scale(1.1); }
.share-vk { background-color: #4C75A3; }
.share-vk:hover { background-color: #3b5c82; transform: scale(1.1); }
.share-copy { background-color: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); }
.share-copy:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.1); }
.share-btn svg { width: 16px; height: 16px; }

/* Reader Section (Iframe Container click overlay to bypass scroll capture) */
.reader-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.reader-section h3 {
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    font-size: 1.15rem;
}

.iframe-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    height: 650px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none; /* Block mouse events initially to let parent page scroll */
    transition: opacity 0.3s;
}

.iframe-container.active iframe {
    pointer-events: auto; /* Allow scrolling/reading on click */
}

.iframe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
    transition: opacity 0.3s, visibility 0.3s;
}

.iframe-overlay-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.iframe-overlay-btn:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}

.iframe-overlay-text {
    color: white;
    font-size: 0.85rem;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.iframe-container.active .iframe-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Similar Books Section */
.similar-section {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    margin-bottom: 30px;
}

.similar-section h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
}

/* Scroll Buttons Floating */
.scroll-buttons {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 99;
}

.scroll-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    opacity: 0.8;
}

.scroll-btn:hover {
    opacity: 1;
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.1);
}

.scroll-btn svg {
    width: 18px;
    height: 18px;
}

#scroll-up {
    display: none;
}

#scroll-up.visible {
    display: flex;
}

/* Footer styling */
.footer {
    background-color: var(--bg-footer);
    color: var(--text-footer);
    padding: 40px 24px 20px 24px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-info {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-desc {
    font-size: 0.85rem;
    color: var(--text-footer);
    opacity: 0.8;
    line-height: 1.5;
}

.logo.light-text {
    color: var(--text-footer-light);
}

.footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.footer-contacts h4 {
    color: var(--text-footer-light);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.footer-email {
    font-size: 0.85rem;
    opacity: 0.85;
}

.footer-email a {
    color: var(--accent);
    font-weight: 600;
}

.footer-email a:hover {
    text-decoration: underline;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .book-details-wrapper {
        flex-direction: column;
        align-items: center;
    }
    
    .book-details-left {
        flex: 1;
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .navbar-top-row {
        padding: 10px 16px;
    }
    
    .navbar-nav-panel {
        padding: 8px 16px;
        gap: 6px;
    }
    
    .nav-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .nav-row-label {
        min-width: auto;
        padding-top: 0;
        margin-bottom: 2px;
    }
    
    .nav-links-wrap {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-pill {
        flex: 0 0 auto;
    }
    
    .search-box input {
        width: 120px;
    }
    
    .search-box input:focus {
        width: 160px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .category-header {
        padding: 20px;
    }
    
    .category-header h1 {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 16px;
    }
}

/* Hide original absolute scroll buttons */
.scroll-buttons {
    display: none !important;
}

/* Vertical Floating Actions Bar */
.floating-actions-bar {
    position: fixed;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

.floating-actions-bar.visible {
    opacity: 1;
    visibility: visible;
}

.floating-btn {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
    margin: 0;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
    text-decoration: none;
}

.floating-btn:hover {
    transform: scale(1.12);
    filter: brightness(1.15);
}

/* Vibrant Button Background Colors */
#float-search {
    background-color: #f39c12; /* Warm Orange */
}

#float-copy {
    background-color: #9b59b6; /* Purple */
}

#float-share-tg {
    background-color: #0088cc; /* Telegram Blue */
}

#float-share-wa {
    background-color: #25d366; /* WhatsApp Green */
}

#float-share-vk {
    background-color: #4a76a8; /* VK Blue */
}

#float-scroll-up {
    background-color: #535c68; /* Slate Gray */
}

#float-scroll-down {
    background-color: #535c68; /* Slate Gray */
}

/* Smooth Toast Notification styling */
.toast-notification {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Floating Navigation Scroll Buttons (Bottom Right) */
.floating-scroll-bar {
    position: fixed;
    right: 8px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

.floating-scroll-bar.visible {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .floating-actions-bar {
        right: 4px;
        gap: 3px;
    }
    
    .floating-scroll-bar {
        right: 4px;
        bottom: 12px;
        gap: 3px;
    }
    
    .floating-btn {
        width: 26px;
        height: 26px;
    }
}

/* SEO Description Block Styles */
.seo-text-block {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    margin-top: 40px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.seo-text-block h2 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-family: 'Outfit', sans-serif;
}

.seo-text-block h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    margin-top: 20px;
    margin-bottom: 10px;
    font-family: 'Outfit', sans-serif;
}

.seo-text-block p {
    margin-bottom: 15px;
}

.seo-text-block ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.seo-text-block li {
    margin-bottom: 8px;
}
