/*
 * Pediatric Surgery Books - Main Stylesheet
 * ==========================================
 * Modern, professional design for pediatric surgeons
 */

/* ==================== CSS Variables ==================== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    --dark: #1e293b;
    --dark-light: #334155;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --gray-lighter: #cbd5e1;
    --light: #f1f5f9;
    --lighter: #f8fafc;
    --white: #ffffff;
    
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* ==================== Base Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--lighter);
    padding-top: 76px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== Navigation ==================== */
.navbar {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    padding: 0.75rem 0;
    box-shadow: var(--shadow);
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white) !important;
}

.navbar-brand i {
    color: var(--accent);
    font-size: 1.75rem;
}

.brand-text {
    background: linear-gradient(135deg, var(--white) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--white) !important;
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 0.5rem;
}

.dropdown-item {
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--light);
    color: var(--primary);
}

.search-form .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    border-radius: var(--radius) 0 0 var(--radius);
}

.search-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-form .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    box-shadow: none;
    color: var(--white);
}

/* Navbar search (Amazon style) */
.navbar-search .input-group {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.navbar-search .btn {
    border-radius: 0;
}

.navbar-search .dropdown-toggle {
    border-radius: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-search .form-control {
    border-radius: 0;
}

.navbar-search .form-control:focus {
    box-shadow: none;
    border-color: var(--accent);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--dark);
    font-weight: 600;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: var(--dark);
}

/* ==================== Shop / Home Page Filters ==================== */
.filter-sidebar {
    background: var(--white);
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius);
    position: sticky;
    top: 100px;
    padding: 1rem;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.filter-header {
    font-size: 1.1rem;
    color: var(--dark);
    font-family: var(--font-primary);
}

.filter-subtitle {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dark-light);
}

.filter-link {
    font-size: 0.85rem;
    display: block;
    padding: 2px 0;
}

.filter-link:hover {
    color: var(--accent-dark) !important;
}

.active-filter {
    color: var(--dark) !important;
}

.stars-gold {
    color: var(--accent);
}

/* Amazon-style sorting select */
.sort-select {
    background-color: var(--light);
    border-color: var(--gray-lighter);
    cursor: pointer;
}

.sort-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.25);
}

/* ==================== Hero Section ==================== */
.hero-section {
    position: relative;
    min-height: 60vh;
    padding: 4rem 0;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 50%, var(--primary-dark) 100%);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem 0;
}

.hero-title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
    max-width: 520px;
}

.hero-search .form-control {
    border-radius: var(--radius) 0 0 var(--radius);
    height: 56px;
}

.hero-search .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
    height: 56px;
}

.hero-nav-links .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius);
}

.hero-nav-links .btn:hover {
    transform: translateY(-1px);
}

/* Book Showcase */
.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-showcase {
    position: relative;
    width: 400px;
    height: 500px;
}

.showcase-book {
    position: absolute;
    width: 220px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

.showcase-book img {
    width: 100%;
    height: auto;
    display: block;
}

.showcase-book.book-1 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    z-index: 3;
}

.showcase-book.book-2 {
    top: 40%;
    left: 20%;
    transform: translate(-50%, -50%) rotate(-15deg) scale(0.9);
    z-index: 2;
    opacity: 0.8;
}

.showcase-book.book-3 {
    top: 45%;
    left: 80%;
    transform: translate(-50%, -50%) rotate(10deg) scale(0.85);
    z-index: 1;
    opacity: 0.7;
}

.book-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    padding: 2rem;
    text-align: center;
}

.book-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--white);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ==================== Section Styles ==================== */
section {
    padding: 2.5rem 0;
}

.shop-header {
    padding-top: 2rem;
    padding-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(20, 30, 45, 0.95));
    color: var(--white);
}

.shop-header .section-title {
    color: var(--white);
    font-size: 1.75rem;
}

.shop-header .section-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.section-header {
    text-align: left;
    margin-bottom: 1.5rem;
}

.section-header.text-center {
    text-align: center;
}

.section-badge {
    display: none;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--gray);
    max-width: none;
    margin: 0;
}

