/* ============================================
   IUTH Digital Library - Main Stylesheet
   Clean, Modern, Professional, Minimalistic
   ============================================ */

/* --- CSS Variables --- */
:root {
    --primary: #1B3A5C;
    --primary-dark: #132a44;
    --primary-light: #2E86AB;
    --accent: #F5A623;
    --accent-dark: #e09000;
    --bg: #F8F9FA;
    --bg-white: #FFFFFF;
    --text: #2D3436;
    --text-light: #636e72;
    --text-muted: #b2bec3;
    --border: #E8ECF0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow: 0 2px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: .25s ease;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --container: 1200px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
button { cursor: pointer; font-family: inherit; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* --- Container --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* --- Accessibility Bar --- */
.accessibility-bar {
    background: var(--primary);
    color: #fff;
    padding: 8px 0;
    font-size: 13px;
}
.acc-panel { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.acc-label { font-weight: 500; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.acc-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-buttons button {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}
.acc-buttons button:hover { background: rgba(255,255,255,.25); }
.acc-buttons .acc-reset { background: rgba(255,255,255,.08); border-style: dashed; }

/* --- Header --- */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 24px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-name { font-size: 18px; font-weight: 700; color: var(--primary); }
.logo-sub { font-size: 11px; color: var(--text-light); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
    transition: all var(--transition);
}
.main-nav a:hover { background: var(--bg); color: var(--primary); }
.main-nav a.active { color: var(--primary); background: rgba(27,58,92,.06); }

/* Nav Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    color: var(--text); font-weight: 500; font-size: 15px;
    background: none; border: none;
    transition: all var(--transition); cursor: pointer;
}
.nav-dropdown-btn:hover { background: var(--bg); color: var(--primary); }
.nav-dropdown-btn.active { color: var(--primary); background: rgba(27,58,92,.06); }
.nav-dropdown-btn i { font-size: 10px; transition: transform .2s; }
.nav-dropdown:hover .nav-dropdown-btn i { transform: rotate(180deg); }
.nav-dropdown-menu {
    position: absolute; top: calc(100% + 4px); left: 0;
    background: var(--bg-white); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); min-width: 240px;
    padding: 8px; opacity: 0; visibility: hidden;
    transform: translateY(-8px);
    transition: all .2s ease; z-index: 200;
    border: 1px solid var(--border);
}
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown-menu a {
    display: block; padding: 10px 14px; border-radius: var(--radius-sm);
    color: var(--text); font-size: 14px; font-weight: 400;
    transition: all var(--transition);
}
.nav-dropdown-menu a:hover { background: var(--bg); color: var(--primary); }

/* Mobile Nav Group */
.mobile-nav-group { border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.mobile-nav-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 14px 16px; font-size: 16px; font-weight: 500;
    color: var(--text); background: none; border: none; text-align: left;
    cursor: pointer;
}
.mobile-nav-toggle i { font-size: 12px; transition: transform .2s; }
.mobile-nav-group.open .mobile-nav-toggle i { transform: rotate(180deg); }
.mobile-nav-group.open .mobile-nav-toggle { color: var(--primary); }
.mobile-nav-sub { display: none; padding-left: 16px; padding-bottom: 8px; }
.mobile-nav-group.open .mobile-nav-sub { display: block; }
.mobile-nav-sub a {
    display: block; padding: 10px 16px; font-size: 15px;
    color: var(--text-light); border-radius: var(--radius-sm);
}
.mobile-nav-sub a:hover { background: var(--bg); color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-search-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--text-light);
    transition: all var(--transition);
}
.header-search-btn:hover { background: var(--bg); color: var(--primary); }
.lang-switch {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: all var(--transition);
}
.lang-switch:hover { border-color: var(--primary); color: var(--primary); }

/* User Menu */
.user-menu { position: relative; }
.user-menu-btn {
    display: flex; align-items: center; gap: 8px;
    background: none; border: none; padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.user-menu-btn:hover { background: var(--bg); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-menu-btn i { font-size: 28px; color: var(--text-light); }
.user-name { font-size: 14px; font-weight: 500; color: var(--text); }
.user-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--bg-white); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); min-width: 200px;
    padding: 8px; opacity: 0; visibility: hidden;
    transform: translateY(-8px);
    transition: all .2s ease;
    z-index: 200;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    color: var(--text); font-size: 14px;
    transition: background var(--transition);
}
.user-dropdown a:hover { background: var(--bg); }
.user-dropdown a i { width: 18px; color: var(--text-light); }

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column; gap: 5px;
    background: none; border: none; padding: 8px;
}
.mobile-menu-btn span {
    display: block; width: 22px; height: 2px;
    background: var(--text); transition: all var(--transition);
}
.mobile-menu {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-white); z-index: 1000;
    padding: 80px 24px 24px;
}
.mobile-menu.show { display: block; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu a {
    padding: 14px 16px; font-size: 16px; font-weight: 500;
    color: var(--text); border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.mobile-menu a:hover { background: var(--bg); }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 14px; border: none;
    transition: all var(--transition); text-decoration: none;
    cursor: pointer; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); background: rgba(27,58,92,.04); }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 80px 0 90px;
    position: relative;
    overflow: hidden;
}
.hero-content { position: relative; z-index: 2; max-width: 700px; margin: 0 auto; text-align: center; }
.hero-title { font-size: clamp(28px, 5vw, 44px); font-weight: 700; line-height: 1.2; margin-bottom: 16px; }
.hero-subtitle { font-size: 18px; opacity: .85; margin-bottom: 36px; line-height: 1.6; }
.hero-search { margin-bottom: 40px; }
.hero-search-box {
    display: flex; align-items: center;
    background: #fff; border-radius: 60px;
    padding: 6px 6px 6px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    max-width: 560px; margin: 0 auto;
}
.hero-search-box i { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }
.hero-search-box input {
    flex: 1; border: none; outline: none;
    padding: 12px 14px; font-size: 15px;
    color: var(--text); background: transparent;
}
.hero-search-box button {
    padding: 12px 28px; border: none;
    background: var(--accent); color: #fff;
    border-radius: 60px; font-weight: 600;
    font-size: 14px; transition: background var(--transition);
    white-space: nowrap;
}
.hero-search-box button:hover { background: var(--accent-dark); }

