/* ============================================================
   BookReverb - Modern Clean Design
   Primary: #198754 / #1a6b4a  |  Font: Inter
   ============================================================ */

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

/* ---- Base ---- */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    color: #1e293b;
}
body::before {
    content: '';
    display: block;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #1a6b4a 0%, #198754 40%, #20c073 100%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
}
.container.mt-4 { flex: 1; }

/* ---- Navbar ---- */
.navbar {
    background: #ffffff !important;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    margin-top: 4px;
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    color: #1a6b4a !important;
}
.navbar-brand img {
    height: 32px;
    margin-right: 8px;
}
.nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 16px !important;
    border-radius: 8px;
    color: #495057 !important;
    transition: all 0.2s;
}
.nav-link:hover {
    background: #f0fdf4;
    color: #1a6b4a !important;
}
.nav-link.active {
    color: #198754 !important;
    font-weight: 600;
}
.dropdown-menu {
    border: 1px solid #e9ecef;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 8px;
    margin-top: 8px;
}
.dropdown-item {
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: #495057;
}
.dropdown-item:hover {
    background: #f0fdf4;
    color: #1a6b4a;
}
.dropdown-item i,
.dropdown-item .fa,
.dropdown-item .fas,
.dropdown-item .far,
.dropdown-item .bi {
    width: 20px;
    margin-right: 8px;
    color: #6c757d;
}

/* ---- 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;
}
.balance-pill i,
.balance-pill .fa,
.balance-pill .bi {
    color: #198754;
    font-size: 0.9rem;
}

/* ---- Promo Banner ---- */
.promo-banner {
    background: linear-gradient(90deg, #198754 0%, #1a6b4a 100%);
    color: #ffffff;
    text-align: center;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 500;
}
.promo-banner a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 700;
}
.promo-banner .btn-close {
    filter: brightness(0) invert(1);
}

/* ---- Hero (Landing Page) ---- */
.hero {
    background: linear-gradient(135deg, #0a3d2a 0%, #1a6b4a 50%, #198754 100%);
    color: white;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 25% 50%, rgba(25, 135, 84, 0.25) 0%, transparent 50%),
                radial-gradient(circle at 75% 50%, rgba(32, 192, 115, 0.15) 0%, transparent 50%);
    animation: drift 20s ease-in-out infinite;
}
@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-10px, -15px); }
}
.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    position: relative;
    letter-spacing: -1px;
    line-height: 1.1;
}
.hero .lead {
    font-size: 1.25rem;
    opacity: 0.9;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

/* ---- Cards (General) ---- */
.card {
    border: 1px solid #e9ecef;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    background: #ffffff;
}
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* ---- Stat Cards ---- */
.stat-card {
    border: 1px solid #e9ecef;
    border-radius: 14px;
    padding: 24px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    text-align: left;
    position: relative;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.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;
}
.stat-card .stat-change {
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 6px;
}
.stat-card .stat-change.positive {
    color: #198754;
}
.stat-card .stat-change.negative {
    color: #dc3545;
}

/* ---- Filter Bar ---- */
.filter-bar {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-bar .search-input {
    flex: 1;
    min-width: 200px;
    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: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.12);
    background: #ffffff;
    outline: none;
}
.filter-bar .search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.filter-bar .search-wrapper i,
.filter-bar .search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 0.85rem;
}
.filter-bar .form-select {
    width: auto;
    min-width: 140px;
    border: 1.5px solid #dee2e6;
    border-radius: 10px;
    padding: 8px 32px 8px 14px;
    font-size: 0.88rem;
    background-color: #f8f9fa;
    color: #495057;
}
.filter-bar .form-select:focus {
    border-color: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.12);
}

/* ---- Toggle Button Group (Time Ranges) ---- */
.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: #1a6b4a;
    background: #e9ecef;
}
.toggle-group .toggle-btn.active {
    background: #198754;
    color: #ffffff;
}

/* ---- Book Cards ---- */
.book-card {
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}
.book-card .book-cover-wrapper {
    position: relative;
    overflow: hidden;
}
.book-card .card-img-top,
.book-card .book-cover {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}
.book-card:hover .card-img-top,
.book-card:hover .book-cover {
    transform: scale(1.05);
}
.book-cover-placeholder {
    height: 260px;
    background: linear-gradient(135deg, #1a6b4a 0%, #198754 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3.5rem;
}
.book-card .card-body {
    padding: 14px 16px;
}
.book-card .book-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.book-card .book-author {
    font-size: 0.8rem;
    color: #6c757d;
}

/* ---- Bid Badge (top-left on cover) ---- */
.bid-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #198754;
    color: #ffffff;
    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 (top-right on cover) ---- */
.amazon-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: #ffffff;
    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;
}
.amazon-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.amazon-badge img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* ---- Not Live Overlay ---- */
.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 span,
.not-live-overlay .overlay-text {
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

/* ---- Review Count Badge (bottom of cover) ---- */
.review-count-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    z-index: 5;
    backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.review-count-badge i,
.review-count-badge .fa,
.review-count-badge .bi {
    font-size: 0.7rem;
}

/* ---- 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;
}
.rating-display .current-readers,
.current-readers {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
}
.current-readers strong {
    color: #495057;
}

/* ---- Add Book Card ---- */
.add-book-card {
    border: 2px dashed #ced4da;
    border-radius: 14px;
    background: #ffffff;
    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: #198754;
    background: #f0fdf4;
    color: #198754;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.08);
}
.add-book-card .add-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f0fdf4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #198754;
    margin-bottom: 12px;
    transition: all 0.25s;
}
.add-book-card:hover .add-icon {
    background: #198754;
    color: #ffffff;
    transform: scale(1.1);
}
.add-book-card .add-label {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ---- Badges ---- */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 6px;
}
.badge-live {
    background: #198754;
    color: #ffffff;
}
.badge-draft {
    background: #6c757d;
    color: #ffffff;
}
.badge-paused {
    background: #fd7e14;
    color: #ffffff;
}
.genre-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #f0fdf4;
    color: #1a6b4a;
}

