/* LIBROO - Digital Library CSS */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #FFFACD;
  --gold: #FFD700;
  --gold-dark: #e6c200;
  --text: #1a1a1a;
  --text-light: #555;
  --card-bg: #ffffff;
  --border: #e8e0b0;
  --nav-bg: #ffffff;
  --premium: #ff6b35;
  --trending: #e74c3c;
  --success: #27ae60;
  --danger: #e74c3c;
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
  --radius: 12px;
}

body.dark {
  --bg: #1a1a1a;
  --text: #f0f0f0;
  --text-light: #aaa;
  --card-bg: #2a2a2a;
  --border: #3a3a3a;
  --nav-bg: #111;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
}

body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); transition: all 0.3s; min-height: 100vh; }

/* NAVBAR */
nav {
  background: var(--nav-bg);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 1000;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo { width: 40px; height: 40px; background: var(--gold); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; color: #1a1a1a; }
.nav-title { font-size: 22px; font-weight: 800; color: var(--text); }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-light); padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; transition: all 0.2s; display: flex; align-items: center; gap: 6px; }
.nav-links a:hover, .nav-links a.active { background: #FFF8DC; color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 18px; padding: 8px; border-radius: 8px; color: var(--text); transition: background 0.2s; }
.btn-icon:hover { background: var(--border); }
.btn-login { text-decoration: none; padding: 8px 18px; border-radius: 8px; border: 2px solid var(--gold); color: var(--text); font-weight: 600; font-size: 14px; transition: all 0.2s; }
.btn-login:hover { background: var(--gold); }
.btn-signup { text-decoration: none; padding: 8px 18px; border-radius: 8px; background: var(--gold); color: #1a1a1a; font-weight: 700; font-size: 14px; transition: all 0.2s; }
.btn-signup:hover { background: var(--gold-dark); }
.lang-btn { background: #f0f0f0; border: none; padding: 6px 14px; border-radius: 20px; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--text); }

/* HAMBURGER */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; }
.hamburger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; display: block; }

/* MOBILE NAV */
.mobile-nav { display: none; position: fixed; top: 64px; left: 0; right: 0; background: var(--nav-bg); box-shadow: var(--shadow); z-index: 999; padding: 16px; flex-direction: column; gap: 4px; }
.mobile-nav.open { display: flex; }
.mobile-nav a { text-decoration: none; color: var(--text); padding: 12px 16px; border-radius: 8px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.mobile-nav a:hover { background: #FFF8DC; }

/* HERO */
.hero { background: linear-gradient(135deg, #FFFACD 0%, #FFF8DC 50%, #FFE87C 100%); padding: 80px 24px 60px; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,215,0,0.3); border: 1px solid var(--gold); border-radius: 20px; padding: 6px 16px; font-size: 13px; font-weight: 600; margin-bottom: 24px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; margin-bottom: 16px; line-height: 1.1; }
.hero p { font-size: 18px; color: var(--text-light); margin-bottom: 32px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary { background: var(--gold); color: #1a1a1a; padding: 14px 28px; border-radius: 30px; text-decoration: none; font-weight: 700; font-size: 16px; border: none; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary:hover { background: var(--gold-dark); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--text); padding: 14px 28px; border-radius: 30px; text-decoration: none; font-weight: 700; font-size: 16px; border: 2px solid var(--text); cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.btn-outline:hover { background: var(--text); color: var(--bg); }

/* CATEGORIES */
.categories { padding: 48px 24px; }
.section-title { font-size: 24px; font-weight: 800; margin-bottom: 24px; }
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.cat-card { background: var(--card-bg); border-radius: var(--radius); padding: 28px 16px; text-align: center; text-decoration: none; color: var(--text); box-shadow: var(--shadow); border: 2px solid var(--border); transition: all 0.2s; cursor: pointer; }
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); border-color: var(--gold); }
.cat-icon { font-size: 36px; margin-bottom: 12px; display: block; }
.cat-label { font-weight: 700; font-size: 15px; }

/* CONTENT GRID */
.content-section { padding: 32px 24px; }
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.content-card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); transition: all 0.2s; cursor: pointer; position: relative; }
.content-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.card-thumb { width: 100%; height: 160px; object-fit: cover; background: linear-gradient(135deg, #e0d48a, #ffe87c); display: flex; align-items: center; justify-content: center; font-size: 48px; position: relative; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-placeholder { font-size: 48px; }
.card-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.badge { padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-premium { background: var(--premium); color: white; }
.badge-trending { background: var(--trending); color: white; }
.badge-free { background: var(--success); color: white; }
.card-lock { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 32px; background: rgba(0,0,0,0.5); border-radius: 50%; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.card-body { padding: 14px; }
.card-title { font-weight: 700; font-size: 14px; line-height: 1.3; margin-bottom: 6px; }
.card-meta { font-size: 12px; color: var(--text-light); display: flex; justify-content: space-between; }
.card-actions { padding: 0 14px 14px; display: flex; gap: 8px; }
.btn-sm { padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.btn-gold { background: var(--gold); color: #1a1a1a; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }

/* PAGE HEADER */
.page-header { background: linear-gradient(135deg, #FFFACD, #FFF8DC); padding: 48px 24px 32px; }
.page-header h1 { font-size: 2.2rem; font-weight: 900; margin-bottom: 8px; }
.page-header p { color: var(--text-light); font-size: 16px; }

/* SEARCH BAR */
.search-bar { padding: 20px 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 200px; padding: 12px 16px; border: 2px solid var(--border); border-radius: 30px; font-size: 15px; background: var(--card-bg); color: var(--text); outline: none; }
.search-input:focus { border-color: var(--gold); }
.filter-select { padding: 12px 16px; border: 2px solid var(--border); border-radius: 30px; font-size: 14px; background: var(--card-bg); color: var(--text); outline: none; cursor: pointer; }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--card-bg); border-radius: 16px; padding: 32px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: modalIn 0.3s ease; }
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-title { font-size: 20px; font-weight: 800; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-light); }
.modal-close:hover { color: var(--text); }

/* FORMS */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-control { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: 10px; font-size: 15px; background: var(--card-bg); color: var(--text); outline: none; transition: border-color 0.2s; }
.form-control:focus { border-color: var(--gold); }
.form-control select { background: var(--card-bg); }

/* STATS CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; padding: 24px; }
.stat-card { background: var(--card-bg); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); border: 1px solid var(--border); text-align: center; }
.stat-num { font-size: 2rem; font-weight: 900; color: var(--gold-dark); }
.stat-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* TABS */
.tabs { display: flex; gap: 4px; padding: 16px 24px 0; border-bottom: 2px solid var(--border); overflow-x: auto; }
.tab-btn { background: none; border: none; padding: 10px 20px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-light); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all 0.2s; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--gold); }
.tab-content { display: none; padding: 24px; }
.tab-content.active { display: block; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 16px; background: var(--bg); font-weight: 700; color: var(--text-light); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: rgba(255,215,0,0.05); }

/* PRICING */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; padding: 32px 24px; }
.pricing-card { background: var(--card-bg); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); border: 2px solid var(--border); transition: all 0.2s; }
.pricing-card.featured { border-color: var(--gold); background: linear-gradient(135deg, #FFF8DC, #FFFACD); }
.pricing-card:hover { transform: translateY(-4px); }
.plan-badge { display: inline-block; background: var(--gold); color: #1a1a1a; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 12px; }
.plan-name { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.plan-price { font-size: 3rem; font-weight: 900; color: var(--gold-dark); }
.plan-price span { font-size: 16px; font-weight: 500; color: var(--text-light); }
.plan-period { color: var(--text-light); font-size: 14px; margin-bottom: 20px; }
.plan-features { list-style: none; margin-bottom: 24px; }
.plan-features li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.plan-features li::before { content: "✓"; color: var(--success); font-weight: 700; }

/* PAYMENT INFO */
.payment-box { background: var(--card-bg); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--border); margin: 16px 24px; }
.payment-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.upi-box { background: linear-gradient(135deg, #667eea, #764ba2); color: white; border-radius: 12px; padding: 20px; text-align: center; margin-bottom: 16px; }
.upi-id { font-size: 1.4rem; font-weight: 800; letter-spacing: 1px; font-family: monospace; }
.qr-placeholder { width: 160px; height: 160px; background: white; border-radius: 8px; margin: 16px auto; display: flex; align-items: center; justify-content: center; font-size: 80px; }
.bank-info { background: #f9f9f9; border-radius: 8px; padding: 16px; }
body.dark .bank-info { background: #333; }
.bank-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.bank-row:last-child { border-bottom: none; }
.bank-key { font-weight: 600; color: var(--text-light); }

/* FOOTER */
footer { background: #1a1a1a; color: #ccc; padding: 48px 24px 24px; margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-col h4 { color: var(--gold); font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.footer-col a { display: block; color: #aaa; text-decoration: none; font-size: 14px; margin-bottom: 8px; }
.footer-col a:hover { color: var(--gold); }
.footer-col p { font-size: 14px; line-height: 1.7; }
.footer-bottom { border-top: 1px solid #333; padding-top: 20px; text-align: center; font-size: 13px; color: #888; }

/* ALERTS */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-info { background: #d1ecf1; color: #0c5460; }

/* AUTH PAGES */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #FFFACD, #FFF0A0); }
.auth-card { background: var(--card-bg); border-radius: 20px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .logo-box { width: 64px; height: 64px; background: var(--gold); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; margin: 0 auto 12px; }
.auth-logo h1 { font-size: 24px; font-weight: 800; }
.auth-logo p { color: var(--text-light); font-size: 14px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-light); }
.auth-footer a { color: var(--gold-dark); font-weight: 600; text-decoration: none; }

/* DASHBOARD */
.dashboard-container { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.user-card { background: linear-gradient(135deg, var(--gold), #FFE44D); border-radius: 16px; padding: 28px; margin-bottom: 24px; display: flex; align-items: center; gap: 20px; }
.user-avatar { width: 64px; height: 64px; background: rgba(0,0,0,0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; color: #1a1a1a; }
.user-info h2 { font-size: 22px; font-weight: 800; color: #1a1a1a; }
.user-info p { color: #3a3a00; font-size: 14px; }
.premium-badge { display: inline-block; background: #1a1a1a; color: var(--gold); padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; margin-top: 6px; }

/* ADMIN */
.admin-container { max-width: 1100px; margin: 0 auto; }
.admin-header { background: linear-gradient(135deg, #1a1a1a, #333); color: white; padding: 32px 24px; }
.admin-header h1 { font-size: 28px; font-weight: 900; }
.admin-header p { color: #aaa; font-size: 14px; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* PDF VIEWER */
.pdf-viewer { background: #333; border-radius: 12px; padding: 20px; text-align: center; min-height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pdf-viewer iframe { width: 100%; height: 600px; border: none; border-radius: 8px; }

/* VIDEO PLAYER */
.video-player { border-radius: 12px; overflow: hidden; background: #000; }
.video-player iframe { width: 100%; height: 400px; border: none; }

/* MP3 PLAYER */
.mp3-player { background: linear-gradient(135deg, #1a1a1a, #333); border-radius: 16px; padding: 32px; color: white; text-align: center; }
.mp3-player audio { width: 100%; margin-top: 16px; }
.mp3-thumb { font-size: 80px; margin-bottom: 16px; }
.mp3-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }

/* BREADCRUMB */
.breadcrumb { padding: 12px 24px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-light); }
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold-dark); }
.breadcrumb-sep { color: var(--border); }

/* PAGINATION */
.pagination { display: flex; gap: 8px; justify-content: center; padding: 24px; flex-wrap: wrap; }
.page-btn { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); cursor: pointer; font-weight: 600; transition: all 0.2s; }
.page-btn:hover, .page-btn.active { background: var(--gold); border-color: var(--gold); color: #1a1a1a; }

/* SHARE BTN */
.whatsapp-btn { background: #25d366; color: white; padding: 10px 20px; border-radius: 10px; border: none; cursor: pointer; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.whatsapp-btn:hover { background: #128c7e; }

/* PREMIUM LOCK */
.premium-lock-overlay { background: linear-gradient(135deg, rgba(255,107,53,0.1), rgba(255,215,0,0.1)); border: 2px dashed var(--premium); border-radius: var(--radius); padding: 40px; text-align: center; margin: 24px; }
.premium-lock-overlay h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.premium-lock-overlay p { color: var(--text-light); margin-bottom: 16px; }

/* TOAST */
.toast { position: fixed; bottom: 24px; right: 24px; background: #1a1a1a; color: white; padding: 14px 20px; border-radius: 10px; font-size: 14px; font-weight: 500; z-index: 3000; animation: toastIn 0.3s ease; max-width: 300px; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* RESPONSIVE */
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  nav { padding: 0 16px; }
}
@media (max-width: 480px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: repeat(2, 1fr); }
}

/* CONTENT DETAIL */
.detail-container { max-width: 900px; margin: 0 auto; padding: 24px; }
.detail-header { display: flex; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.detail-thumb { width: 200px; height: 260px; border-radius: 12px; object-fit: cover; background: linear-gradient(135deg, #e0d48a, #ffe87c); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 80px; box-shadow: var(--shadow); }
.detail-info { flex: 1; }
.detail-info h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 12px; }
.detail-info p { color: var(--text-light); margin-bottom: 16px; line-height: 1.7; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.meta-item { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-light); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
