/* ============================================
   BukuBase - Multi-Vendor Ebook Marketplace
   Theme: Yellow, Blue, White
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #1a56db;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --primary-pale: #dbeafe;
    --accent: #ffd700;
    --accent-dark: #e6c200;
    --accent-light: #ffed4a;
    --accent-pale: #fef9c3;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.15);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

body {
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--gray-900); }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p { color: var(--gray-600); }

.section-header {
    text-align: center;
    margin-bottom: 48px;
}
.section-header h2 {
    font-size: 2.2rem;
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}
.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: var(--radius-full);
}
.section-header p { font-size: 1.1rem; color: var(--gray-500); max-width: 600px; margin: 16px auto 0; }

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-fade-up { animation: fadeInUp 0.6s ease forwards; }
.animate-fade-in { animation: fadeIn 0.5s ease forwards; }
.animate-scale-in { animation: scaleIn 0.4s ease forwards; }

[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: var(--transition);
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(26, 86, 219, 0.35);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 86, 219, 0.45);
}

.btn-accent {
    background: var(--accent);
    color: var(--gray-900);
    box-shadow: 0 4px 14px rgba(255, 215, 0, 0.35);
}
.btn-accent:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.45);
}

.btn-outline {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}
.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-outline-accent {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}
.btn-outline-accent:hover {
    background: var(--accent);
    color: var(--gray-900);
}

.btn-white {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-md);
}
.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-danger { background: var(--error); color: var(--white); }
.btn-danger:hover { background: #dc2626; }

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #059669; }

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; height: 42px; padding: 0; border-radius: var(--radius); }

.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Top Bar ---------- */
.top-bar {
    background: var(--gray-900);
    color: var(--gray-400);
    font-size: 0.8rem;
    padding: 8px 0;
}
.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar-left, .top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.top-bar-left span { display: flex; align-items: center; gap: 6px; }
.top-bar-right a {
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 4px;
}
.top-bar-right a:hover { color: var(--accent); }

/* ---------- Navbar ---------- */
.navbar {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.navbar.scrolled {
    box-shadow: var(--shadow-md);
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(10px);
}
.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 30px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}
.logo i { font-size: 1.8rem; color: var(--accent); }
.logo-accent { color: var(--accent); }
.logo-img { max-height: 42px; width: auto; object-fit: contain; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-link {
    padding: 8px 16px;
    color: var(--gray-700);
    font-weight: 500;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.95rem;
}
.nav-link:hover { color: var(--primary); background: var(--primary-pale); }
.nav-link.active { color: var(--primary); background: var(--primary-pale); }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
    border: 1px solid var(--gray-100);
}
.dropdown-right { left: auto; right: 0; }
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--gray-700);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}
.dropdown-menu a:hover {
    background: var(--primary-pale);
    color: var(--primary);
}
.dropdown-menu a i { font-size: 1.1rem; width: 20px; text-align: center; }
.dropdown-all {
    border-top: 1px solid var(--gray-100);
    margin-top: 4px;
    padding-top: 8px !important;
    font-weight: 600;
    color: var(--primary) !important;
}
.dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--gray-600);
    position: relative;
    transition: var(--transition-fast);
}
.nav-icon-btn:hover { background: var(--gray-100); color: var(--primary); }
.nav-icon-btn i { font-size: 1.25rem; }

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: var(--accent);
    color: var(--gray-900);
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-search-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--gray-600);
    transition: var(--transition-fast);
}
.nav-search-toggle:hover { background: var(--gray-100); color: var(--primary); }

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}
.nav-user-btn:hover { background: var(--gray-100); }
.nav-avatar, .nav-avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    object-fit: cover;
}
.nav-avatar-placeholder {
    background: var(--primary-pale);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-user-name { font-weight: 500; font-size: 0.9rem; color: var(--gray-700); }

.nav-search-bar {
    background: var(--white);
    border-top: 1px solid var(--gray-100);
    padding: 16px 0;
    display: none;
    animation: fadeInDown 0.3s ease;
}
.nav-search-bar.active { display: block; }
.search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gray-50);
    padding: 6px 6px 6px 20px;
    border-radius: var(--radius-full);
    border: 2px solid var(--gray-200);
    transition: var(--transition);
}
.search-form:focus-within { border-color: var(--primary); background: var(--white); }
.search-form i { color: var(--gray-400); font-size: 1.2rem; }
.search-form input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: var(--gray-800);
}
.search-form input::placeholder { color: var(--gray-400); }
.search-close { color: var(--gray-400); font-size: 1.3rem; padding: 8px; }