.hero-stats { display: flex; justify-content: center; gap: 48px; }
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 28px; font-weight: 700; }
.stat-label { font-size: 14px; opacity: .7; }

.hero-bg-shape {
    position: absolute; bottom: -80px; right: -60px;
    width: 400px; height: 400px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}

/* --- Sections --- */
.section { padding: 60px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.section-header h2 { font-size: 24px; font-weight: 700; color: var(--text); }
.section-link { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.section-link i { font-size: 12px; }

.page-title { font-size: 28px; font-weight: 700; margin-bottom: 24px; }
.page-subtitle { color: var(--text-light); font-size: 16px; margin-top: -16px; margin-bottom: 32px; }

/* --- Book Cards --- */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}
.book-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.book-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.book-card-cover {
    display: block;
    aspect-ratio: 3/4;
    background: #f0f2f5;
    position: relative;
    overflow: hidden;
}
.book-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.book-card:hover .book-card-cover img { transform: scale(1.05); }
.book-cover-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
    color: #fff; font-size: 48px;
}
.book-cover-placeholder.large { aspect-ratio: 3/4; max-width: 300px; font-size: 64px; border-radius: var(--radius); }
.book-cover-placeholder.small { width: 60px; height: 80px; font-size: 24px; border-radius: 6px; }
.book-badge {
    position: absolute; top: 10px; left: 10px;
    padding: 4px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase;
}
.book-badge.new { background: var(--accent); color: #fff; }
.book-card-info { padding: 14px; }
.book-card-info h3 { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 4px; }
.book-card-info h3 a { color: var(--text); }
.book-card-info h3 a:hover { color: var(--primary-light); }
.book-author { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.book-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }
.book-meta span { display: flex; align-items: center; gap: 4px; }

/* --- News Cards --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}
.news-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.news-card:hover { box-shadow: var(--shadow); }
.news-card-img { aspect-ratio: 16/10; overflow: hidden; background: #f0f2f5; }
.news-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.news-card:hover .news-card-img img { transform: scale(1.05); }
.news-card-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
    color: #fff; font-size: 36px;
}
.news-card-body { padding: 20px; }
.news-date { font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 8px; }
.news-card-body h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.news-card-body h3 a { color: var(--text); }
.news-card-body h3 a:hover { color: var(--primary-light); }
.news-card-body p { font-size: 14px; color: var(--text-light); line-height: 1.6; }

.news-list-grid { display: flex; flex-direction: column; gap: 24px; }
.news-card.horizontal { display: grid; grid-template-columns: 300px 1fr; }
.news-card.horizontal .news-card-img { aspect-ratio: auto; height: 100%; }
.news-card.horizontal .news-card-body h2 { font-size: 20px; margin-bottom: 10px; }
.news-card.horizontal .news-card-body h2 a { color: var(--text); }
.read-more-link { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; }

/* --- News Detail --- */
.news-detail { max-width: 800px; margin: 0 auto; }
.news-detail-img { border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.news-detail-img img { width: 100%; }
.news-detail-header { display: flex; gap: 16px; margin-bottom: 16px; font-size: 14px; color: var(--text-muted); }
.news-detail h1 { font-size: 28px; margin-bottom: 24px; line-height: 1.3; }
.news-detail-content { font-size: 16px; line-height: 1.8; color: var(--text); }
.news-detail-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }

/* --- E-Libraries --- */
.elib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}
.elib-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-white); padding: 20px;
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: all var(--transition); color: var(--text);
    border: 1px solid var(--border);
}
.elib-card:hover { box-shadow: var(--shadow); border-color: var(--primary-light); color: var(--text); transform: translateY(-2px); }
.elib-logo { width: 60px; height: 60px; flex-shrink: 0; }
.elib-logo img { width: 100%; height: 100%; object-fit: contain; }
.elib-logo i { font-size: 32px; color: var(--primary-light); }
.elib-info h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.elib-info p { font-size: 13px; color: var(--text-light); }
.elib-link-icon { margin-left: auto; color: var(--text-muted); font-size: 14px; }

