/* ============================================================
   BookWin — Main Stylesheet
   ============================================================ */

:root {
    --bw-primary:   #667eea;
    --bw-secondary: #764ba2;
    --bw-gradient:  linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bw-dark:      #1a1d2e;
    --bw-text:      #3d4350;
    --bw-muted:     #9096b0;
    --bw-border:    #eef0f7;
    --bw-card-bg:   #ffffff;
    --bw-bg:        #f4f6fc;
}

/* ── Base ─────────────────────────────────────────────────── */
* { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--bw-text);
    line-height: 1.6;
}
a { color: var(--bw-primary); transition: color 0.2s; }

/* ── Utility ──────────────────────────────────────────────── */
.text-gradient {
    background: var(--bw-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.bg-gradient-primary { background: var(--bw-gradient) !important; }
.rounded-4  { border-radius: 16px !important; }
.rounded-5  { border-radius: 24px !important; }
.shadow-soft { box-shadow: 0 4px 20px rgba(0,0,0,0.07) !important; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
    background: var(--bw-gradient);
    border: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.35);
    background: var(--bw-gradient);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline-primary {
    border-color: var(--bw-primary);
    color: var(--bw-primary);
}
.btn-outline-primary:hover {
    background: var(--bw-gradient);
    border-color: transparent;
    color: #fff;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    transition: all 0.3s;
}
.navbar-brand { font-size: 1.4rem; font-weight: 700; }
.nav-link { font-weight: 500; color: var(--bw-text) !important; padding: 8px 14px !important; border-radius: 8px; }
.nav-link:hover { color: var(--bw-primary) !important; background: rgba(102,126,234,0.08); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--bw-border);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.08); }

/* ── Book Card ────────────────────────────────────────────── */
.book-card .card-img-top {
    height: 220px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}
.book-card .badge-category {
    position: absolute;
    top: 12px; left: 12px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
}
.book-card .reward-badge {
    position: absolute;
    top: 12px; right: 12px;
    background: var(--bw-gradient);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

/* ── Progress Bar ─────────────────────────────────────────── */
.stock-progress .progress {
    height: 10px;
    border-radius: 20px;
    background: #eef0f7;
}
.stock-progress .progress-bar {
    background: var(--bw-gradient);
    border-radius: 20px;
}
.stock-progress.urgent .progress-bar { background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* ── Hero Section ─────────────────────────────────────────── */
.hero-section {
    background: var(--bw-gradient);
    min-height: 85vh;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -200px; right: -200px;
}
.hero-section::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    bottom: -100px; left: -100px;
}

/* ── Active Book Widget ───────────────────────────────────── */
.active-book-widget {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 24px;
    padding: 28px;
    color: #fff;
}
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
}
.live-dot {
    width: 8px; height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.3); }
}

/* ── Winner Card ──────────────────────────────────────────── */
.winner-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border: none;
    border-radius: 20px;
    overflow: hidden;
}
.winner-card .avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.8);
    object-fit: cover;
}
.winner-card .trophy { color: #f59e0b; font-size: 2rem; }

/* ── Referral Section ─────────────────────────────────────── */
.referral-level-card {
    border: 2px solid var(--bw-border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}
.referral-level-card:hover {
    border-color: var(--bw-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102,126,234,0.15);
}
.level-badge {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--bw-gradient);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

/* ── Wallet Cards ─────────────────────────────────────────── */
.wallet-card {
    border-radius: 20px;
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.wallet-card::after {
    content: '';
    position: absolute;
    width: 150px; height: 150px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    right: -30px; bottom: -30px;
}
.wallet-card .icon { font-size: 2rem; opacity: 0.8; }
.wallet-card .amount { font-size: 1.75rem; font-weight: 700; }
.wallet-card .label  { font-size: 12px; opacity: 0.8; }

/* ── OTP Boxes ────────────────────────────────────────────── */
.otp-box:focus {
    border-color: var(--bw-primary) !important;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.2) !important;
    background: #fafbff;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-label { font-weight: 500; color: var(--bw-text); }
.form-control:focus, .form-select:focus {
    border-color: var(--bw-primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.12);
}
.form-control.rounded-4, .form-select.rounded-4 { border-radius: 12px !important; }

/* ── Tables ───────────────────────────────────────────────── */
.table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--bw-muted);
    border-bottom-width: 1px;
}
.table td { vertical-align: middle; font-size: 0.875rem; }

/* ── Badges ───────────────────────────────────────────────── */
.badge-paid    { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-failed  { background: #fee2e2; color: #991b1b; }
.badge-active  { background: #dbeafe; color: #1e40af; }

/* ── Steps (How It Works) ─────────────────────────────────── */
.step-item { position: relative; text-align: center; }
.step-icon {
    width: 72px; height: 72px;
    border-radius: 20px;
    background: var(--bw-gradient);
    color: #fff;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    position: relative;
    z-index: 1;
}
.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 36px;
    left: 60%;
    width: 80%;
    height: 2px;
    background: var(--bw-border);
    z-index: 0;
}

/* ── Toasts ───────────────────────────────────────────────── */
.toast-container { z-index: 9999; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 575px) {
    .hero-section { min-height: auto; padding: 60px 0; }
    .active-book-widget { padding: 20px; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
    .navbar, .sidebar, .topbar, .btn { display: none !important; }
    .main-content { margin-left: 0 !important; }
}

/* ── Footer Links ─────────────────────────────────────────── */
footer .hover-link {
    transition: all 0.2s ease;
}
footer .hover-link:hover {
    color: #fff !important;
    transform: translateX(4px);
}