/* ==================== Book Card ==================== */
.book-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--gray-lighter);
}

.book-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.book-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}

.badge-new {
    background: var(--success);
    color: var(--white);
}

.badge-sale {
    background: var(--danger);
    color: var(--white);
}

.badge-top {
    background: var(--accent);
    color: var(--dark);
}

/* Book-type badges (ONE: Badge System) */
.badge-type {
    letter-spacing: 0.04em;
}

.badge-textbook {
    background: #b8860b;
    color: #fff8e7;
}

.badge-atlas {
    background: #1e6fa8;
    color: #e8f4fc;
}

.badge-history {
    background: #7b5c3e;
    color: #f9f3ec;
}

.badge-examprep,
.badge-revision {
    background: #1a7a4a;
    color: #e8f7ef;
}

.badge-mis {
    background: #5b21b6;
    color: #ede9fe;
}

.badge-concise {
    background: #0e7490;
    color: #e0f7fa;
}

.badge-undergraduate {
    background: #2563eb;
    color: #eff6ff;
}

.badge-autobiography {
    background: #92400e;
    color: #fef3c7;
}

.badge-free {
    background: #065f46;
    color: #d1fae5;
}

.badge-clinical {
    background: #be185d;
    color: #fce7f3;
}

.badge-other {
    background: var(--gray);
    color: var(--white);
}

.book-cover {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.book-cover img {
    height: 200px;
    width: auto;
    object-fit: contain;
    transition: var(--transition-fast);
}

.book-cover:hover img {
    transform: scale(1.03);
}

.book-cover-placeholder {
    height: 200px;
    width: 140px;
    background: linear-gradient(135deg, var(--light) 0%, var(--gray-lighter) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    padding: 1rem;
    text-align: center;
    font-size: 0.75rem;
}

.book-cover-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.book-actions {
    display: none;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-compare {
    background: var(--white);
    color: var(--dark);
}

.btn-compare:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-view {
    background: var(--accent);
    color: var(--dark);
}

.btn-view:hover {
    background: var(--accent-dark);
}

.book-info {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
}

.category-tag {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    background: var(--tag-color, var(--primary));
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.book-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-title a {
    color: var(--dark);
}

.book-title a:hover {
    color: var(--primary);
}

.book-authors {
    font-size: 0.75rem;
    color: var(--gray);
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* THREE: Category breadcrumb above title */
.book-breadcrumb {
    font-size: 0.65rem;
    margin-bottom: 0.25rem;
}

.breadcrumb-link {
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.breadcrumb-link:hover {
    color: var(--primary);
}

/* THREE: Expert tagline under author */
.book-tagline {
    font-size: 0.72rem;
    color: var(--gray);
    font-style: italic;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* THREE: Value tag next to price */
.value-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.15rem 0.4rem;
    background: var(--light);
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--gray);
    vertical-align: middle;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
}

.stars {
    color: var(--accent);
    font-size: 0.7rem;
}

.rating-value {
    font-weight: 600;
    color: var(--dark);
}

.review-count {
    font-size: 0.65rem;
    color: var(--gray);
}

.book-scores {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem 0.3rem;
    background: var(--light);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--gray);
}

.book-price {
    margin-bottom: 0.5rem;
    margin-top: auto;
}

.price-original {
    text-decoration: line-through;
    color: var(--gray-light);
    font-size: 0.75rem;
    margin-right: 0.4rem;
}

.price-current {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.btn-buy {
    width: 100%;
    padding: 0.5rem 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transition: var(--transition-fast);
}

.btn-buy:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-buy:active {
    transform: translateY(0);
}

.affiliate-pitch {
    display: none;
}

/* ==================== Category Cards ==================== */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    text-align: center;
    height: 100%;
    border: 1px solid var(--gray-lighter);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
    border-color: var(--primary);
}

.category-icon {
    width: 50px;
    height: 50px;
    background: var(--category-color, var(--primary));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    transition: var(--transition-fast);
}

.category-card:hover .category-icon {
    transform: scale(1.05);
}

.category-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.category-count {
    font-size: 0.8rem;
    color: var(--gray);
}

/* ==================== Author Cards ==================== */
.author-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
    height: 100%;
}

.author-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--light);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    font-size: 2.5rem;
}

.author-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.author-credentials {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
}

.author-affiliation {
    font-size: 0.8125rem;
    color: var(--gray);
    margin-top: 0.5rem;
}

/* ==================== CTA Section ==================== */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem 0;
}

