/* ==========================================
   LKLNP Main Stylesheet (style.css)
   ========================================== */

/* 🟢 Layout Alignment Variables (Desktop & Mobile Sync) */
:root {
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --esewa: #41a124;
    --khalti: #5c2d91;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    
    /* डेस्कटपमा Navbar र Main Content लाई एउटै सिधा लाइनमा राख्न */
    --layout-width: 1200px; 
    --side-padding: max(5%, calc((100% - var(--layout-width)) / 2));
}

html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; }

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.05), transparent 40%);
}

/* 🟢 Grant Status Styles */
.grant-status-loading, .grant-status-success, .grant-status-error {
    padding: 10px; border-radius: 8px; font-size: 0.88rem; font-weight: 600; margin-top: 10px;
}
.grant-status-loading { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.grant-status-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.grant-status-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

/* 🟢 Navbar Styles */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem var(--side-padding);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.logo-brand { display: flex; align-items: center; gap: 12px; cursor: pointer; text-decoration: none; }
.logo-img { height: 42px; width: 42px; object-fit: cover; border-radius: 8px; border: 1px solid var(--card-border); }
.logo-text { font-size: 1.35rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.5px; }

.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: color 0.2s;}
.nav-links a:hover { color: var(--primary); }

.btn-auth-nav { background: var(--primary); color: white; border: none; padding: 8px 18px; border-radius: 20px; font-weight: 700; cursor: pointer; font-size: 0.88rem; transition: background 0.2s; }
.btn-auth-nav:hover { background: var(--primary-hover); }

/* 🟢 User Dropdown Styles */
.user-dropdown-wrapper { position: relative; display: inline-block; }
.user-avatar-btn {
    display: flex; align-items: center; gap: 6px; background: #f1f5f9; border: 1px solid #cbd5e1;
    padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 0.88rem; font-weight: 600; color: #0f172a; transition: all 0.2s ease;
}
.user-avatar-btn:hover { background: #e2e8f0; }
.avatar-icon { font-size: 1.1rem; }
.dropdown-arrow { font-size: 0.75rem; color: #64748b; }
.user-short-name { max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-dropdown-menu {
    display: none; position: absolute; right: 0; top: 120%; background: #ffffff; min-width: 210px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12); border-radius: 12px; border: 1px solid #e2e8f0; z-index: 1000; padding: 8px 0; animation: fadeIn 0.15s ease-out;
}
.user-dropdown-menu.show { display: block; }
.dropdown-header { padding: 8px 16px; display: flex; flex-direction: column; }
.dropdown-header strong { font-size: 0.9rem; color: #0f172a; }
.dropdown-header small { font-size: 0.78rem; color: #64748b; word-break: break-all; }
.dropdown-divider { border: none; border-top: 1px solid #f1f5f9; margin: 6px 0; }
.dropdown-item {
    width: 100%; text-align: left; padding: 9px 16px; background: none; border: none; font-size: 0.88rem; color: #334155;
    cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background 0.15s ease;
}
.dropdown-item:hover { background: #f8fafc; color: #2563eb; }
.dropdown-item.admin-item { color: #2563eb; font-weight: 700; }
.dropdown-item.logout-item { color: #dc2626; }
.dropdown-item.logout-item:hover { background: #fef2f2; }

@media (max-width: 600px) {
    .user-short-name { display: none; }
    .user-avatar-btn { padding: 6px 10px; border-radius: 50%; }
    .dropdown-arrow { display: none; }
}

/* 🟢 Main Container */
main { padding: 2rem var(--side-padding); flex: 1; }
#app { width: 100%; max-width: 100%; margin: 0 auto; animation: fadeIn 0.35s ease-in-out; }

/* 🟢 Hero Section */
.hero-banner {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%); border: 1px solid #dbeafe; border-radius: 20px;
    padding: 3.5rem 2rem; text-align: center; box-shadow: 0 15px 30px -10px rgba(37, 99, 235, 0.08); margin-bottom: 3rem; position: relative; overflow: hidden;
}
.hero-flag-left, .hero-flag-right { position: absolute; top: 50%; transform: translateY(-50%); font-size: 3.2rem; user-select: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1)); }
.hero-flag-left { left: 35px; } .hero-flag-right { right: 35px; }

@media (max-width: 640px) {
    .hero-flag-left, .hero-flag-right { font-size: 2rem; top: 15px; transform: none; }
    .hero-flag-left { left: 15px; } .hero-flag-right { right: 15px; }
}

.badge-2026 {
    position: absolute; top: 10px; right: 10px; background: #dbeafe; color: var(--primary); padding: 4px 12px;
    border-radius: 20px; font-size: 0.75rem; font-weight: 700; border: 1px solid #bfdbfe; z-index: 10; box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.hero-banner .badge-2026 { position: relative; top: auto; right: auto; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 0.88rem; padding: 6px 16px; }
.hero-badge-logo { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; border: 1px solid var(--primary); }

.hero-banner h1 { font-size: 2.5rem; margin-bottom: 14px; color: var(--text-main); font-weight: 800; letter-spacing: -0.5px; line-height: 1.25; }
.hero-banner p { color: var(--text-muted); font-size: 1.1rem; max-width: 680px; margin: 0 auto 2rem auto; line-height: 1.6; }

.btn-hero {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: linear-gradient(to right, #2563eb, #4f46e5); color: white;
    font-size: 1.1rem; font-weight: 700; padding: 0.95rem 2.2rem; border-radius: 12px; border: none; cursor: pointer; box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.35); transition: all 0.25s ease;
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 14px 24px -5px rgba(37, 99, 235, 0.45); }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--card-border); scroll-margin-top: 90px; }
.section-title { font-size: 1.35rem; font-weight: 800; color: var(--text-main); }

/* 🟢 Books Grid & Cards */
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 2rem; }
.book-card {
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 1.25rem;
    box-shadow: var(--shadow); transition: transform 0.25s, box-shadow 0.25s; display: flex; flex-direction: column; justify-content: space-between;
}
.book-card:hover { transform: translateY(-4px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08); }

.book-cover { 
    width: 100%; height: 280px; background: #ffffff; border-radius: 12px; margin-bottom: 0.8rem; 
    display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; padding: 4px;
}
.book-cover svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.04)); }

.book-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.8rem; color: var(--text-main); line-height: 1.35; }
.price-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; gap: 8px; }
.book-price { font-size: 1.2rem; color: var(--primary); font-weight: 800; }

