:root {
    --primary-color: #0063AF;
    --secondary-color: #00B4D8;
    --success-color: #06A77D;
    --dark-color: #1a1a1a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-link:hover {
    color: white !important;
    transform: translateY(-2px);
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 80px 0;
    margin-bottom: 50px;
}

.img{
    max-width: 500px;
}

/* O'zbek va Ingliz - normal */
html[lang="uz"] .hero-section h1,
html[lang="en"] .hero-section h1 {
    font-size: 3rem;
    line-height: 1.2;
    font-weight: bold;
}

/* Rus - biroz kichikroq */
html[lang="ru"] .hero-section h1 {
    font-size: 2.5rem;
    line-height: 1.3;
    font-weight: bold;
}


.search-box {
    background: white;
    border-radius: 50px;
    padding: 10px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
}

.book-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    height: 100%;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.book-card img {
    height: 300px;
    object-fit: cover;
}

.category-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s;
}

.category-card:hover {
    transform: scale(1.05);
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.footer {
    background: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 80px;
}

.badge-custom {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.80rem;
}

.btn-primary-custom {
    background: linear-gradient(135deg, #667eea 0%, #2b47b6 100%);
    border: none;
    color: white;
    border-radius: 50px;
    padding: 10px 30px;
    transition: all 0.3s;

}

.btn-primary-custom:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.language-switcher {
    display: flex;
    gap: 10px;
}

.language-switcher a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.language-switcher a:hover {
    background: rgba(255, 255, 255, 0.3);
}

.language-switcher a.active {
    background: rgba(255, 255, 255, 0.4);
}

/* ─── User dropdown ─── */
.user-avatar-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 25px;
    padding: 5px 14px 5px 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.user-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.user-avatar-btn img,
.user-avatar-btn .avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    object-fit: cover;
}

.user-avatar-btn .avatar-placeholder {
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-btn span {
    color: white;
    font-weight: 600;
    font-size: 14px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-menu {
    min-width: 230px;
    border: none;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.user-dropdown-header {
    background: #f0f7ff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-dropdown-header img,
.user-dropdown-header .avatar-lg {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
}

.user-dropdown-header .avatar-lg {
    background: #0063AF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-item {
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
}

.dropdown-item:hover {
    background: #f0f7ff;
}

/* ─── Alerts ─── */
.hemis-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 10px;
    margin: 10px 0;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.hemis-alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.hemis-alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.hemis-alert span {
    flex: 1;
}

.hemis-alert button {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
    padding: 0 4px;
}

.hemis-alert button:hover {
    opacity: 1;
}

.hemis-alert.hiding {
    animation: slideUp 0.4s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* ─── HEMIS Modal ─── */
.hemis-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
}

.hemis-modal.active {
    display: flex;
}

.hemis-modal-content {
    background: white;
    border-radius: 18px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

.hemis-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.hemis-modal-header i {
    font-size: 48px;
    color: #0063AF;
    margin-bottom: 12px;
    display: block;
}

.hemis-modal-header h5 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.hemis-close {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 26px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

.hemis-close:hover {
    color: #333;
}

.hemis-options {
    display: flex;
    gap: 14px;
    margin-top: 20px;
}

.hemis-option {
    flex: 1;
    padding: 20px 10px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: white;
    background: #0063AF;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.25s;
}

.hemis-option:hover {
    background: #004d87;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 99, 175, 0.3);
}

.hemis-option i {
    font-size: 30px;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* ═══ MOBILE RESPONSIVE ═══ */

/* Tablet (768px) */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
        margin-bottom: 35px;
    }

    html[lang="uz"] .hero-section h1,
    html[lang="en"] .hero-section h1 {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    html[lang="ru"] .hero-section h1 {
        font-size: 1.7rem;
        line-height: 1.3;
        margin-bottom: 15px;
    }

    .search-box {
        padding: 8px 15px;
    }

    .book-card img {
        height: 250px;
    }

    .stat-card {
        padding: 25px;
        margin-bottom: 20px;
    }

    .stat-card h3 {
        font-size: 2rem;
    }

    .user-avatar-btn span {
        max-width: 90px;
    }

    .user-dropdown-menu {
        min-width: 210px;
    }

    .navbar-brand {
        font-size: 1.3rem;
    }

    .language-switcher {
        gap: 8px;
        margin-top: 15px;
        margin-bottom: 10px;
    }

    .language-switcher a {
        padding: 4px 8px;
        font-size: 14px;
    }
}

/* Mobile Large (576px) */
@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .nav-link {
        font-size: 14px;
        padding: 8px 12px;
    }

    .hero-section {
        padding: 45px 0;
        margin-bottom: 25px;
    }

    html[lang="uz"] .hero-section h1,
    html[lang="en"] .hero-section h1 {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }

    html[lang="ru"] .hero-section h1 {
        font-size: 1.4rem;
        line-height: 1.35;
        margin-bottom: 12px;
    }

    .img{
        max-width: 300px;
    }

    .search-box {
        padding: 6px 12px;
        border-radius: 40px;
    }

    .search-box input {
        font-size: 14px;
    }

    .book-card {
        border-radius: 12px;
        margin-bottom: 15px;
    }

    .book-card img {
        height: 220px;
    }

    .book-card .card-body {
        padding: 15px;
    }

    .book-card .card-title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .category-card {
        padding: 25px;
        margin-bottom: 15px;
    }

    .stat-card {
        padding: 20px;
        border-radius: 12px;
    }

    .stat-card i {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }

    .stat-card h3 {
        font-size: 1.8rem;
    }

    .badge-custom {
        padding: 4px 12px;
        font-size: 0.8rem;
    }

    .btn-primary-custom {
        padding: 8px 20px;
        font-size: 14px;
    }

    .footer {
        padding: 30px 0 15px;
        margin-top: 50px;
    }

    .user-avatar-btn {
        padding: 4px 12px 4px 4px;
        gap: 6px;
    }

    .user-avatar-btn img,
    .user-avatar-btn .avatar-placeholder {
        width: 30px;
        height: 30px;
    }

    .user-avatar-btn span {
        font-size: 13px;
        max-width: 70px;
    }

    .user-dropdown-menu {
        min-width: 200px;
        padding: 6px;
        border-radius: 12px;
    }

    .user-dropdown-header {
        padding: 10px;
        gap: 10px;
    }

    .user-dropdown-header img,
    .user-dropdown-header .avatar-lg {
        width: 40px;
        height: 40px;
    }

    .dropdown-item {
        padding: 8px 10px;
        font-size: 13px;
    }

    .language-switcher {
        flex-wrap: wrap;
        gap: 10px;
    }

    .language-switcher a {
        padding: 3px 7px;
        font-size: 12px;
        border-radius: 4px;
    }

    .hemis-alert {
        padding: 11px 13px;
        font-size: 13px;
        border-radius: 8px;
    }

    .hemis-modal-content {
        max-width: 340px;
        padding: 25px 15px;
    }

    .hemis-modal-header i {
        font-size: 42px;
    }

    .hemis-modal-header h5 {
        font-size: 17px;
    }

    .hemis-close {
        right: 12px;
        top: 12px;
        font-size: 24px;
    }

    .hemis-options {
        gap: 12px;
    }

    .hemis-option {
        padding: 16px 8px;
        font-size: 13px;
        gap: 8px;
    }

    .hemis-option i {
        font-size: 26px;
    }
}

/* Mobile Small (480px) */
@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .hero-section {
        padding: 35px 0;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .book-card img {
        height: 300px;
    }

    .stat-card h3 {
        font-size: 1.6rem;
    }

    .user-avatar-btn span {
        max-width: 60px;
        font-size: 12px;
    }

    .user-dropdown-menu {
        min-width: 180px;
    }

    .language-switcher a {
        padding: 2px 6px;
        font-size: 14px;
    }

    .hemis-modal-content {
        max-width: 300px;
        padding: 20px 12px;
    }

    .hemis-modal-header h5 {
        font-size: 16px;
    }

    .hemis-option {
        padding: 14px 6px;
        font-size: 12px;
    }

    .hemis-option i {
        font-size: 24px;
    }
}