.cta-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.cta-title {
    font-size: 1.25rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.cta-text {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* ==================== Newsletter Section ==================== */
.newsletter-section {
    background: var(--dark);
    padding: 2rem 0;
}

.newsletter-title {
    color: var(--white);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.newsletter-text {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.newsletter-form .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 0.75rem 1rem;
}

.newsletter-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-form .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    box-shadow: none;
    color: var(--white);
}

/* ==================== Footer ==================== */
.footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 2.5rem 0 1.5rem;
}

.footer-brand {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.footer-description {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 0.5rem;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
    font-size: 0.875rem;
}

.social-link:hover {
    background: var(--accent);
    color: var(--dark);
    transform: translateY(-2px);
}

.footer-title {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links,
.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li,
.footer-contact li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 0.3rem;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.footer-contact i {
    color: var(--accent);
    margin-top: 0.2rem;
    margin-right: 0.5rem;
}

.footer-disclaimer {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0;
}

.copyright,
.made-with {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-bottom: 0;
}

/* ==================== Page Header ==================== */
.page-header {
    background: linear-gradient(135deg, var(--light) 0%, var(--lighter) 100%);
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--gray);
    font-size: 1.125rem;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--primary);
}

.breadcrumb-item.active {
    color: var(--gray);
}

/* ==================== Book Detail Page ==================== */
.breadcrumb-nav {
    background: var(--light);
    padding: 1rem 0;
}

.book-detail-section {
    padding: 3rem 0;
}

/* Ensure columns in the book detail layout align to the top so sidebars
   using sticky positioning remain alongside the main content. */
.book-detail-section .row {
    align-items: flex-start !important;
}

/* Right column styles removed - analytics moved to fixed sidebar */

.book-detail-cover {
    position: relative;
    margin-bottom: 1.5rem;
}

.book-detail-cover img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.discount-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--danger);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.125rem;
}

.quick-actions {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.affiliate-note {
    font-size: 0.75rem;
    color: var(--gray);
    text-align: center;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

.book-detail-info {
    padding-left: 0;
}

.detail-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.detail-subtitle {
    font-size: 1.25rem;
    color: var(--gray);
    font-weight: 400;
    margin-bottom: 1rem;
}

.detail-authors {
    margin-bottom: 1rem;
}

.detail-authors .label {
    color: var(--gray);
}

.author-link {
    font-weight: 500;
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.detail-rating .stars {
    font-size: 1.25rem;
}

.detail-rating .rating-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.detail-price {
    margin-bottom: 1.5rem;
}

.detail-price .price-original {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.detail-price .price-current {
    font-size: 2.5rem;
    font-weight: 700;
}

.affiliate-pitch-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.affiliate-pitch-box i {
    color: var(--accent);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.affiliate-pitch-box p {
    margin-bottom: 0;
    font-style: italic;
    color: var(--dark);
}

/* Book Tabs */
.book-tabs {
    margin-top: 2rem;
}

.book-tabs .nav-tabs {
    border-bottom: 2px solid var(--light);
    gap: 0.5rem;
}

.book-tabs .nav-link {
    color: var(--gray) !important;
    background: none;
    border: none;
    padding: 1rem 1.5rem !important;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.book-tabs .nav-link:hover {
    color: var(--primary) !important;
    background: none;
}

.book-tabs .nav-link.active {
    color: var(--primary) !important;
    background: none;
    border-bottom-color: var(--primary);
}

.tab-content-inner {
    padding: 2rem 0;
}

/* Compact layout for 1080p/shorter viewports */
@media (max-height: 1080px) {
    .book-detail-section {
        padding: 2rem 0;
    }

    .book-detail-info {
        padding-left: 0;
    }

    .detail-title {
        font-size: 2rem;
        margin-bottom: 0.25rem;
    }

    .detail-subtitle {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .detail-price .price-current {
        font-size: 2rem;
    }

    .quick-actions {
        padding: 1rem;
    }

    .affiliate-pitch-box {
        padding: 1rem;
    }

    .book-tabs .nav-link {
        padding: 0.75rem 1rem !important;
    }

    .tab-content-inner {
        padding: 1.5rem 0;
    }
}

/* Analysis Section */
.analysis-scores {
    margin-bottom: 2rem;
}

.scores-grid {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.score-item {
    text-align: center;
}

.score-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) var(--score), var(--light) var(--score));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.score-ring::before {
    content: '';
    width: 65px;
    height: 65px;
    background: var(--white);
    border-radius: 50%;
    position: absolute;
}

.score-value {
    position: relative;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.score-label {
    font-size: 0.875rem;
    color: var(--gray);
}

.analysis-section {
    margin-bottom: 2rem;
}

.analysis-section h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.strength-list,
.gap-list {
    list-style: none;
    padding: 0;
}

.strength-list li,
.gap-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.strength-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--success);
}

.gap-list li::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--warning);
}

.uses-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.use-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--light);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--dark);
}