.mobile-toggle { display: none; font-size: 1.4rem; color: var(--gray-700); padding: 8px; }

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius);
    margin: 16px 0;
    font-size: 0.95rem;
    font-weight: 500;
    animation: fadeInDown 0.4s ease;
    position: relative;
}
.alert-success { background: #ecfdf5; color: #065f46; border-left: 4px solid var(--success); }
.alert-error { background: #fef2f2; color: #991b1b; border-left: 4px solid var(--error); }
.alert-warning { background: #fffbeb; color: #92400e; border-left: 4px solid var(--warning); }
.alert-info { background: #ecfeff; color: #155e75; border-left: 4px solid var(--info); }
.alert-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: inherit;
    opacity: 0.5;
    font-size: 1.1rem;
    padding: 4px;
}
.alert-close:hover { opacity: 1; }

/* ---------- Hero Section ---------- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #0f2a6b 100%);
    padding: 100px 0 120px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.hero-shape {
    position: absolute;
    border-radius: var(--radius-full);
    opacity: 0.08;
}
.hero-shape-1 { width: 400px; height: 400px; background: var(--accent); top: -100px; right: -100px; animation: float 6s ease-in-out infinite; }
.hero-shape-2 { width: 200px; height: 200px; background: var(--accent); bottom: -50px; left: 10%; animation: float 8s ease-in-out infinite reverse; }
.hero-shape-3 { width: 100px; height: 100px; background: var(--white); top: 30%; left: 5%; animation: float 5s ease-in-out infinite; }

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-text { animation: slideInLeft 0.8s ease; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 215, 0, 0.25);
}
.hero-badge i { font-size: 1rem; }

.hero h1 {
    font-size: 3.5rem;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 20px;
    font-weight: 800;
}
.hero h1 span { color: var(--accent); }

.hero-desc {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 36px;
    line-height: 1.7;
    max-width: 520px;
}

.hero-search {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 6px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 32px;
    max-width: 520px;
}
.hero-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 20px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}
.hero-search .btn { padding: 14px 28px; border-radius: var(--radius); }

.hero-stats {
    display: flex;
    gap: 40px;
}
.hero-stat {
    text-align: center;
}
.hero-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
}
.hero-stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-top: 2px;
}

.hero-visual {
    position: relative;
    animation: slideInRight 0.8s ease;
}
.hero-books {
    display: flex;
    gap: 20px;
    justify-content: center;
    transform: perspective(800px) rotateY(-5deg);
}
.hero-book {
    width: 180px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    animation: float 4s ease-in-out infinite;
}
.hero-book:nth-child(2) { animation-delay: -1s; transform: translateY(-20px); }
.hero-book:nth-child(3) { animation-delay: -2s; }
.hero-book img { width: 100%; height: 260px; object-fit: cover; }
.hero-book-placeholder {
    width: 100%;
    height: 260px;
    background: linear-gradient(135deg, var(--accent-pale), var(--primary-pale));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary);
}

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--gray-50); }

/* ---------- Book Cards ---------- */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
}

.book-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    border: 1px solid var(--gray-100);
}
.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-pale);
}

.book-card-image {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: var(--gray-100);
}
.book-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}
.book-card:hover .book-card-image img { transform: scale(1.05); }

