* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f1f5f9;
    color: #1e293b;
}
.container.mt-4 { flex: 1; }

/* ---- Hero ---- */
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(99,102,241,0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(168,85,247,0.1) 0%, transparent 50%);
    animation: float 15s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-20px)} }
.hero-section h1 { font-size: 3.2rem; font-weight: 800; position: relative; letter-spacing: -0.5px; }
.hero-section p { font-size: 1.2rem; opacity: 0.85; position: relative; }

/* ---- Navbar ---- */
.navbar { padding: 12px 0; }
.navbar-brand { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.3px; }
.nav-link { font-weight: 500; font-size: 0.9rem; }
.dropdown-menu { border: none; box-shadow: 0 10px 40px rgba(0,0,0,0.12); border-radius: 12px; padding: 8px; }
.dropdown-item { border-radius: 8px; padding: 8px 16px; font-size: 0.9rem; }
.dropdown-item:hover { background: #f1f5f9; }

/* ---- Cards ---- */
.card { border: none; border-radius: 16px; overflow: hidden; }
.card-hover { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.card-hover:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.card-header { background: transparent; border-bottom: 1px solid #e2e8f0; font-weight: 600; }

/* ---- Stat Cards ---- */
.stat-card {
    border: 1px solid #e9ecef; border-radius: 14px; padding: 24px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    text-align: left; position: relative;
    transition: all 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.07); transform: translateY(-2px); }
.stat-card .stat-label { color: #6c757d; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; margin-bottom: 4px; }
.stat-card .stat-number { font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; color: #1e293b; line-height: 1.1; }
.stat-card .stat-icon { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); font-size: 2rem; color: #ced4da; opacity: 0.7; }

/* ---- Books ---- */
.book-card { border-radius: 16px; overflow: hidden; background: white; }
.book-card .card-img-top { height: 260px; object-fit: cover; transition: transform 0.3s; }
.book-card:hover .card-img-top { transform: scale(1.03); }
.book-cover-placeholder {
    height: 260px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 3rem;
}

/* ---- Badges ---- */
.badge { font-weight: 600; font-size: 0.75rem; padding: 5px 10px; border-radius: 6px; }
.badge-live { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.badge-draft { background: #94a3b8; color: white; }
.badge-paused { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.badge-reading { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.badge-completed { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.badge-dropped { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.badge-expired { background: #64748b; color: white; }

/* ---- Misc ---- */
.bid-info { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 16px; }
.reader-slots { font-size: 0.85rem; color: #64748b; }
.genre-badge {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 500;
    background: #ede9fe; color: #6d28d9;
}
.pdf-viewer { width: 100%; height: 85vh; border: none; border-radius: 12px; }

/* ---- Platform Cards (home) ---- */
.platform-card {
    border: none; border-radius: 20px; padding: 48px 32px;
    text-align: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.platform-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.platform-card i { font-size: 3.5rem; margin-bottom: 24px; }
.platform-card h3 { font-weight: 700; }
.platform-author { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); color: white; }
.platform-reader { background: linear-gradient(135deg, #f97316 0%, #ef4444 100%); color: white; }

/* ---- Tables ---- */
.table { font-size: 0.9rem; }
.table th { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; border-bottom-width: 1px; }
.table td { vertical-align: middle; padding: 12px; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ---- Buttons ---- */
.btn { font-weight: 600; border-radius: 10px; padding: 8px 20px; font-size: 0.9rem; transition: all 0.2s; }
.btn-lg { padding: 12px 32px; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; border-radius: 8px; }
.btn-primary { background: #4f46e5; border-color: #4f46e5; }
.btn-primary:hover { background: #4338ca; border-color: #4338ca; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.3); }
.btn-success { background: #16a34a; border-color: #16a34a; }
.btn-success:hover { background: #15803d; border-color: #15803d; }

/* ---- Forms ---- */
.form-control, .form-select {
    border-radius: 10px; border: 1.5px solid #e2e8f0;
    padding: 10px 16px; font-size: 0.9rem;
    transition: all 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-label { font-weight: 600; font-size: 0.875rem; color: #374151; }

/* ---- Alerts ---- */
.alert { border: none; border-radius: 12px; font-size: 0.9rem; font-weight: 500; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info { background: #eff6ff; color: #1e40af; }

/* ---- Footer ---- */
footer { font-size: 0.9rem; }
footer a:hover { opacity: 0.8; }

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.card, .stat-card, .alert { animation: fadeInUp 0.4s ease-out; }

/* ---- Search ---- */
.search-bar { max-width: 500px; margin: 0 auto; }

/* ---- Filter Bar ---- */
.filter-bar {
    background: #ffffff; border: 1px solid #e9ecef; border-radius: 14px;
    padding: 16px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.filter-bar .search-wrapper { position: relative; flex: 1; min-width: 200px; }
.filter-bar .search-wrapper .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #adb5bd; font-size: 0.85rem; }
.filter-bar .search-input {
    width: 100%; border: 1.5px solid #dee2e6; border-radius: 10px;
    padding: 8px 14px 8px 36px; font-size: 0.88rem; background: #f8f9fa; transition: all 0.2s;
}
.filter-bar .search-input:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.12); background: #fff; outline: none; }
.filter-bar .form-select { width: auto; min-width: 140px; }

/* ---- Toggle Group ---- */
.toggle-group { display: inline-flex; border: 1.5px solid #dee2e6; border-radius: 10px; overflow: hidden; background: #f8f9fa; }
.toggle-group .toggle-btn { padding: 7px 16px; font-size: 0.82rem; font-weight: 600; border: none; background: transparent; color: #6c757d; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.toggle-group .toggle-btn:not(:last-child) { border-right: 1.5px solid #dee2e6; }
.toggle-group .toggle-btn:hover { color: #4338ca; background: #e9ecef; }
.toggle-group .toggle-btn.active { background: #4f46e5; color: #ffffff; }

/* ---- Book Cover Wrapper ---- */
.book-cover-wrapper { position: relative; overflow: hidden; }
.bid-badge { position: absolute; top: 12px; left: 12px; background: #198754; color: #fff; font-size: 0.78rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; z-index: 5; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.amazon-badge { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; z-index: 5; box-shadow: 0 2px 6px rgba(0,0,0,0.12); font-size: 1rem; color: #ff9900; font-weight: 800; text-decoration: none; }
.not-live-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 4; backdrop-filter: blur(1px); }
.not-live-overlay .overlay-text { background: rgba(0,0,0,0.7); color: #fff; font-size: 0.85rem; font-weight: 600; padding: 6px 18px; border-radius: 8px; }
.review-count-badge { position: absolute; bottom: 12px; left: 12px; background: rgba(0,0,0,0.65); color: #fff; font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: 6px; z-index: 5; }

/* ---- Rating Display ---- */
.rating-display { padding: 10px 16px 14px; text-align: left; }
.rating-display .rating-source { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #adb5bd; margin-bottom: 2px; }
.rating-display .stars { display: inline-flex; align-items: center; gap: 2px; color: #ffc107; font-size: 0.85rem; }
.rating-display .stars .empty { color: #dee2e6; }
.rating-display .rating-count { font-size: 0.75rem; color: #6c757d; margin-left: 6px; font-weight: 500; }
.current-readers { font-size: 0.75rem; color: #6c757d; }

/* ---- Add Book Card ---- */
.add-book-card {
    border: 2px dashed #ced4da; border-radius: 14px; background: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 320px; cursor: pointer; transition: all 0.25s; text-decoration: none; color: #6c757d;
}
.add-book-card:hover { border-color: #4f46e5; background: #f0f0ff; color: #4f46e5; transform: translateY(-2px); }
.add-book-card .add-icon { width: 56px; height: 56px; border-radius: 50%; background: #f0f0ff; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: #4f46e5; margin-bottom: 12px; transition: all 0.25s; }
.add-book-card:hover .add-icon { background: #4f46e5; color: #fff; transform: scale(1.1); }
.add-book-card .add-label { font-size: 0.9rem; font-weight: 600; }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 60px 20px; color: #6c757d; }
.empty-state i { font-size: 3rem; color: #ced4da; margin-bottom: 16px; display: block; }
.empty-state h5 { font-weight: 700; color: #495057; margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; max-width: 400px; margin: 0 auto; }

/* ---- Balance Pill ---- */
.balance-pill { display: inline-flex; align-items: center; gap: 6px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 50px; padding: 6px 16px; font-size: 0.85rem; font-weight: 500; color: #495057; white-space: nowrap; }
.balance-pill .balance-amount { font-weight: 700; color: #198754; }