.use-tag.small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.recommendation-box {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.recommendation-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    margin-bottom: 1rem;
}

.recommendation-badge.urgency-musthave {
    background: var(--success);
    color: var(--white);
}

.recommendation-badge.urgency-highlyrecommended {
    background: var(--primary);
    color: var(--white);
}

.recommendation-badge.urgency-consider {
    background: var(--accent);
    color: var(--dark);
}

.recommendation-badge.urgency-skip {
    background: var(--gray-light);
    color: var(--white);
}

/* ==================== Expert Analysis Panel (ea-*) ==================== */
.ea-panel {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--white);
}

/* Header */
.ea-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: var(--white);
}

.ea-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    font-size: 0.85rem;
}

.ea-panel-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--white);
}

.ea-urgency-pill {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    white-space: nowrap;
}
.ea-urgency-pill.urgency-must-have,
.ea-urgency-pill.urgency-musthave    { background: #10b981; color: #fff; }
.ea-urgency-pill.urgency-highly-recommended,
.ea-urgency-pill.urgency-highlyrecommended { background: #3b82f6; color: #fff; }
.ea-urgency-pill.urgency-consider    { background: #f59e0b; color: #1e293b; }
.ea-urgency-pill.urgency-skip        { background: #94a3b8; color: #fff; }

/* Score bars */
.ea-scores-row {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ea-score-item { }

.ea-score-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.ea-score-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ea-score-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark);
}
.ea-score-num small { font-size: 0.65rem; color: var(--gray); font-weight: 400; }

.ea-bar-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.ea-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.8s ease;
}

/* Two-column section (strengths + right) */
.ea-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.ea-strengths-col,
.ea-right-col {
    padding: 0 0.5rem;
}

.ea-strengths-col { border-right: 1px solid #e2e8f0; padding-right: 0.75rem; }
.ea-right-col    { padding-left: 0.75rem; }

.ea-block-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray);
    margin-bottom: 0.4rem;
}

/* Strength chips */
.ea-strength-chip {
    position: relative;
    font-size: 0.78rem;
    color: var(--dark);
    padding: 0.3rem 0.5rem 0.3rem 1rem;
    margin-bottom: 0.3rem;
    background: #f0fdf4;
    border-left: 3px solid #10b981;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    line-height: 1.3;
}
.ea-strength-chip::before {
    content: '✓';
    position: absolute;
    left: 0.25rem;
    top: 0.3rem;
    font-size: 0.6rem;
    color: #10b981;
    font-weight: 700;
}

/* Audience box */
.ea-audience-box {
    background: #eff6ff;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
}
.ea-audience-who {
    font-size: 0.78rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}
.ea-level-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    background: #2563eb;
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    text-transform: capitalize;
}
.ea-spec-tag {
    display: inline-block;
    font-size: 0.67rem;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.1rem 0.4rem;
    border-radius: 20px;
    margin-right: 0.2rem;
    margin-top: 0.2rem;
}