.book-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-pale), var(--accent-pale));
    color: var(--primary);
}
.book-card-image-placeholder i { font-size: 3rem; margin-bottom: 8px; }
.book-card-image-placeholder span { font-weight: 600; font-size: 0.85rem; }

.book-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--error);
    color: var(--white);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}
.book-card-badge.preorder { background: var(--primary); }

.book-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--transition);
    z-index: 2;
}
.book-card:hover .book-card-actions {
    opacity: 1;
    transform: translateX(0);
}
.book-card-action {
    width: 36px;
    height: 36px;
    background: var(--white);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    color: var(--gray-600);
    transition: var(--transition-fast);
    border: none;
    cursor: pointer;
}
.book-card-action:hover { background: var(--primary); color: var(--white); }
.book-card-action.wishlisted { color: var(--error); }

.book-card-body { padding: 18px; }

.book-card-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-pale);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.book-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}
.book-card-title a:hover { color: var(--primary); }

.book-card-author {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 10px;
}
.book-card-author a:hover { color: var(--primary); }

.book-card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}
.stars { display: flex; gap: 2px; color: var(--accent); font-size: 0.9rem; }
.stars.sm { font-size: 0.8rem; }
.book-card-rating span { font-size: 0.8rem; color: var(--gray-400); }

.book-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.book-card-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.price-current {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
}
.price-original {
    font-size: 0.85rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

.book-card-buy {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: var(--accent);
    color: var(--gray-900);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.book-card-buy:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* ---------- Categories Section ---------- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}
.category-card {
    background: var(--white);
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    opacity: 0;
    transition: var(--transition);
}
.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.category-card:hover::before { opacity: 1; }

.category-card-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-pale);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 1.5rem;
    color: var(--primary);
    transition: var(--transition);
    position: relative;
    z-index: 2;
}
.category-card:hover .category-card-icon { background: rgba(255,215,0,0.2); color: var(--accent); }

.category-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-800);
    position: relative;
    z-index: 2;
    transition: var(--transition);
}
.category-card:hover .category-card-name { color: var(--white); }

.category-card-count {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 4px;
    position: relative;
    z-index: 2;
    transition: var(--transition);
}
.category-card:hover .category-card-count { color: rgba(255,255,255,0.7); }

/* ---------- Featured Authors ---------- */
.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}
.author-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}
.author-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.author-card-avatar {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-full);
    margin: 0 auto 16px;
    overflow: hidden;
    border: 3px solid var(--accent);
    padding: 3px;
}
.author-card-avatar img { width: 100%; height: 100%; border-radius: var(--radius-full); object-fit: cover; }
.author-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--primary-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
}

.author-card-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.author-card-name a:hover { color: var(--primary); }
.author-card-bio {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.author-card-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-100);
}
.author-card-stat { text-align: center; }
.author-card-stat-value { font-size: 1.1rem; font-weight: 700; color: var(--primary); display: block; }
.author-card-stat-label { font-size: 0.75rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- CTA Section ---------- */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--accent);
    opacity: 0.1;
    border-radius: var(--radius-full);
    top: -100px;
    right: -50px;
}
.cta-section h2 { color: var(--white); font-size: 2.5rem; margin-bottom: 16px; position: relative; z-index: 2; }
.cta-section p { color: rgba(255,255,255,0.8); font-size: 1.15rem; margin-bottom: 32px; position: relative; z-index: 2; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--gray-800);
    transition: var(--transition);
    background: var(--white);
    outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-pale); }
.form-control::placeholder { color: var(--gray-400); }

textarea.form-control { min-height: 120px; resize: vertical; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}
.form-hint { font-size: 0.8rem; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: 0.8rem; color: var(--error); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.input-icon-wrapper {
    position: relative;
}
.input-icon-wrapper .form-control { padding-left: 44px; }
.input-icon-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.1rem;
}