/* ---- Pricing / Bid Info ---- */
.bid-info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px;
}

/* ---- Steps (Landing Page) ---- */
.step-number {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1a6b4a, #198754);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}
.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 16px;
    background: #f0fdf4;
    color: #198754;
}

/* ---- Buttons ---- */
.btn {
    font-weight: 600;
    border-radius: 10px;
    padding: 8px 20px;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-lg {
    padding: 14px 36px;
    font-size: 1rem;
    border-radius: 12px;
}
.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
}
.btn-primary {
    background: #198754;
    border-color: #198754;
}
.btn-primary:hover {
    background: #157347;
    border-color: #157347;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}
.btn-primary:active,
.btn-primary:focus {
    background: #146c43;
    border-color: #146c43;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.25);
}
.btn-success {
    background: #198754;
    border-color: #198754;
}
.btn-success:hover {
    background: #157347;
    border-color: #157347;
}
.btn-outline-primary {
    color: #198754;
    border-color: #198754;
}
.btn-outline-primary:hover {
    background: #198754;
    border-color: #198754;
    color: #ffffff;
    transform: translateY(-1px);
}
.btn-outline-success {
    color: #198754;
    border-color: #198754;
}
.btn-outline-success:hover {
    background: #198754;
    color: #ffffff;
}
.btn-outline-light:hover {
    transform: translateY(-1px);
}
.btn-link {
    color: #198754;
    text-decoration: none;
    font-weight: 600;
}
.btn-link:hover {
    color: #1a6b4a;
    text-decoration: underline;
}

/* ---- Forms ---- */
.form-control,
.form-select {
    border-radius: 10px;
    border: 1.5px solid #dee2e6;
    padding: 10px 16px;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: #ffffff;
}
.form-control:focus,
.form-select:focus {
    border-color: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.12);
}
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}
.form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15);
    border-color: #198754;
}

/* ---- Tables ---- */
.table {
    font-size: 0.9rem;
}
.table th {
    font-weight: 600;
    font-size: 0.78rem;
    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: #f8faf9;
}

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

/* ---- Pagination ---- */
.page-link {
    color: #198754;
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    font-size: 0.88rem;
    font-weight: 500;
}
.page-link:hover {
    background: #f0fdf4;
    color: #1a6b4a;
    border-color: #198754;
}
.page-item.active .page-link {
    background: #198754;
    border-color: #198754;
}

/* ---- Modals ---- */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 20px 24px;
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 16px 24px;
}

/* ---- Misc Components ---- */
.text-primary {
    color: #198754 !important;
}
a {
    color: #198754;
}
a:hover {
    color: #1a6b4a;
}
.bg-primary {
    background-color: #198754 !important;
}
.border-primary {
    border-color: #198754 !important;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
    background: transparent;
    padding: 0;
    margin-bottom: 16px;
}
.breadcrumb-item a {
    color: #198754;
    text-decoration: none;
}
.breadcrumb-item.active {
    color: #6c757d;
}

/* Progress bar */
.progress {
    border-radius: 8px;
    height: 8px;
    background: #e9ecef;
}
.progress-bar {
    background: #198754;
    border-radius: 8px;
}

/* Tooltip / Popover */
.tooltip-inner {
    background: #1e293b;
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 6px 12px;
}

/* Scrollbar (WebKit) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* ---- Section Headers ---- */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}
.section-subtitle {
    font-size: 0.88rem;
    color: #6c757d;
    margin-top: -14px;
    margin-bottom: 20px;
}

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

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.card,
.stat-card,
.book-card,
.filter-bar {
    animation: fadeInUp 0.35s ease-out;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar .search-wrapper {
        width: 100%;
    }
    .filter-bar .form-select {
        width: 100%;
    }
    .toggle-group {
        align-self: stretch;
    }
    .toggle-group .toggle-btn {
        flex: 1;
        text-align: center;
    }
    .balance-pill {
        margin-top: 8px;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 575.98px) {
    .stat-card {
        padding: 18px;
    }
    .stat-card .stat-number {
        font-size: 1.8rem;
    }
    .stat-card .stat-icon {
        font-size: 1.5rem;
        right: 18px;
    }
    .book-card .card-img-top,
    .book-card .book-cover {
        height: 200px;
    }
    .add-book-card {
        min-height: 240px;
    }
}