/* Gap chips */
.ea-gaps-box { }
.ea-gap-chip {
    font-size: 0.76rem;
    color: #92400e;
    padding: 0.25rem 0.5rem 0.25rem 0.9rem;
    margin-bottom: 0.25rem;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    line-height: 1.3;
    position: relative;
}
.ea-gap-chip::before {
    content: '!';
    position: absolute;
    left: 0.25rem;
    top: 0.25rem;
    font-size: 0.6rem;
    color: #f59e0b;
    font-weight: 900;
}

/* Uses row */
.ea-uses-row {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.ea-uses-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
}
.ea-use-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #1d4ed8;
    background: #dbeafe;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    gap: 0.2rem;
}
.ea-use-chip i { font-size: 0.6rem; color: #10b981; }

/* Recommendation banner */
.ea-recommend-banner {
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--dark);
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
}
.ea-recommend-banner.urgency-must-have,
.ea-recommend-banner.urgency-musthave {
    background: #d1fae5; color: #065f46;
}
.ea-recommend-banner.urgency-highly-recommended,
.ea-recommend-banner.urgency-highlyrecommended {
    background: #dbeafe; color: #1e40af;
}
.ea-recommend-banner.urgency-consider {
    background: #fef3c7; color: #92400e;
}
.ea-recommend-banner.urgency-skip {
    background: #f1f5f9; color: #475569;
}

/* Responsive: stack two-col on small screens */
@media (max-width: 576px) {
    .ea-two-col {
        grid-template-columns: 1fr;
    }
    .ea-strengths-col {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding-right: 0.5rem;
        padding-bottom: 0.5rem;
    }
    .ea-right-col { padding-left: 0.5rem; }
}

/* Details Table */
.details-table {
    width: 100%;
}

.details-table td {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--light);
}

.details-table td:first-child {
    color: var(--gray);
    width: 40%;
}

.details-table td:last-child {
    color: var(--dark);
    font-weight: 500;
}

/* Reviews Section */
.reviews-section {
    margin-top: 3rem;
}

.review-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.reviewer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.reviewer-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.reviewer-title {
    font-size: 0.875rem;
    color: var(--gray);
}

.review-meta {
    text-align: right;
}

.review-date {
    display: block;
    font-size: 0.875rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

.verified-badge {
    display: inline-block;
    background: var(--success);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.review-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.review-content {
    color: var(--gray);
    margin-bottom: 0;
}

.review-form-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

/* ==================== Book List Page ==================== */
.filters-sidebar {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light);
}

.filter-header h5 {
    margin-bottom: 0;
}

.clear-filters {
    font-size: 0.875rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.filter-title i:last-child {
    font-size: 0.75rem;
    transition: var(--transition);
}

.filter-title[aria-expanded="true"] i:last-child {
    transform: rotate(180deg);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.375rem 0;
}

.filter-option input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-lighter);
    border-radius: var(--radius-sm);
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.filter-option input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.filter-option input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--white);
    font-size: 0.625rem;
}

.option-label {
    font-size: 0.875rem;
    color: var(--dark);
}

.books-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--radius);
}