/* ---------- Auth Pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 40px 20px;
    position: relative;
}
.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    position: relative;
    z-index: 2;
    animation: scaleIn 0.5s ease;
}
.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}
.auth-logo a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}
.auth-logo i { font-size: 2rem; color: var(--accent); }
.auth-title { text-align: center; margin-bottom: 8px; }
.auth-subtitle { text-align: center; color: var(--gray-500); margin-bottom: 28px; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--gray-400);
    font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.auth-footer { text-align: center; margin-top: 24px; color: var(--gray-500); font-size: 0.9rem; }
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.auth-nav {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
}
.auth-nav a {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
}
.auth-nav a:hover {
    color: var(--accent);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: #333;
    border: 1px solid var(--gray-200);
    font-weight: 600;
    transition: var(--transition-fast);
}
.btn-google:hover {
    background: #f5f5f5;
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ---------- Dashboard Layout ---------- */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--gray-900);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: var(--transition);
}
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--white);
}
.sidebar-logo i { color: var(--accent); font-size: 1.6rem; }

.sidebar-nav { padding: 16px 12px; }
.sidebar-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-500);
    padding: 12px 12px 8px;
    font-weight: 600;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--gray-400);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    margin-bottom: 2px;
}
.sidebar-link:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.sidebar-link.active {
    color: var(--accent);
    background: rgba(255, 215, 0, 0.1);
}
.sidebar-link i { font-size: 1.15rem; width: 22px; text-align: center; }
.sidebar-link .sidebar-badge {
    margin-left: auto;
    background: var(--accent);
    color: var(--gray-900);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
}

.dash-content {
    flex: 1;
    margin-left: 260px;
    background: var(--gray-50);
    min-height: 100vh;
}

.dash-header {
    background: var(--white);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}
.dash-header-left { display: flex; align-items: center; gap: 16px; }
.dash-header-left h1 { font-size: 1.3rem; }
.dash-header-right { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle {
    display: none;
    font-size: 1.4rem;
    color: var(--gray-600);
    padding: 8px;
}

.dash-body { padding: 28px; }

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-pale); color: var(--primary); }
.stat-icon.yellow { background: var(--accent-pale); color: var(--accent-dark); }
.stat-icon.green { background: #d1fae5; color: var(--success); }
.stat-icon.red { background: #fee2e2; color: var(--error); }
.stat-info h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 2px; }
.stat-info p { font-size: 0.85rem; color: var(--gray-500); margin: 0; }

/* Dashboard Cards */
.dash-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    margin-bottom: 24px;
    overflow: hidden;
}
.dash-card-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-100);
}
.dash-card-header h3 { font-size: 1.05rem; }
.dash-card-body { padding: 24px; }

/* ---------- Tables ---------- */
.table-wrapper { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}
.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.table tbody tr { transition: var(--transition-fast); }
.table tbody tr:hover { background: var(--gray-50); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}
.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.approved, .status-badge.completed, .status-badge.active { background: #d1fae5; color: #065f46; }
.status-badge.rejected, .status-badge.failed, .status-badge.suspended { background: #fee2e2; color: #991b1b; }
.status-badge.processing { background: var(--primary-pale); color: var(--primary); }
.status-badge.draft { background: var(--gray-100); color: var(--gray-600); }

/* ---------- Book Details Page ---------- */
.book-detail { padding: 60px 0; }
.book-detail-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 48px;
    align-items: start;
}

.book-cover-wrapper {
    position: sticky;
    top: 100px;
}
.book-cover {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}
.book-cover img { width: 100%; }
.book-cover-placeholder {
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, var(--primary-pale), var(--accent-pale));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary);
}

.book-detail-info h1 {
    font-size: 2rem;
    margin-bottom: 12px;
}
.book-detail-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.book-detail-author img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}
.book-detail-author-info span { font-size: 0.85rem; color: var(--gray-500); display: block; }
.book-detail-author-info a { font-weight: 600; color: var(--primary); }
.book-detail-author-info a:hover { text-decoration: underline; }