.elib-list { display: flex; flex-direction: column; gap: 24px; }
.elib-detail-card {
    display: flex; gap: 24px; background: var(--bg-white);
    padding: 32px; border-radius: var(--radius);
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.elib-detail-logo { width: 100px; height: 100px; flex-shrink: 0; }
.elib-detail-logo img { width: 100%; height: 100%; object-fit: contain; }
.elib-logo-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg); border-radius: var(--radius-sm);
    color: var(--primary-light); font-size: 36px;
}
.elib-detail-body h2 { font-size: 20px; margin-bottom: 8px; }
.elib-detail-body p { color: var(--text-light); margin-bottom: 16px; line-height: 1.6; }

/* --- Book Detail --- */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); margin-bottom: 32px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb span:last-child { color: var(--text); }
.book-detail { display: grid; grid-template-columns: 280px 1fr; gap: 40px; }
.book-detail-cover img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.book-detail-info h1 { font-size: 26px; margin-bottom: 8px; line-height: 1.3; }
.book-detail-author { font-size: 16px; color: var(--text-light); margin-bottom: 20px; }
.book-detail-author i { margin-right: 4px; }
.book-detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.meta-item { background: var(--bg); padding: 12px; border-radius: var(--radius-sm); }
.meta-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.meta-value { font-weight: 600; font-size: 14px; }
.book-categories { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tag {
    padding: 6px 14px; background: rgba(46,134,171,.08);
    color: var(--primary-light); border-radius: 20px;
    font-size: 13px; font-weight: 500;
    transition: all var(--transition);
}
.tag:hover { background: rgba(46,134,171,.15); }
.book-actions { margin-bottom: 24px; }
.reading-progress-info { font-size: 14px; color: var(--text-light); margin-top: 10px; }
.book-description { margin-top: 24px; }
.book-description h3 { font-size: 18px; margin-bottom: 12px; }
.desc-text { font-size: 15px; line-height: 1.8; color: var(--text-light); }
.related-books { margin-top: 60px; }
.related-books h2 { font-size: 22px; margin-bottom: 24px; }

/* --- Catalog Layout --- */
.catalog-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; }
.catalog-sidebar {}
.sidebar-block { background: var(--bg-white); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.sidebar-block h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.category-list { list-style: none; }
.category-list li { margin-bottom: 2px; }
.category-list a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--text); font-size: 14px;
    transition: all var(--transition);
}
.category-list a:hover { background: var(--bg); }
.category-list a.active { background: rgba(27,58,92,.06); color: var(--primary); font-weight: 600; }
.cat-count { font-size: 12px; color: var(--text-muted); }
.sidebar-search { display: flex; }
.sidebar-search input {
    flex: 1; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm); outline: none;
    font-size: 14px;
}
.sidebar-search input:focus { border-color: var(--primary-light); }
.sidebar-search button {
    padding: 10px 14px; background: var(--primary); color: #fff;
    border: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.sort-options { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sort-options select {
    padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-white);
    font-size: 14px; outline: none; cursor: pointer;
}
.results-count { font-size: 14px; color: var(--text-muted); }

/* --- Search --- */
.search-form-large { max-width: 700px; margin: 0 auto 32px; }
.search-input-wrap {
    display: flex; align-items: center;
    background: var(--bg-white); border: 2px solid var(--border);
    border-radius: 60px; padding: 6px 6px 6px 20px;
    transition: border-color var(--transition);
}
.search-input-wrap:focus-within { border-color: var(--primary-light); }
.search-input-wrap i { color: var(--text-muted); font-size: 18px; }
.search-input-wrap input { flex: 1; border: none; outline: none; padding: 12px 14px; font-size: 16px; background: transparent; }
.search-input-wrap .btn { border-radius: 60px; }
.search-results-info { font-size: 16px; color: var(--text-light); margin-bottom: 24px; text-align: center; }

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 40px; }
.page-link {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); color: var(--text);
    font-size: 14px; font-weight: 500;
    transition: all var(--transition);
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- Login --- */
.login-section { display: flex; justify-content: center; padding: 60px 0; }
.login-card {
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 48px 40px; max-width: 440px; width: 100%;
    box-shadow: var(--shadow-lg); text-align: center;
}
.login-card-header i { font-size: 48px; color: var(--primary); margin-bottom: 16px; }
.login-card-header h1 { font-size: 24px; margin-bottom: 8px; }
.login-card-header p { color: var(--text-light); font-size: 15px; margin-bottom: 32px; }
.btn-google {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 14px 28px; background: var(--bg-white);
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 16px; font-weight: 600;
    transition: all var(--transition); width: 100%; justify-content: center;
}
.btn-google:hover { border-color: #4285f4; box-shadow: var(--shadow); color: var(--text); }
.login-card-footer { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.login-card-footer p { font-size: 13px; color: var(--text-muted); }

/* --- Profile --- */
.profile-header { display: flex; align-items: center; gap: 24px; margin-bottom: 40px; }
.profile-avatar img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--bg); display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: var(--text-muted);
}
.profile-info h1 { font-size: 24px; margin-bottom: 4px; }
.profile-email, .profile-joined { font-size: 14px; color: var(--text-light); margin-bottom: 2px; }
.reading-history { display: flex; flex-direction: column; gap: 12px; }
.history-item {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-white); padding: 16px; border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.history-cover img { width: 50px; height: 68px; object-fit: cover; border-radius: 4px; }
.history-info { flex: 1; }
.history-info h3 { font-size: 15px; margin-bottom: 2px; }
.history-info h3 a { color: var(--text); }
.history-progress { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.progress-mini { width: 100px; height: 4px; background: var(--border); border-radius: 2px; margin-top: 4px; }
.progress-mini-bar { height: 100%; background: var(--primary-light); border-radius: 2px; }

/* --- About Pages --- */
.about-layout { display: grid; grid-template-columns: 280px 1fr; gap: 32px; }
.about-sidebar {}
.about-nav { list-style: none; }
.about-nav li { margin-bottom: 2px; }
.about-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    color: var(--text); font-size: 15px; font-weight: 500;
    transition: all var(--transition);
}
.about-nav a:hover { background: var(--bg); color: var(--primary); }
.about-nav a.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
}
.about-nav a i { width: 20px; text-align: center; font-size: 14px; }