.results-count {
    color: var(--gray);
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-dropdown label {
    color: var(--gray);
    font-size: 0.875rem;
}

.sort-dropdown .form-select {
    width: auto;
    border-color: var(--gray-lighter);
}

.active-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filters-label {
    font-size: 0.875rem;
    color: var(--gray);
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.filter-tag a {
    color: var(--white);
}

.filter-tag a:hover {
    color: rgba(255, 255, 255, 0.8);
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results-icon {
    width: 100px;
    height: 100px;
    background: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.no-results-icon i {
    font-size: 3rem;
    color: var(--gray-light);
}

.no-results h3 {
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

/* ==================== Comparison Page ==================== */
.comparison-table-wrapper {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    min-width: 800px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    border: 1px solid var(--light);
    vertical-align: top;
}

.comparison-table th {
    background: var(--light);
    font-weight: 600;
}

.feature-column {
    width: 150px;
    background: var(--dark) !important;
    color: var(--white);
}

.book-column {
    min-width: 200px;
}

/* ==================== Advanced Analysis Styles (aas-*) ==================== */

.advanced-analysis-section {
    margin-top: 2.5rem;
    margin-bottom: 2rem;
}

/* ---- Section header ---- */
.aas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #3b4f6b 100%);
    border-radius: var(--radius-lg);
    color: white;
    gap: 1rem;
}

.aas-header-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.aas-header-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
}

.aas-header-sub {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.aas-header-count {
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---- Featured card ---- */
.aas-featured {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.aas-featured::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.aas-featured-ribbon {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    border-bottom-right-radius: var(--radius);
}

.aas-featured-inner {
    display: flex;
    gap: 2rem;
    padding: 1.5rem 2rem 2rem;
}

.aas-featured-content {
    flex: 1;
    min-width: 0;
}

.aas-featured-type {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.75rem;
}

.aas-analyst-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.aas-analyst-row > i { color: rgba(255, 255, 255, 0.6); }

.aas-cred {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.78rem;
}

.aas-verified-badge {
    background: rgba(16, 185, 129, 0.3);
    border: 1px solid rgba(16, 185, 129, 0.6);
    color: #a7f3d0;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
}

.aas-block {
    margin: 0.9rem 0;
    padding: 0.9rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid rgba(255, 255, 255, 0.35);
}

.aas-block-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.5rem;
}

.aas-block p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.55;
    margin: 0;
}

.aas-block.aas-block-strength { border-left-color: #6ee7b7; }
.aas-block.aas-block-weakness { border-left-color: #fcd34d; }
.aas-block.aas-block-rec      { border-left-color: #93c5fd; }

/* Featured gauge */
.aas-featured-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 140px;
}

.aas-gauge-ring {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: conic-gradient(rgba(255, 255, 255, 0.9) calc(var(--score) * 72deg), rgba(255, 255, 255, 0.15) 0deg);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.aas-gauge-ring::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(80, 50, 150, 0.6);
    border-radius: 50%;
    backdrop-filter: blur(4px);
}

.aas-gauge-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.aas-gauge-val {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.aas-gauge-max {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.15rem;
}

.aas-grade-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.aas-grade-badge.grade-excellent { background: #10b981; color: white; }
.aas-grade-badge.grade-great     { background: #3b82f6; color: white; }
.aas-grade-badge.grade-good      { background: #f59e0b; color: #1e293b; }
.aas-grade-badge.grade-fair      { background: #ef4444; color: white; }

/* ---- Analysis cards grid ---- */
.aas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
}

.aas-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aas-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Tier top-border accent */
.aas-card.tier-excellent { border-top: 3px solid #10b981; }
.aas-card.tier-great     { border-top: 3px solid #3b82f6; }
.aas-card.tier-good      { border-top: 3px solid #f59e0b; }
.aas-card.tier-fair      { border-top: 3px solid #ef4444; }

/* Card header */
.aas-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem 0.65rem;
}

.aas-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.aas-card.tier-excellent .aas-card-icon { background: #d1fae5; color: #059669; }
.aas-card.tier-great .aas-card-icon     { background: #dbeafe; color: #2563eb; }
.aas-card.tier-good .aas-card-icon      { background: #fef3c7; color: #d97706; }
.aas-card.tier-fair .aas-card-icon      { background: #fee2e2; color: #dc2626; }

.aas-card-meta { flex: 1; min-width: 0; }

.aas-card-type-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
}

.aas-card-analyst {
    font-size: 0.72rem;
    color: var(--gray);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aas-card-analyst i { color: var(--success); font-size: 0.65rem; }

/* Score dial (conic-gradient donut) */
.aas-dial {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: conic-gradient(var(--dial-color, #94a3b8) calc(var(--score) * 72deg), #e2e8f0 0deg);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aas-dial::after {
    content: '';
    position: absolute;
    width: 38px;
    height: 38px;
    background: var(--white);
    border-radius: 50%;
}

.aas-dial-num {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--dark);
}

.aas-card.tier-excellent .aas-dial { --dial-color: #10b981; }
.aas-card.tier-great .aas-dial     { --dial-color: #3b82f6; }
.aas-card.tier-good .aas-dial      { --dial-color: #f59e0b; }
.aas-card.tier-fair .aas-dial      { --dial-color: #ef4444; }

/* Score progress bar */
.aas-card-bar {
    height: 4px;
    background: #f1f5f9;
    margin: 0 1rem;
    border-radius: 9999px;
    overflow: hidden;
}

.aas-card-bar-fill {
    height: 100%;
    border-radius: 9999px;
    width: calc(var(--score) * 20%);
    transition: width 0.8s ease;
}

.aas-card.tier-excellent .aas-card-bar-fill { background: #10b981; }
.aas-card.tier-great .aas-card-bar-fill     { background: #3b82f6; }
.aas-card.tier-good .aas-card-bar-fill      { background: #f59e0b; }
.aas-card.tier-fair .aas-card-bar-fill      { background: #ef4444; }

/* Card body */
.aas-card-body {
    padding: 0.85rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.aas-card-insight {
    font-size: 0.82rem;
    color: var(--gray);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.aas-card-rec {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    line-height: 1.4;
}

.aas-card-rec i {
    margin-top: 0.2rem;
    flex-shrink: 0;
    font-size: 0.6rem;
}

/* Responsive */
@media (max-width: 768px) {
    .aas-header { flex-wrap: wrap; }
    .aas-featured-inner { flex-direction: column; }
    .aas-featured-gauge {
        width: 100%;
        flex-direction: row;
        gap: 1.5rem;
        padding: 0.5rem 0;
    }
    .aas-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .aas-grid { grid-template-columns: 1fr; }
}

/* ==================== End Advanced Analysis Styles ==================== */

.comparison-book-header {
    position: relative;
    text-align: center;
}

.remove-book {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--danger);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.book-cover-small {
    width: 100px;
    margin: 0 auto 1rem;
}

.book-cover-small img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.cover-placeholder {
    aspect-ratio: 2/3;
    background: var(--light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
}

.comparison-book-header .book-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.comparison-book-header .book-authors {
    font-size: 0.8125rem;
    margin-bottom: 0;
}

.feature-name {
    font-weight: 600;
    color: var(--dark);
}

.feature-name i {
    color: var(--primary);
}

.feature-value {
    text-align: center;
}

.price-old {
    text-decoration: line-through;
    color: var(--gray-light);
    font-size: 0.875rem;
    display: block;
}

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.rating-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.rating-stars {
    color: var(--accent);
}

.rating-number {
    font-weight: 600;
}

.score-bar {
    position: relative;
    height: 24px;
    background: var(--light);
    border-radius: var(--radius);
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius);
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dark);
}

.strengths-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.strengths-list li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--light);
}

.strengths-list li:last-child {
    border-bottom: none;
}

.actions-row td {
    background: var(--light);
}

.comparison-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.comparison-empty .empty-icon {
    width: 120px;
    height: 120px;
    background: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.comparison-empty .empty-icon i {
    font-size: 3.5rem;
    color: var(--gray-light);
}

/* ==================== Comparison Float Button ==================== */
.comparison-float-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: var(--transition);
}

.comparison-float-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    color: var(--white);
}

.comparison-count {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: var(--dark);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== Notification Toast ==================== */
.notification-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ==================== Responsive ==================== */
@media (max-width: 991.98px) {
    .hero-content {
        text-align: center;
        padding: 3rem 0;
    }
    
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        display: none;
    }
    
    .book-detail-info {
        padding-left: 0;
        margin-top: 2rem;
    }
}

@media (max-width: 767.98px) {
    .page-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .books-toolbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filters-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 575.98px) {
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .cta-box {
        padding: 2rem 1.5rem;
        text-align: center;
    }
    
    .cta-title {
        font-size: 1.5rem;
    }
}

/* ==================== Fixed Right Sidebar ==================== */

.fixed-right-sidebar {
    position: fixed;
    right: 0;
    top: 76px;
    width: 320px;
    height: calc(100vh - 76px);
    background: var(--white);
    border-left: 1px solid var(--gray-lighter);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-lighter) transparent;
}

/* Webkit browsers scrollbar styling */
.fixed-right-sidebar::-webkit-scrollbar {
    width: 6px;
}

.fixed-right-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.fixed-right-sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-lighter);
    border-radius: 3px;
}

.fixed-right-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-light);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
    display: flex;
    align-items: center;
}

.sidebar-title i {
    color: var(--primary);
    margin-right: 0.5rem;
}

/* Content area - scrollable */
.fixed-right-sidebar > *:not(.sidebar-header):not(.sidebar-footer) {
    flex: 1;
    overflow-y: auto;
}

/* Placeholder content styling */
.sidebar-placeholder {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.placeholder-item {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.placeholder-item:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    transform: translateY(-2px);
}

.placeholder-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 0.75rem;
    transition: var(--transition);
}

.placeholder-item:hover .placeholder-icon {
    transform: scale(1.05);
}

.placeholder-item h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0.5rem 0;
}

.placeholder-item p {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0;
    line-height: 1.4;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--light);
    background: var(--lighter);
    flex-shrink: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--primary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-link:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: var(--primary-dark);
    text-decoration: none;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

/* Adjust main content to make room for right sidebar */
main.main-content {
    margin-right: 0;
    padding-right: 320px;
}

/* Container and content area adjustments */
.container-fluid {
    padding-right: calc(var(--bs-gutter-x) * 0.5);
}

/* Responsive: Hide right sidebar on smaller screens */
@media (max-width: 1199.98px) {
    main.main-content {
        padding-right: 280px;
    }
    
    .fixed-right-sidebar {
        width: 280px;
    }
}

@media (max-width: 991.98px) {
    main.main-content {
        padding-right: 0;
    }
    
    .fixed-right-sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 1px solid var(--gray-lighter);
        box-shadow: none;
        margin-top: 2rem;
    }
    
    .sidebar-placeholder {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .placeholder-item {
        padding: 0.75rem;
    }
    
    .placeholder-item h6 {
        font-size: 0.85rem;
    }
    
    .placeholder-item p {
        font-size: 0.75rem;
    }
}

@media (max-width: 767.98px) {
    .sidebar-placeholder {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .placeholder-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .sidebar-footer {
        padding: 0.75rem;
    }
    
    .sidebar-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* ==================== Book Metrics Widgets ==================== */

.book-metrics-container {
    padding: 0.75rem;
}

.metrics-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--light);
}

.metrics-heading {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
    margin: 0;
}

/* Individual widget card */
.metrics-widget {
    background: var(--white);
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
    transition: var(--transition-fast);
}

.metrics-widget:last-child {
    margin-bottom: 0;
}

.metrics-widget:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.widget-icon {
    color: var(--primary);
    font-size: 0.95rem;
    width: 1rem;
    text-align: center;
}

.widget-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray);
    margin: 0;
}

.widget-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.widget-detail {
    font-size: 0.75rem;
    color: var(--gray);
    margin: 0;
}

/* Difficulty bars */
.difficulty-bars {
    display: flex;
    gap: 3px;
    margin-top: 0.5rem;
}

.difficulty-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-lighter);
    transition: background var(--transition-fast);
}

.difficulty-bar.active {
    background: var(--primary);
}

.difficulty-widget .difficulty-bar.active {
    background: var(--primary);
}

/* Value badges */
.value-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.value-badge-excellent { background: #d1fae5; color: #065f46; }
.value-badge-good      { background: #dbeafe; color: #1e40af; }
.value-badge-fair      { background: #fef3c7; color: #92400e; }
.value-badge-premium   { background: #ede9fe; color: #4c1d95; }
.value-badge-unknown   { background: var(--light); color: var(--gray); }

/* Affiliate widget */
.affiliate-widget .widget-note {
    font-size: 0.7rem;
    color: var(--gray);
    margin: 0;
}

/* Sidebar container (inside fixed right sidebar) */
.book-metrics-sidebar-container {
    padding: 0.5rem;
    overflow-y: auto;
}

/* ==================== End Book Metrics Widgets ==================== */