.book-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 20px;
}
.book-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}
.book-meta-item i { color: var(--primary); font-size: 1.1rem; }
.book-meta-item span { color: var(--gray-500); }
.book-meta-item strong { color: var(--gray-800); }

.book-detail-price-box {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--gray-100);
}
.book-detail-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}
.book-detail-price .price-current { font-size: 2rem; }
.book-detail-price .price-original { font-size: 1.1rem; }
.book-detail-price .discount-badge {
    background: var(--error);
    color: var(--white);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.book-detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.book-detail-desc { margin-bottom: 32px; }
.book-detail-desc h3 { margin-bottom: 12px; }
.book-detail-desc p { line-height: 1.8; }

/* Preview Pages */
.book-preview-section { margin-bottom: 32px; }
.book-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.preview-page {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}
.preview-page:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.preview-page img { width: 100%; }

/* Reviews */
.reviews-section { margin-top: 40px; }
.review-card {
    padding: 20px 0;
    border-bottom: 1px solid var(--gray-100);
}
.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
}
.review-name { font-weight: 600; }
.review-date { font-size: 0.8rem; color: var(--gray-400); }
.review-comment { color: var(--gray-600); line-height: 1.7; margin-top: 8px; }
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---------- Cart & Checkout ---------- */
.cart-page { padding: 60px 0; }
.cart-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    align-items: start;
}

.cart-items { display: flex; flex-direction: column; gap: 16px; }
.cart-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}
.cart-item:hover { box-shadow: var(--shadow); }
.cart-item-image {
    width: 100px;
    height: 140px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.cart-item-author { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 8px; }
.cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.cart-summary {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    position: sticky;
    top: 100px;
}
.cart-summary h3 { margin-bottom: 20px; }
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.95rem;
}
.cart-summary-row.total {
    border-top: 2px solid var(--gray-200);
    margin-top: 8px;
    padding-top: 16px;
    font-weight: 700;
    font-size: 1.15rem;
}
.cart-summary-row.total .price-current { color: var(--primary); }

.coupon-form {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}
.coupon-form input { flex: 1; }

/* ---------- Browse/Filter Page ---------- */
.browse-page { padding: 40px 0 80px; }
.browse-header {
    margin-bottom: 32px;
}
.browse-header h1 { font-size: 2rem; margin-bottom: 8px; }
.browse-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    align-items: start;
}

.filter-sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    position: sticky;
    top: 90px;
}
.filter-section { margin-bottom: 24px; }
.filter-section:last-child { margin-bottom: 0; }
.filter-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.filter-options { display: flex; flex-direction: column; gap: 8px; }
.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 4px 0;
}
.filter-option input { accent-color: var(--primary); width: 16px; height: 16px; }
.filter-option:hover { color: var(--primary); }

.price-range {
    display: flex;
    gap: 10px;
    align-items: center;
}
.price-range input {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.85rem;
}

.browse-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.browse-count { font-size: 0.9rem; color: var(--gray-500); }
.browse-sort select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--gray-700);
    background: var(--white);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.browse-view-toggle { display: flex; gap: 4px; }
.browse-view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition-fast);
}
.browse-view-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}
.page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    transition: var(--transition-fast);
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.page-dots { padding: 0 6px; color: var(--gray-400); }

/* ---------- Footer ---------- */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 60px 0 0;
    position: relative;
}
.footer-wave {
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    color: var(--gray-900);
}
.footer-wave svg { width: 100%; height: 50px; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 16px;
}
.footer-logo i { color: var(--accent); }
.footer-logo-img { max-height: 42px; width: auto; object-fit: contain; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; margin-bottom: 20px; }

.footer-socials {
    display: flex;
    gap: 10px;
}
.footer-socials a {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: var(--transition);
    font-size: 1.1rem;
}
.footer-socials a:hover { background: var(--accent); color: var(--gray-900); }

