/* ============================================
   BookStore Digital — Modern UI & Typography
   Bootstrap 5 loaded via CDN
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

:root {
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --primary-subtle: #e0e7ff;
    --secondary: #0284c7;
    --accent: #f43f5e;
    --accent-light: #fb7185;
    --success: #10b981;
    --warning: #f59e0b;
    --dark: #090d16;
    --dark-2: #0f172a;
    --dark-3: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --radius: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow: 0 4px 10px -2px rgba(15,23,42,0.06), 0 2px 4px -2px rgba(15,23,42,0.04);
    --shadow-md: 0 12px 28px -6px rgba(15,23,42,0.1), 0 8px 10px -6px rgba(15,23,42,0.04);
    --shadow-lg: 0 24px 48px -12px rgba(15,23,42,0.15);
    --shadow-xl: 0 32px 64px -16px rgba(15,23,42,0.2);
    --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Global Typography & Reset ---------- */
* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--gray-50);
    color: #1e293b;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 0.95rem;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.025em;
    line-height: 1.25;
}

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

.btn {
    font-family: var(--font-body);
    border-radius: var(--radius-xs);
    font-weight: 600;
    padding: 0.55rem 1.35rem;
    transition: var(--transition);
    font-size: 0.88rem;
    letter-spacing: -0.01em;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #3730a3);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #e11d48);
    border: none;
    color: #fff;
}
.btn-accent:hover {
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #fff;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.form-control, .form-select {
    border-radius: var(--radius-xs);
    border: 2px solid var(--gray-200);
    padding: 0.6rem 1rem;
    transition: var(--transition);
    font-size: 0.9rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

/* ---------- Navbar ---------- */
.navbar {
    background: rgba(255,255,255,0.85) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--dark) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.navbar .nav-link {
    font-weight: 500;
    color: var(--gray-600) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
}
.navbar .nav-link:hover { color: var(--primary) !important; background: var(--gray-100); }

.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    font-size: 0.6rem;
    padding: 2px 6px;
    background: var(--accent) !important;
    border-radius: 50px;
}

.search-box {
    position: relative;
    max-width: 360px;
    width: 100%;
}
.search-box .form-control {
    padding-left: 2.5rem;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: 50px;
}
.search-box .form-control:focus {
    background: #fff;
    border-color: var(--primary-light);
}
.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 5;
}