.btn-features-sm {
    background: #f1f5f9; color: var(--text-main); border: 1px solid var(--card-border); padding: 6px 11px; font-size: 0.78rem;
    font-weight: 700; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: all 0.2s; display: inline-flex; align-items: center; gap: 4px;
}
.btn-features-sm:hover { background: #e2e8f0; color: var(--primary); border-color: #cbd5e1; }

.btn {
    width: 100%; padding: 0.85rem; border: none; border-radius: 10px; font-weight: 700; cursor: pointer; transition: all 0.2s; font-size: 0.95rem; display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn:hover { opacity: 0.95; transform: scale(0.99); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

/* 🟢 Modal Styles */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-card {
    background: #ffffff; width: 90%; max-width: 460px; border-radius: 20px; padding: 2rem; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative; transform: translateY(20px); transition: transform 0.25s ease; max-height: 90vh; overflow-y: auto;
}
.modal-overlay.active .modal-card { transform: translateY(0); }
.close-modal {
    position: absolute; top: 18px; right: 20px; background: #f1f5f9; border: none; width: 34px; height: 34px; border-radius: 50%;
    font-size: 1.1rem; font-weight: bold; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.close-modal:hover { background: #e2e8f0; color: #000; }
.modal-header { margin-bottom: 1.2rem; padding-right: 25px; }
.modal-title { font-size: 1.3rem; font-weight: 800; color: var(--text-main); }
.feature-list { list-style: none; margin: 1.2rem 0; }
.feature-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; color: var(--text-main); line-height: 1.5; }
.feature-item:last-child { border-bottom: none; }
.feature-icon { background: #dbeafe; color: var(--primary); width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; flex-shrink: 0; margin-top: 2px; }

/* 🟢 Auth & Checkout */
.auth-tab { display: flex; gap: 12px; margin-bottom: 1.2rem; border-bottom: 1px solid var(--card-border); padding-bottom: 8px; }
.tab-btn { background: none; border: none; font-size: 1rem; font-weight: 700; color: var(--text-muted); cursor: pointer; padding: 4px 8px; }
.tab-btn.active { color: var(--primary); border-bottom: 2px solid var(--primary); }
.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-main); }
.form-control { width: 100%; padding: 0.75rem; border: 1px solid var(--card-border); border-radius: 8px; font-size: 0.95rem; outline: none; transition: border 0.2s; }
.form-control:focus { border-color: var(--primary); }
.divider { text-align: center; margin: 1.2rem 0; color: var(--text-muted); font-size: 0.85rem; position: relative; }

.checkout-container { display: flex; flex-wrap: wrap; gap: 2rem; width: 100%; }
.checkout-details, .payment-options { background: var(--card-bg); padding: 2rem; border-radius: 16px; border: 1px solid var(--card-border); box-shadow: var(--shadow); flex: 1; min-width: 300px; }
.payment-btn { width: 100%; padding: 0.95rem; margin-bottom: 1rem; border: none; border-radius: 10px; color: white; font-weight: 700; font-size: 0.95rem; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; }
.payment-btn:hover { transform: translateY(-2px); }

.loader-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 50vh; text-align: center; }
.spinner { width: 55px; height: 55px; border: 4px solid #e2e8f0; border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 0.9s linear infinite; margin-bottom: 1.5rem;}
.processing-text { font-size: 1.25rem; color: var(--primary); font-weight: 700; }
.processing-sub { font-size: 0.95rem; color: var(--text-muted); margin-top: 0.5rem; }

.success-card { background: var(--card-bg); padding: 2.5rem 2rem; border-radius: 16px; border: 1px solid #bbf7d0; box-shadow: var(--shadow); text-align: center; max-width: 650px; margin: 0 auto; }
.success-icon { font-size: 3.5rem; margin-bottom: 0.8rem; }
.credential-box { background: #f8fafc; border: 1px dashed var(--primary); padding: 1.2rem; border-radius: 10px; margin: 1.5rem 0; }
.credential-box h4 { margin-bottom: 0.4rem; color: var(--text-muted); font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase;}
.password-display { font-family: monospace; font-size: 1.6rem; font-weight: bold; letter-spacing: 3px; color: var(--primary); user-select: all;}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 📱 MAIN APP: Mobile Responsiveness Fixes */
@media (max-width: 600px) {
    .btn-hero { font-size: 1rem; padding: 0.8rem 1.2rem; width: 100%; max-width: 320px; line-height: 1.4; white-space: normal; text-align: center; }
    .payment-btn { font-size: 0.9rem !important; padding: 0.85rem !important; line-height: 1.4; white-space: normal; text-align: center; }
    .checkout-details, .payment-options { padding: 1.5rem 1rem; min-width: 100%; }
}

/* ==========================================
   🦶 FOOTER STYLES
========================================== */
.custom-footer {
    background-color: #f8f9fa;
    padding: 30px var(--side-padding) 20px;
    margin-top: 50px;
    border-top: 1px solid #e9ecef;
    font-family: 'Inter', sans-serif;
}
.footer-container {
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

/* 🟢 Desktop View: Links with Dot Separators */
.footer-links { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    flex-wrap: wrap; 
    margin-bottom: 20px; 
}
.footer-links a { 
    color: #4b5563; 
    text-decoration: none; 
    font-size: 14px; 
    font-weight: 500; 
    transition: color 0.3s; 
    white-space: nowrap; 
    padding: 0 20px; /* लिङ्कहरूको बीचमा फराकिलो प्याडिङ */
    position: relative;
}
.footer-links a:hover { 
    color: #2563eb; 
}
/* 🟢 यहाँ थोप्लो (Dot) थपिएको छ जसले लिङ्कहरूलाई प्रस्ट छुट्टाउँछ */
.footer-links a:not(:last-child)::after {
    content: "•";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(50%);
    color: #cbd5e1;
    font-size: 18px;
    pointer-events: none;
}

.footer-divider { height: 1px; background-color: #e5e7eb; margin: 20px 0; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.copyright { color: #6b7280; font-size: 13px; margin: 0; }

.powered-by { display: flex; align-items: center; gap: 8px; background: white; padding: 6px 12px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.powered-text { font-size: 11px; color: #6b7280; }
.spheretech-logo { height: 24px; width: auto; border-radius: 4px; }
.company-name { font-size: 13px; font-weight: 600; color: #1f2937; }

/* 🔴 YouTube Icon Hover Effect */
.footer-container a[title="Subscribe to LKLNP on YouTube"]:hover { color: #ff0000 !important; }

/* 🟢 Library Action Buttons (Read, Download, Remove) - 50% Smaller & Compact */
.btn-action-sm {
    padding: 0.2rem 0.4rem; /* प्याडिङलाई लगभग ५०% ले घटाइएको छ */
    font-size: 0.7rem;      /* फन्ट साइज पनि निकै सानो बनाइएको छ */
    white-space: nowrap;
    border-radius: 4px;     /* बोर्डर रेडियस पनि घटाइएको छ */
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 3px;               /* आइकन र टेक्स्ट बीचको दूरी घटाइएको छ */
    transition: all 0.2s;
    height: 28px;           /* बटनको उचाइ फिक्स गरिएको छ */
}

/* 📱 Mobile Responsiveness: साना स्क्रिनहरूका लागि अझै सानो */
@media (max-width: 500px) {
    .btn-action-sm {
        padding: 0.15rem 0.3rem; 
        font-size: 0.65rem;     
        height: 24px;
        border-radius: 3px;
    }
}