/* ============================================
   ANDIJON VILOYAT OMMAVIY KUTUBXONASI
   Asosiy uslublar
   ============================================ */

:root {
    --navy-dark: #101c34;
    --navy: #16223d;
    --blue: #2458e6;
    --blue-hover: #1c46bd;
    --bg-light: #f3f5f9;
    --card-bg: #ffffff;
    --border: #e5e8f0;
    --text-dark: #1a2438;
    --text-muted: #6b7484;
    --green: #17a768;
    --green-bg: #e7f8f0;
    --red: #e0393e;
    --red-bg: #fce9ea;
    --orange: #e9a13a;
    --orange-bg: #fdf1e0;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(16, 28, 52, 0.06);
    --font-heading: 'Manrope', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-dark);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14.5px;
    border: none;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-outline { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: #eef3ff; }
.btn-block { width: 100%; }

/* ---------- Top bar ---------- */
.topbar {
    background: var(--navy-dark);
    color: #cdd6e6;
    font-size: 13px;
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 34px;
}
.topbar a { color: #cdd6e6; }
.topbar-links { display: flex; gap: 18px; }

/* ---------- Header ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 78px;
    gap: 24px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon {
    width: 42px; height: 42px;
    background: var(--blue);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-family: var(--font-heading); font-weight: 800;
}
.logo-text { font-family: var(--font-heading); font-weight: 800; font-size: 15px; line-height: 1.25; color: var(--text-dark); }
.logo-text span { display: block; font-weight: 500; font-size: 11px; color: var(--text-muted); }

.main-nav { display: flex; gap: 28px; }
.main-nav a {
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text-dark);
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}
.main-nav a.active, .main-nav a:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- Submenu dropdown ---------- */
.nav-item { position: relative; display: flex; align-items: center; height: 100%; }
.nav-item.has-submenu > a { cursor: pointer; }
.submenu-dropdown {
    display: none;
    position: absolute;
    top: 100%; left: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(16,28,52,.14);
    min-width: 200px;
    padding: 8px;
    z-index: 150;
}
.nav-item.has-submenu:hover .submenu-dropdown { display: block; }
.submenu-dropdown a {
    display: block;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 6px;
    border-bottom: none !important;
}
.submenu-dropdown a:hover { background: var(--bg-light); }

.header-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    width: 220px;
}
.search-box input { border: none; background: transparent; outline: none; font-size: 13.5px; width: 100%; }
.icon-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--bg-light);
    color: var(--text-dark);
}
.icon-btn:hover { background: var(--border); }

/* ---------- Hero ---------- */
.hero {
    background: var(--navy-dark);
    position: relative;
    overflow: hidden;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    align-items: center;
    min-height: 380px;
    gap: 40px;
}
.hero-text { color: #fff; padding: 40px 0; }
.hero-eyebrow {
    display: inline-block;
    background: rgba(255,255,255,.1);
    color: #9fb3e0;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 18px;
}
.hero-text h1 {
    color: #fff;
    font-size: 38px;
    line-height: 1.2;
    margin-bottom: 14px;
}
.hero-text h1 em { color: #6d9bff; font-style: normal; }
.hero-text p { color: #b7c1d9; font-size: 15.5px; max-width: 460px; margin-bottom: 26px; }
.hero-img {
    height: 100%;
    min-height: 380px;
    background-size: cover;
    background-position: center;
    border-radius: 0;
    position: relative;
}
.hero-img::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--navy-dark), rgba(16,28,52,.15));
}

/* ---------- Sections ---------- */
.section { padding: 52px 0; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
}
.section-head h2 { font-size: 23px; }
.section-head .see-all { color: var(--blue); font-weight: 600; font-size: 14px; }

/* ---------- News cards ---------- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
/* Bosh sahifada 4 ustunli ko'rinish (faqat index.php uchun) */
.news-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}
.news-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .15s ease;
}
.news-card:hover { transform: translateY(-3px); }
.news-card img { width: 100%; height: 190px; object-fit: cover; }
.news-card-body { padding: 16px; }
.news-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; display: flex; gap: 12px; }
.news-card h3 { font-size: 15px; line-height: 1.4; margin-bottom: 8px; }
.news-card p { font-size: 13px; color: var(--text-muted); }