/* ---------- Gradient Themes for Ads & Banners ---------- */
.gradient-indigo {
    background: linear-gradient(135deg, #090d16 0%, #1e1b4b 50%, #3730a3 100%) !important;
}
.gradient-midnight {
    background: linear-gradient(135deg, #030712 0%, #0f172a 50%, #1e293b 100%) !important;
}
.gradient-sunset {
    background: linear-gradient(135deg, #450a0a 0%, #881337 50%, #be123c 100%) !important;
}
.gradient-emerald {
    background: linear-gradient(135deg, #022c22 0%, #064e3b 50%, #047857 100%) !important;
}
.gradient-rose {
    background: linear-gradient(135deg, #4c0519 0%, #831843 50%, #db2777 100%) !important;
}
.gradient-cyber {
    background: linear-gradient(135deg, #180828 0%, #3b0764 50%, #701a75 100%) !important;
}

/* ---------- Hero Section & Dynamic Ads Carousel ---------- */
.hero-wrapper {
    position: relative;
    background: var(--dark);
    color: #fff;
    overflow: hidden;
}

.hero-slide {
    padding: 90px 0 85px;
    position: relative;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    align-items: center;
}

.hero-slide::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(99,102,241,0.28) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-slide::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(244,63,94,0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-slide .container {
    position: relative;
    z-index: 2;
}

.hero-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 0.45rem 1.15rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.hero-slide h1 {
    font-size: 3.4rem;
    font-weight: 900;
    line-height: 1.12;
    margin-bottom: 1.35rem;
    color: #fff;
    letter-spacing: -0.035em;
}

.hero-slide p.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 540px;
    line-height: 1.7;
    margin-bottom: 2rem;
    font-weight: 400;
}

.hero-cta-btn {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-artwork-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: perspective(1000px) rotateY(-5deg) rotateX(3deg);
    transition: transform 0.4s ease;
}

.hero-artwork-card:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.hero-artwork-card img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 340px;
    width: 100%;
    object-fit: cover;
}

.carousel-indicators-modern {
    bottom: 20px !important;
    gap: 8px;
    z-index: 5;
}

.carousel-indicators-modern button {
    width: 32px !important;
    height: 6px !important;
    border-radius: 4px !important;
    background-color: rgba(255, 255, 255, 0.35) !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

.carousel-indicators-modern button.active {
    width: 50px !important;
    background-color: #fff !important;
    box-shadow: 0 0 12px rgba(255,255,255,0.8);
}

.carousel-control-prev-custom, .carousel-control-next-custom {
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    transition: var(--transition);
}

.carousel-control-prev-custom { left: 24px; }
.carousel-control-next-custom { right: 24px; }

.carousel-control-prev-custom:hover, .carousel-control-next-custom:hover {
    background: #fff;
    color: var(--dark);
    box-shadow: var(--shadow-lg);
}

/* ---------- Middle Promotional Banner ---------- */
.promo-banner-card {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    color: #fff;
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
}

.promo-banner-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.promo-banner-card h3 {
    color: #fff;
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.promo-banner-card p {
    color: rgba(255,255,255,0.88);
    font-size: 1.05rem;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

/* ---------- Sidebar Ad Banner ---------- */
.sidebar-ad-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    color: #fff;
    padding: 24px 20px;
    position: relative;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.sidebar-ad-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.sidebar-ad-card h5 {
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.sidebar-ad-card p {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

/* ---------- Section ---------- */
.section { padding: 70px 0; }
.section-dark { background: var(--dark); color: #fff; }

.section-heading {
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.section-subheading {
    color: var(--gray-500);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

/* ---------- Book Cards ---------- */
.book-card {
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    position: relative;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.book-card .card-img-wrapper {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    aspect-ratio: 3 / 4;
    width: 100%;
    max-height: 280px;
}

.book-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-card:hover .card-img-wrapper img { transform: scale(1.05); }

.book-card .card-body {
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-card .book-title {
    font-weight: 700;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--dark);
    margin-bottom: 0.25rem;
    line-height: 1.35;
    word-break: break-word;
}

.book-card .book-author {
    color: var(--gray-500);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-card .book-format {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--primary);
    background: rgba(99,102,241,0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

.book-card .book-price {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.1rem;
    line-height: 1.2;
}

.book-card .book-price .original-price {
    text-decoration: line-through;
    color: var(--gray-400);
    font-size: 0.82rem;
    font-weight: 400;
    margin-left: 4px;
}

.book-card .discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent);
    color: #fff;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    z-index: 2;
    max-width: 48%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.book-card .instant-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 48%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ---------- Category Cards ---------- */
.category-card {
    background: #fff;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: var(--transition);
}

.category-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.category-card:hover::before { opacity: 1; }

.category-card .cat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(244,63,94,0.1));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 1.25rem;
    color: var(--primary);
    flex-shrink: 0;
}

.category-card h6 {
    margin: 0;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--dark);
    word-break: break-word;
}

/* ---------- Book Detail ---------- */
.book-detail-img {
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius);
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.detail-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
}
.detail-meta .meta-item i { color: var(--primary); }

.review-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 15px;
    transition: var(--transition);
}
.review-card:hover { box-shadow: var(--shadow); }

/* ---------- Cart ---------- */
.cart-item img {
    width: 70px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-xs);
}

/* ---------- Auth Pages ---------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-100), #e0e7ff);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    background: #fff;
}

.auth-card .card-header {
    background: linear-gradient(135deg, var(--dark), #1e1b4b);
    color: #fff;
    text-align: center;
    padding: 2.5rem 2rem;
    border: none;
}

.auth-card .card-header h4 {
    margin: 0;
    font-weight: 800;
    font-size: 1.5rem;
}

.auth-card .card-header p {
    margin: 0.5rem 0 0;
    opacity: 0.7;
    font-size: 0.9rem;
}

.auth-card .card-body { padding: 2rem; }

/* ---------- Payment Section ---------- */
.payment-method-card {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.payment-method-card:hover, .payment-method-card.selected {
    border-color: var(--primary);
    background: rgba(99,102,241,0.03);
}

.payment-method-card .method-icon {
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary);
}

.payment-info-box {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: var(--radius-sm);
    padding: 20px;
}

.payment-info-box h6 { color: #92400e; font-weight: 700; }
.payment-info-box .info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
    border-bottom: 1px dashed rgba(146,64,14,0.2);
}
.payment-info-box .info-row:last-child { border-bottom: none; }
.payment-info-box .info-label { color: #92400e; font-weight: 500; }
.payment-info-box .info-value { color: #78350f; font-weight: 700; }

/* ---------- Dashboard Sidebar ---------- */
.dashboard-sidebar {
    background: linear-gradient(180deg, var(--dark), var(--dark-2));
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    z-index: 1000;
    padding-top: 0;
    transition: var(--transition);
    border-right: 1px solid rgba(255,255,255,0.05);
}

.dashboard-sidebar .sidebar-brand {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dashboard-sidebar .sidebar-brand h5 {
    color: #fff;
    margin: 0;
    font-weight: 800;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-sidebar .sidebar-brand .brand-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
}

.dashboard-sidebar .sidebar-brand small {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 500;
}

.dashboard-sidebar .sidebar-section {
    padding: 0.75rem 1.25rem 0.5rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
    font-weight: 600;
}

.dashboard-sidebar .nav-link {
    color: var(--gray-400);
    padding: 10px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.04);
}

.dashboard-sidebar .nav-link.active {
    color: #fff;
    background: rgba(99,102,241,0.15);
    border-left-color: var(--primary);
}

.dashboard-sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.7;
}

.dashboard-sidebar .nav-link.active i { opacity: 1; color: var(--primary-light); }

/* ---------- Dashboard Content ---------- */
.dashboard-content {
    margin-left: 260px;
    min-height: 100vh;
    background: var(--gray-50);
}

.dashboard-topbar {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    padding: 16px 30px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-topbar h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--dark);
}

.dashboard-body { padding: 30px; }

/* ---------- Stat Cards ---------- */
.stat-card {
    border: none;
    border-radius: var(--radius);
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.15;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    opacity: 0.85;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.stat-card h3 {
    font-weight: 800;
    margin-bottom: 0;
    font-size: 1.75rem;
}

.stat-card.bg-gradient-primary { background: linear-gradient(135deg, #6366f1, #4338ca); }
.stat-card.bg-gradient-success { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card.bg-gradient-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card.bg-gradient-danger  { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.stat-card.bg-gradient-info    { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.stat-card.bg-gradient-purple  { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

/* ---------- Tables ---------- */
.table-card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    background: #fff;
}

.table-card .card-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
    font-weight: 700;
    font-size: 1rem;
}

.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
    padding: 12px 16px;
}

.table tbody td {
    padding: 12px 16px;
    font-size: 0.875rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 60px 0 30px;
    margin-top: 0;
}

.site-footer h5 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

.site-footer a {
    color: var(--gray-400);
    transition: var(--transition);
    font-size: 0.9rem;
}
.site-footer a:hover { color: #fff; padding-left: 4px; }

.site-footer .footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.site-footer .footer-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 1.5rem;
    margin-top: 2.5rem;
}

/* ---------- Download Button ---------- */
.btn-download {
    background: linear-gradient(135deg, var(--success), #047857);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-download:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    color: #fff;
}

/* ---------- Order Status Steps ---------- */
.order-status-steps {
    display: flex;
    gap: 0;
    margin: 1rem 0;
}

.order-status-steps .step {
    flex: 1;
    text-align: center;
    position: relative;
    padding-top: 30px;
}

.order-status-steps .step::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gray-200);
}

.order-status-steps .step:first-child::before { left: 50%; }
.order-status-steps .step:last-child::before { right: 50%; }

.order-status-steps .step .dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-200);
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #fff;
}

.order-status-steps .step.active::before { background: var(--primary); }
.order-status-steps .step.active .dot { background: var(--primary); }

.order-status-steps .step .step-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-400);
    margin-top: 4px;
}
.order-status-steps .step.active .step-label { color: var(--primary); }

/* ---------- Utilities ---------- */
.glass {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state .empty-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--gray-400);
}

/* ---------- Responsive & Mobile Navigation ---------- */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 13, 22, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    width: 100%;
}

.table-responsive .table {
    min-width: 650px;
}

.table-responsive-sm .table {
    min-width: 480px;
}

/* Breakpoint: Desktop / Laptop Optimization (max-width: 1199px) */
@media (max-width: 1199px) {
    .hero-slide h1 { font-size: 2.8rem; }
    .hero-slide p.hero-subtitle { font-size: 1.05rem; }
}

/* Breakpoint: Tablet & Mobile Navbar Collapse (max-width: 991px) */
@media (max-width: 991px) {
    .hero-slide { padding: 50px 0 45px; min-height: auto; }
    .hero-slide h1 { font-size: 2.2rem; }
    .hero-slide p.hero-subtitle { font-size: 1rem; max-width: 100%; margin-bottom: 1.5rem; }
    .hero-features { flex-wrap: wrap; gap: 1rem; }

    .search-box {
        max-width: 100%;
        margin: 0.75rem 0 !important;
    }

    .navbar-nav {
        padding: 0.5rem 0;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        padding: 0.6rem 0.75rem !important;
    }

    .navbar-nav .btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    .promo-banner-card { padding: 36px 28px; }
    .promo-banner-card h3 { font-size: 1.75rem; }
}

/* Breakpoint: Mobile & Tablet Dashboard Sidebar Drawer (max-width: 768px) */
@media (max-width: 768px) {
    .hero-slide h1 { font-size: 1.85rem; }
    .hero-slide p { font-size: 0.95rem; }
    .section { padding: 40px 0; }

    .dashboard-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 270px;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }

    .dashboard-sidebar.show {
        transform: translateX(0);
    }

    .dashboard-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .dashboard-topbar {
        padding: 12px 18px;
    }

    .dashboard-body {
        padding: 18px 14px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card h3 {
        font-size: 1.4rem;
    }

    .book-card .card-body { padding: 0.9rem; }
    .book-card .book-title { font-size: 0.88rem; line-height: 1.35; }
    .book-card .book-author { font-size: 0.78rem; }
    .book-card .book-price { font-size: 1rem; }
    .book-card .book-price .original-price { font-size: 0.78rem; }

    .book-card .discount-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
        top: 8px;
        left: 8px;
        max-width: 48%;
    }

    .book-card .instant-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
        top: 8px;
        right: 8px;
        max-width: 48%;
    }

    .category-card { padding: 18px 12px; }
    .category-card .cat-icon { width: 44px; height: 44px; font-size: 1.15rem; margin-bottom: 8px; }
    .category-card h6 { font-size: 0.82rem; }

    .detail-meta { gap: 0.5rem; }
    .order-status-steps .step .step-label { font-size: 0.6rem; }

    .navbar-brand { font-size: 1.2rem; }
    .carousel-control-prev-custom { left: 8px; width: 36px; height: 36px; }
    .carousel-control-next-custom { right: 8px; width: 36px; height: 36px; }
}

/* Breakpoint: Small Mobile Devices (max-width: 576px) */
@media (max-width: 576px) {
    .hero-slide h1 { font-size: 1.6rem; line-height: 1.2; }
    .hero-badge-pill { font-size: 0.75rem; padding: 0.35rem 0.85rem; margin-bottom: 1rem; }
    .hero-cta-btn { width: 100%; justify-content: center; }

    .stat-card h3 { font-size: 1.25rem; }
    .auth-wrapper { padding: 1rem; }
    .auth-card { margin: 0; width: 100%; max-width: 100%; }
    .auth-card .card-header { padding: 1.75rem 1.25rem; }
    .auth-card .card-body { padding: 1.5rem 1.25rem; }

    .payment-method-card { padding: 14px; }
    .promo-banner-card { padding: 24px 18px; }
    .promo-banner-card h3 { font-size: 1.4rem; }
    .promo-banner-card p { font-size: 0.9rem; }

    .book-card .card-body { padding: 0.75rem; }
    .book-card .book-title { font-size: 0.85rem; margin-bottom: 0.15rem; }
    .book-card .book-author { font-size: 0.75rem; margin-bottom: 0.35rem !important; }
    .book-card .book-price { font-size: 0.95rem; }
    .book-card .book-price .original-price { font-size: 0.75rem; }

    .book-card .discount-badge, .book-card .instant-badge {
        font-size: 0.6rem;
        padding: 3px 6px;
        top: 6px;
    }
    .book-card .discount-badge { left: 6px; }
    .book-card .instant-badge { right: 6px; }

    .category-card { padding: 14px 8px; }
    .category-card .cat-icon { width: 38px; height: 38px; font-size: 1rem; margin-bottom: 6px; }
    .category-card h6 { font-size: 0.78rem; }
}

/* Breakpoint: Extra Small Mobile Devices (max-width: 400px) */
@media (max-width: 400px) {
    .g-4, .gy-4 { --bs-gutter-y: 0.85rem; }
    .g-4, .gx-4 { --bs-gutter-x: 0.5rem; }

    .book-card .card-body { padding: 0.65rem 0.55rem; }
    .book-card .book-title { font-size: 0.8rem; -webkit-line-clamp: 2; }
    .book-card .book-author { font-size: 0.72rem; }
    .book-card .book-price { font-size: 0.88rem; }
    .book-card .book-price .original-price { font-size: 0.72rem; display: block; margin-left: 0; }
    .book-card .btn-sm { padding: 0.2rem 0.5rem; font-size: 0.72rem; }

    .book-card .discount-badge, .book-card .instant-badge {
        font-size: 0.55rem;
        padding: 2px 5px;
        border-radius: 4px;
    }

    .category-card { padding: 12px 6px; }
    .category-card .cat-icon { width: 34px; height: 34px; font-size: 0.9rem; margin-bottom: 4px; }
    .category-card h6 { font-size: 0.74rem; }
}