.about-content {
    background: var(--bg-white); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.about-content-header {
    display: flex; align-items: center; gap: 14px;
    padding: 28px 32px; border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(27,58,92,.03), rgba(46,134,171,.03));
}
.about-content-header i { font-size: 28px; color: var(--primary-light); }
.about-content-header h1 { font-size: 24px; font-weight: 700; }
.about-body { padding: 32px; line-height: 1.8; font-size: 15px; color: var(--text); }
.about-body h2 { font-size: 20px; font-weight: 600; margin: 24px 0 12px; color: var(--primary); }
.about-body h3 { font-size: 17px; font-weight: 600; margin: 20px 0 10px; }
.about-body p { margin-bottom: 14px; }
.about-body ul, .about-body ol { margin: 12px 0; padding-left: 24px; }
.about-body li { margin-bottom: 6px; }
.about-body img { border-radius: var(--radius-sm); margin: 16px 0; }
.about-body blockquote {
    border-left: 4px solid var(--primary-light); padding: 12px 20px;
    margin: 16px 0; background: var(--bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic; color: var(--text-light);
}
.about-placeholder {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.about-placeholder-icon {
    width: 80px; height: 80px; margin: 0 auto 20px;
    background: var(--bg); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: var(--primary-light);
}
.about-placeholder p { font-size: 16px; }

.about-contact-block { display: flex; flex-direction: column; gap: 24px; }
.about-contact-block .contact-item {
    display: flex; gap: 20px; align-items: flex-start;
    padding: 20px; background: var(--bg); border-radius: var(--radius-sm);
}
.about-contact-block .contact-item i {
    font-size: 24px; color: var(--primary); flex-shrink: 0;
}
.about-contact-block .contact-item strong { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text-muted); }
.about-contact-block .contact-item p { margin: 0; }
.about-contact-block .contact-item a { color: var(--primary); text-decoration: none; }
.about-contact-block .contact-item a:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .about-layout { grid-template-columns: 1fr; }
    .about-sidebar { order: 2; }
    .about-content { order: 1; }
    .about-content-header { padding: 20px 24px; }
    .about-body { padding: 24px; }
}