/* ---------- Book cards ---------- */
.book-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
}
.book-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .15s ease;
}
.book-card:hover { transform: translateY(-3px); }
.book-cover { aspect-ratio: 3/4; width: 100%; object-fit: cover; }
.book-info { padding: 12px; }
.book-info h4 { font-size: 13.5px; line-height: 1.35; margin-bottom: 4px; }
.book-info .author { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.book-info .views { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-dark); color: #b7c1d9; padding: 50px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; margin-bottom: 30px; }
.footer-grid h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.footer-grid p, .footer-grid a { font-size: 13.5px; color: #9fabc4; line-height: 1.9; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 18px;
    display: flex; justify-content: space-between;
    font-size: 12.5px; color: #7c88a3;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .news-grid, .news-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .book-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
    .main-nav { display: none; }
    .search-box { display: none; }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-img { display: none; }
    .news-grid, .news-grid.cols-4 { grid-template-columns: 1fr; }
    .book-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   2-BOSQICH: Menyu sahifalari uchun uslublar
   ============================================ */

/* ---------- Page header (breadcrumb-style) ---------- */
.page-header {
    background: var(--navy-dark);
    padding: 34px 0;
    color: #fff;
}
.page-header h1 { color: #fff; font-size: 26px; margin-bottom: 6px; }
.breadcrumb { font-size: 13px; color: #9fb3e0; }
.breadcrumb a { color: #9fb3e0; }
.breadcrumb a:hover { color: #fff; }

/* ---------- Two-column layout (content + sidebar) ---------- */
.layout-2col {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 34px;
    align-items: start;
}
.sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.sidebar-card h4 { font-size: 15px; margin-bottom: 14px; }
.sidebar-list-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sidebar-list-item:last-child { border-bottom: none; }
.sidebar-list-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.sidebar-list-item h5 { font-size: 13px; line-height: 1.4; margin-bottom: 4px; }
.sidebar-list-item span { font-size: 11.5px; color: var(--text-muted); }

.share-row { display: flex; gap: 10px; margin-top: 16px; }
.share-row a {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.share-row a:hover { background: var(--border); }

/* ---------- Article ---------- */
.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.article-card img { width: 100%; max-height: 380px; object-fit: cover; }
.article-body { padding: 30px; }
.article-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.article-body h1 { font-size: 25px; margin-bottom: 16px; }
.article-content { font-size: 15px; line-height: 1.8; color: #384156; }
.article-content p { margin-bottom: 14px; }

/* ---------- News list page ---------- */
.filter-row { display: flex; gap: 10px; margin-bottom: 26px; flex-wrap: wrap; }
.filter-chip {
    padding: 8px 18px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-dark);
}
.filter-chip.active, .filter-chip:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 34px; }
.pagination a, .pagination span {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 13.5px;
    font-weight: 600;
}
.pagination a:hover { background: var(--bg-light); }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- Book detail page ---------- */
.book-detail-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
}
.book-detail-cover img { width: 100%; border-radius: 8px; box-shadow: 0 8px 24px rgba(16,28,52,.15); }
.book-detail-info h1 { font-size: 26px; margin-bottom: 4px; }
.book-detail-info .book-author { font-size: 15px; color: var(--text-muted); margin-bottom: 20px; }
.meta-table { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-bottom: 24px; }
.meta-row { display: flex; justify-content: space-between; font-size: 13.5px; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.meta-row .label { color: var(--text-muted); }
.meta-row .value { font-weight: 600; }
.book-actions { display: flex; gap: 12px; margin-top: 6px; }

.info-block { margin-bottom: 30px; }
.info-block h3 { font-size: 17px; margin-bottom: 12px; }
.info-block p { font-size: 14.5px; line-height: 1.8; color: #384156; }

/* ---------- Forms (register / login) ---------- */
.form-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 50px 0;
}
.form-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 460px;
}
.form-card h2 { font-size: 22px; margin-bottom: 6px; text-align: center; }
.form-card .subtitle { text-align: center; color: var(--text-muted); font-size: 13.5px; margin-bottom: 28px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: var(--bg-light);
}
.form-group input:focus, .form-group select:focus { border-color: var(--blue); background: #fff; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.form-check a { color: var(--blue); }
.form-footer { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--text-muted); }
.form-footer a { color: var(--blue); font-weight: 600; }
.form-error {
    background: var(--red-bg); color: var(--red);
    padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}
.form-success {
    background: var(--green-bg); color: var(--green);
    padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}

/* ---------- Contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }
.contact-info-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 28px;
}
.contact-info-row { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.contact-info-row:last-child { border-bottom: none; }
.contact-info-row .icon { width: 40px; height: 40px; background: var(--bg-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-info-row h5 { font-size: 14px; margin-bottom: 2px; }
.contact-info-row p { font-size: 13.5px; color: var(--text-muted); }
.map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); height: 100%; min-height: 280px; }

@media (max-width: 780px) {
    .layout-2col { grid-template-columns: 1fr; }
    .book-detail-grid { grid-template-columns: 1fr; }
    .book-detail-cover { max-width: 220px; margin: 0 auto; }
    .contact-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

/* ============================================
   3-BOSQICH: Funksiyalar uchun uslublar
   ============================================ */

/* ---------- User menu dropdown ---------- */
.user-menu { position: relative; }
.user-menu-toggle { border: none; cursor: pointer; }
.user-menu-dropdown {
    display: none;
    position: absolute;
    right: 0; top: 48px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16,28,52,.14);
    min-width: 200px;
    padding: 8px;
    z-index: 200;
}
.user-menu-dropdown.open { display: block; }
.user-menu-name { display: block; padding: 8px 12px; font-weight: 700; font-size: 13.5px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu-dropdown a { display: block; padding: 9px 12px; font-size: 13.5px; border-radius: 6px; }
.user-menu-dropdown a:hover { background: var(--bg-light); }

/* ---------- Favorite heart button on book cards ---------- */
.book-card { position: relative; }
.fav-btn {
    position: absolute; top: 8px; right: 8px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(16,28,52,.12);
}
.fav-btn.active { color: var(--red); }

/* ---------- Reviews ---------- */
.review-card { border-bottom: 1px solid var(--border); padding: 16px 0; }
.review-card:last-child { border-bottom: none; }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.review-author { font-weight: 700; font-size: 13.5px; }
.review-stars { color: #e9a13a; font-size: 14px; letter-spacing: 1px; }
.review-date { font-size: 12px; color: var(--text-muted); }
.review-text { font-size: 13.5px; color: #384156; line-height: 1.7; }
.star-input { display: flex; gap: 4px; font-size: 26px; cursor: pointer; margin-bottom: 14px; }
.star-input span { color: #d8dde6; }
.star-input span.selected { color: #e9a13a; }
.book-rating-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.book-rating-summary .num { font-size: 26px; font-weight: 800; }
.book-rating-summary .stars { color: #e9a13a; font-size: 18px; letter-spacing: 2px; }

/* ---------- Search page ---------- */
.search-result-tabs { display: flex; gap: 10px; margin-bottom: 24px; }

/* ---------- Library card ---------- */
.library-card {
    max-width: 420px;
    margin: 0 auto;
    background: linear-gradient(135deg, #16223d, #0e1830);
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    box-shadow: 0 12px 30px rgba(16,28,52,.25);
}
.library-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.library-card-header .li-logo {
    width: 34px; height: 34px; background: var(--blue); border-radius: 7px;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.library-card-header .li-text { font-size: 11px; line-height: 1.3; color: #b7c1d9; }
.library-card-header .li-text b { display: block; color: #fff; font-size: 12.5px; }
.library-card-body { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.library-card-photo { width: 70px; height: 70px; border-radius: 10px; object-fit: cover; background: #223050; }
.library-card-name { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.library-card-id { font-size: 12.5px; color: #9fb3e0; margin-bottom: 4px; }
.library-card-valid { font-size: 12px; color: #9fb3e0; }
.library-card-valid b { color: #fff; }
.library-card-qr { background: #fff; padding: 8px; border-radius: 8px; display: inline-block; }
.library-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 6px; }
.library-card-barcode { background: #fff; border-radius: 6px; padding: 8px 10px; flex: 1; }
.card-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

@media print {
    .site-header, .site-footer, .page-header, .card-actions, .topbar { display: none !important; }
}

/* ============================================
   5-BOSQICH: AI-CHAT widjeti
   ============================================ */

#aiChatWidget { position: fixed; bottom: 24px; right: 24px; z-index: 999; }

#aiChatToggle {
    width: 58px; height: 58px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(36,88,230,.4);
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s ease;
}
#aiChatToggle:hover { transform: scale(1.06); }

#aiChatWindow {
    display: none;
    position: absolute;
    bottom: 72px; right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(16,28,52,.24);
    overflow: hidden;
    flex-direction: column;
}
#aiChatWidget.open #aiChatWindow { display: flex; }

#aiChatHeader { background: var(--navy-dark); color: #fff; padding: 16px 18px; flex-shrink: 0; }

#aiChatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-light);
}
.ai-msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.ai-msg-bot { background: #fff; border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg-user { background: var(--blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-msg-typing { background: #fff; border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; color: var(--text-muted); font-style: italic; }

#aiChatForm { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; background: #fff; }
#aiChatInput { flex: 1; border: 1px solid var(--border); border-radius: 20px; padding: 10px 16px; font-size: 13.5px; outline: none; background: var(--bg-light); }
#aiChatInput:focus { border-color: var(--blue); background: #fff; }
#aiChatForm button { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; border: none; font-size: 15px; cursor: pointer; flex-shrink: 0; }
#aiChatForm button:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 480px) {
    #aiChatWindow { width: calc(100vw - 24px); right: -12px; height: 60vh; }
    #aiChatWidget { right: 16px; bottom: 16px; }
}

/* ============================================
   7-BOSQICH: KITOBXON SAHIFASI (reader dashboard)
   ============================================ */

.reader-layout { display: flex; gap: 26px; align-items: flex-start; padding: 32px 0; }

.reader-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--navy-dark);
    border-radius: var(--radius);
    padding: 22px 0;
    color: #b7c1d9;
    position: sticky;
    top: 92px;
}
.reader-profile-mini { display: flex; align-items: center; gap: 12px; padding: 0 20px 18px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.reader-profile-mini .avatar {
    width: 44px; height: 44px; border-radius: 50%; background: var(--blue);
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.reader-profile-mini .name { font-size: 13.5px; font-weight: 700; color: #fff; line-height: 1.3; }
.reader-profile-mini .card-id { font-size: 11px; color: #8695b5; }

.reader-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    font-size: 13.5px; font-weight: 600;
    color: #b7c1d9;
    border-left: 3px solid transparent;
}
.reader-nav a:hover { background: rgba(255,255,255,.04); color: #fff; }
.reader-nav a.active { background: rgba(36,88,230,.15); color: #fff; border-left-color: var(--blue); }
.reader-nav .icon { width: 18px; text-align: center; }
.reader-nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: 10px 0; }

.reader-main { flex: 1; min-width: 0; }

/* ---------- Reader stat mini cards ---------- */
.reader-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 26px; }
.reader-stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; text-align: center; }
.reader-stat-card .num { font-size: 24px; font-weight: 800; color: var(--blue); }
.reader-stat-card .label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Book row (my-books / history) ---------- */
.book-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.book-row:last-child { border-bottom: none; }
.book-row img { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--bg-light); flex-shrink: 0; }
.book-row .info { flex: 1; min-width: 0; }
.book-row .info h4 { font-size: 14px; margin-bottom: 3px; }
.book-row .info .meta { font-size: 12px; color: var(--text-muted); }

@media (max-width: 900px) {
    .reader-layout { flex-direction: column; }
    .reader-sidebar { width: 100%; position: static; }
}

/* ============================================
   8-BOSQICH: Footer ijtimoiy tarmoq ikonkalari
   ============================================ */
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.social-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.08);
    transition: transform .15s ease, background .15s ease;
}
.social-icon svg { width: 17px; height: 17px; color: #fff; }
.social-icon:hover { transform: translateY(-2px); }
.social-facebook:hover { background: #1877F2; }
.social-instagram:hover { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF, #515BD4); }
.social-telegram:hover { background: #26A5E4; }
.social-youtube:hover { background: #FF0000; }
.social-twitter:hover { background: #000000; }

/* ============================================
   9-BOSQICH: Jadval, E'lonlar, ijtimoiy tarmoq (maqola pastida)
   ============================================ */

.article-content table, .ql-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.article-content table td, .article-content table th,
.ql-editor table td, .ql-editor table th {
    border: 1px solid var(--border);
    padding: 8px 10px;
}
.article-content table th { background: var(--bg-light); font-weight: 700; }
.article-content sup, .ql-editor sup { vertical-align: super; font-size: smaller; }
.article-content sub, .ql-editor sub { vertical-align: sub; font-size: smaller; }

/* ---------- Maqola pastidagi ijtimoiy tarmoq (real ikonkalar) ---------- */
.article-social-row { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.article-social-row .label { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-right: 4px; }
.article-social-row .social-icon { width: 34px; height: 34px; background: var(--bg-light); }
.article-social-row .social-icon svg { color: var(--text-dark); }
.article-social-row .social-facebook:hover svg,
.article-social-row .social-instagram:hover svg,
.article-social-row .social-telegram:hover svg,
.article-social-row .social-youtube:hover svg,
.article-social-row .social-twitter:hover svg { color: #fff; }