.footer-col h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 20px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a {
    color: var(--gray-400);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}
.footer-col ul a:hover { color: var(--accent); padding-left: 4px; }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.85rem;
}
.footer-credit {
    font-size: 0.85rem;
    color: var(--gray-500);
}
.footer-credit a {
    color: var(--accent);
    font-weight: 600;
    transition: var(--transition-fast);
}
.footer-credit a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.footer-payments {
    display: flex;
    gap: 12px;
    font-size: 1.5rem;
}

/* ---------- Scroll to Top ---------- */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 999;
    cursor: pointer;
    border: none;
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top:hover { background: var(--accent); color: var(--gray-900); transform: translateY(-3px); }

/* ---------- Loading Spinner ---------- */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state i { font-size: 4rem; color: var(--gray-300); margin-bottom: 16px; }
.empty-state h3 { color: var(--gray-500); margin-bottom: 8px; }
.empty-state p { color: var(--gray-400); margin-bottom: 24px; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
    box-shadow: var(--shadow-xl);
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close { font-size: 1.3rem; color: var(--gray-400); padding: 4px; cursor: pointer; }
.modal-close:hover { color: var(--gray-700); }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--gray-100);
}

/* ---------- File upload ---------- */
.file-upload {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}
.file-upload:hover { border-color: var(--primary); background: var(--primary-pale); }
.file-upload.dragover { border-color: var(--primary); background: var(--primary-pale); }
.file-upload i { font-size: 2.5rem; color: var(--gray-400); margin-bottom: 12px; }
.file-upload p { color: var(--gray-500); font-size: 0.9rem; }
.file-upload .file-name { font-weight: 600; color: var(--primary); margin-top: 8px; }

/* ---------- Charts placeholder ---------- */
.chart-container {
    height: 300px;
    background: var(--gray-50);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    border: 1px solid var(--gray-100);
}

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--gray-100);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 12px 20px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    flex-shrink: 0;
}
.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero-visual { display: none; }
    .hero h1 { font-size: 2.5rem; }
    .hero-desc { margin-left: auto; margin-right: auto; }
    .hero-search { margin-left: auto; margin-right: auto; }
    .hero-stats { justify-content: center; }
    
    .book-detail-grid { grid-template-columns: 300px 1fr; gap: 32px; }
    .browse-layout { grid-template-columns: 220px 1fr; }
    .cart-grid { grid-template-columns: 1fr 300px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    .section { padding: 50px 0; }
    
    .top-bar { display: none; }
    .nav-links { display: none; }
    .mobile-toggle { display: flex; }
    
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 16px;
        box-shadow: var(--shadow-lg);
        animation: fadeInDown 0.3s ease;
    }
    
    .hero { padding: 60px 0 80px; }
    .hero h1 { font-size: 2rem; }
    .hero-search { flex-direction: column; }
    .hero-search .btn { width: 100%; }
    
    .books-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
    .categories-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .authors-grid { grid-template-columns: 1fr 1fr; }
    
    .book-detail-grid { grid-template-columns: 1fr; }
    .book-cover-wrapper { position: static; max-width: 300px; margin: 0 auto; }
    
    .browse-layout { grid-template-columns: 1fr; }
    .filter-sidebar { position: static; display: none; }
    .filter-sidebar.active { display: block; }
    
    .cart-grid { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
    
    /* Dashboard mobile */
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .sidebar-toggle { display: flex; }
    .dash-content { margin-left: 0; }
    
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .books-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .book-card-image { height: 200px; }
    .book-card-body { padding: 12px; }
    .book-card-title { font-size: 0.9rem; }
    .book-card-author { font-size: 0.78rem; margin-bottom: 6px; }
    .book-card-rating { margin-bottom: 8px; }
    .book-card-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
    .book-card-buy { width: 100%; justify-content: center; }
    .categories-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .category-card { padding: 20px 14px; }
    .category-card-icon { width: 44px; height: 44px; font-size: 1.2rem; margin-bottom: 10px; }
    .category-card-name { font-size: 0.85rem; }
    .authors-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .hero-stats { flex-direction: row; gap: 24px; }
    .hero-stat-value { font-size: 1.4rem; }
    .hero-stat-label { font-size: 0.75rem; }
    .hero h1 { font-size: 1.7rem; }
    .hero-desc { font-size: 0.95rem; }
    .hero-badge { font-size: 0.78rem; padding: 6px 14px; margin-bottom: 16px; }
    .section-header { margin-bottom: 28px; }
    .section-header h2 { font-size: 1.5rem; }
    .section-header p { font-size: 0.9rem; }
    .cta-section { padding: 50px 0; }
    .cta-section h2 { font-size: 1.6rem; }
    .cta-section p { font-size: 0.95rem; }
    .btn-lg { padding: 12px 24px; font-size: 0.95rem; }
    .btn-group { flex-direction: column; align-items: stretch; }
}