/* --- Empty State --- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 16px; margin-bottom: 20px; }

/* --- Flash Messages --- */
.flash-message {
    padding: 14px 0;
    font-size: 14px; font-weight: 500;
}
.flash-message .container { display: flex; align-items: center; justify-content: space-between; }
.flash-message button { background: none; border: none; font-size: 20px; color: inherit; }
.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; }
.alert-error { background: #fee; color: #c0392b; }

/* --- Footer --- */
.site-footer { background: var(--primary); color: #fff; padding: 60px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; margin-bottom: 16px; color: #fff; }
.footer-logo i { font-size: 24px; }
.footer-about { font-size: 14px; opacity: .75; line-height: 1.7; margin-bottom: 20px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.1); border-radius: 50%;
    color: #fff; font-size: 14px;
    transition: background var(--transition);
}
.footer-social a:hover { background: rgba(255,255,255,.2); color: #fff; }
.footer-col h4 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { color: rgba(255,255,255,.7); font-size: 14px; }
.footer-col ul a:hover { color: #fff; }
.contact-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.contact-list li span,
.contact-list li a { color: rgba(255,255,255,.7); }
.contact-list i { width: 16px; margin-top: 3px; opacity: .6; flex-shrink: 0; }
.contact-list a:hover { color: #fff; }

.footer-partners { padding: 30px 0; border-top: 1px solid rgba(255,255,255,.1); }
.footer-partners h4 { text-align: center; margin-bottom: 20px; font-size: 16px; }
.partners-row { display: flex; justify-content: center; align-items: center; gap: 24px; flex-wrap: wrap; }
.partner-item { display: flex; align-items: center; justify-content: center; padding: 8px; }
.partner-item img { height: 40px; opacity: .7; transition: opacity var(--transition); }
.partner-item:hover img { opacity: 1; }
.partner-item span { color: rgba(255,255,255,.7); font-size: 14px; font-weight: 500; }
.partner-item:hover span { color: #fff; }

.footer-bottom { padding: 20px 0; border-top: 1px solid rgba(255,255,255,.1); text-align: center; }
.footer-bottom p { font-size: 13px; opacity: .6; }

/* --- Chat Widget --- */
.chat-widget { position: fixed; bottom: 24px; right: 24px; z-index: 500; }
.chat-toggle {
    width: 56px; height: 56px;
    background: var(--primary); color: #fff;
    border: none; border-radius: 50%;
    font-size: 22px; box-shadow: var(--shadow-lg);
    position: relative; transition: transform var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.chat-toggle:hover { transform: scale(1.05); }
.chat-badge {
    position: absolute; top: -4px; right: -4px;
    width: 20px; height: 20px; background: var(--accent);
    border-radius: 50%; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.chat-window {
    position: absolute; bottom: 70px; right: 0;
    width: 360px; max-height: 480px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none; flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
}
.chat-window.show { display: flex; }
.chat-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    background: var(--primary); color: #fff;
}
.chat-header-info { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.chat-close { background: none; border: none; color: rgba(255,255,255,.7); font-size: 18px; padding: 4px; }
.chat-close:hover { color: #fff; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 320px; }
.chat-msg { max-width: 85%; }
.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }
.chat-msg-content {
    padding: 10px 14px; border-radius: 14px;
    font-size: 14px; line-height: 1.5;
}
.chat-msg.bot .chat-msg-content { background: var(--bg); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg.user .chat-msg-content { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-input-area { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.chat-input-area input {
    flex: 1; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: 24px; outline: none; font-size: 14px;
}
.chat-input-area input:focus { border-color: var(--primary-light); }
.chat-input-area button {
    width: 40px; height: 40px; border: none;
    background: var(--primary); color: #fff;
    border-radius: 50%; font-size: 14px;
    transition: background var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.chat-input-area button:hover { background: var(--primary-dark); }

/* --- Accessibility Classes --- */
html.acc-font-lg { font-size: 18px; }
html.acc-font-xl { font-size: 20px; }
html.acc-font-sm { font-size: 14px; }
html.acc-contrast { filter: contrast(1.5); }
html.acc-grayscale { filter: grayscale(1); }
html.acc-contrast.acc-grayscale { filter: contrast(1.5) grayscale(1); }
html.acc-links a { text-decoration: underline !important; outline: 2px solid var(--accent) !important; outline-offset: 2px; }
html.acc-readable { font-family: Georgia, 'Times New Roman', serif !important; }
html.acc-readable * { font-family: inherit !important; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .book-detail { grid-template-columns: 220px 1fr; gap: 24px; }
    .catalog-layout { grid-template-columns: 220px 1fr; }
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .hero { padding: 48px 0 56px; }
    .hero-stats { gap: 24px; }
    .stat-num { font-size: 22px; }
    .section { padding: 40px 0; }
    .books-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
    .news-grid { grid-template-columns: 1fr; }
    .elib-grid { grid-template-columns: 1fr; }
    .book-detail { grid-template-columns: 1fr; }
    .book-detail-cover { max-width: 240px; margin: 0 auto; }
    .catalog-layout { grid-template-columns: 1fr; }
    .catalog-sidebar { order: 2; }
    .catalog-main { order: 1; }
    .news-card.horizontal { grid-template-columns: 1fr; }
    .news-card.horizontal .news-card-img { aspect-ratio: 16/10; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .elib-detail-card { flex-direction: column; align-items: center; }
    .elib-detail-card .elib-detail-body { align-self: stretch; text-align: left; }
    .elib-detail-card .elib-detail-body .btn { display: flex; justify-content: center; margin-left: auto; margin-right: auto; }
    .login-card { padding: 32px 24px; }
    .profile-header { flex-direction: column; text-align: center; }
    .chat-window { width: calc(100vw - 48px); right: -12px; }
    .user-name { display: none; }
    .acc-label { display: none; }
}

@media (max-width: 480px) {
    .books-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .hero-search-box { flex-direction: column; border-radius: var(--radius); padding: 8px; }
    .hero-search-box button { width: 100%; border-radius: var(--radius-sm); }
}