/* ---------- Mobile Bottom Navigation (App-like) ---------- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    z-index: 1001;
    padding: 6px 0;
    padding-bottom: env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.mobile-bottom-nav {
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 12px;
    color: var(--gray-500);
    font-size: 0.65rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item i {
    font-size: 1.35rem;
    transition: var(--transition-fast);
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item.active i {
    transform: scale(1.1);
}

.mobile-nav-badge {
    position: absolute;
    top: 0;
    right: 4px;
    width: 18px;
    height: 18px;
    background: var(--accent);
    color: var(--gray-900);
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }

    body {
        padding-bottom: 70px;
    }

    .footer {
        padding-bottom: 80px;
        margin-bottom: 0;
    }

    .scroll-top {
        bottom: 80px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    /* Hide top nav actions that are now in bottom nav */
    .nav-icon-btn { display: none; }
    .nav-user-btn .nav-user-name { display: none; }
    .nav-auth-btn { display: none; }
    
    /* Better mobile nav */
    .nav-content { padding: 10px 0; }
    .logo { font-size: 1.3rem; }
    .logo i { font-size: 1.5rem; }

    /* Improve hero for mobile */
    .hero { padding: 40px 0 60px; }
    .hero-search { 
        flex-direction: column; 
        border-radius: var(--radius); 
        box-shadow: var(--shadow-md);
    }
    .hero-search input { 
        padding: 12px 16px; 
        border-radius: var(--radius); 
    }
    .hero-search .btn { 
        width: 100%; 
        border-radius: var(--radius); 
        padding: 12px; 
    }
    .hero-stats { margin-top: 8px; }

    /* Compact sections */
    .section { padding: 40px 0; }
    .container { padding: 0 16px; }

    /* Better category grid on mobile */
    .categories-grid { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 10px; 
    }

    /* Better author cards */
    .authors-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .author-card { padding: 20px 16px; }
    .author-card-avatar { width: 64px; height: 64px; margin-bottom: 10px; }
    .author-card-bio { font-size: 0.78rem; }

    /* CTA compact */
    .cta-section { padding: 50px 0; }

    /* Footer compact for mobile */
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-col:not(.footer-brand) h4 { margin-bottom: 12px; }
    .footer-col ul li { margin-bottom: 6px; }

    /* Prevent nav actions overflow */
    .nav-actions { gap: 6px; }
    .btn-sm { padding: 6px 12px; font-size: 0.8rem; }

    /* Dashboard mobile overflow prevention */
    .dash-card-body { overflow-x: auto; }
    .dash-body { overflow-x: hidden; }

    /* Prevent text overflow */
    .alert { word-break: break-word; }
    .form-hint { word-break: break-word; }
    p { word-break: break-word; }
    h1, h2, h3, h4 { word-break: break-word; }
}
