.book-detail-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin: 30px 0;
}

.book-cover-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.book-cover-img {
    width: 90%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.book-cover-img:hover {
    transform: scale(1.02);
}

.hemis-info-text {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 500;
}

.hemis-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.hemis-btn {
    width: auto;
    padding: 12px 25px;
    background: white;
    border: 2px solid #0063AF;
    border-radius: 8px;
    color: #0063AF;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.hemis-btn:hover {
    background: #0063AF;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 99, 175, 0.3);
}

.hemis-btn i {
    font-size: 16px;
}

/* Modal */
.hemis-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.hemis-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.hemis-modal-header i {
    font-size: 50px;
    color: #0063AF;
    margin-bottom: 15px;
}

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

.hemis-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    background: none;
    border: none;
    line-height: 1;
}

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

.hemis-options {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.hemis-option {
    flex: 1;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 16px;
}

.hemis-option.talaba {
    background: #0063AF;
    color: white;
}

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

.hemis-option.oqituvchi {
    background: #0063AF;
    color: white;
}

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.qr-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
}

.qr-section h6 {
    color: #0063AF;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qr-code-container-inner {
    position: relative;
    display: inline-block;
}

.qr-code-img {
    width: 100% !important;
    max-width: 250px !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    display: block !important;
    margin: 0 auto !important;
}

/* 3. Column - Protection */
.col-lg-3 {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* 4. Container - Extra protection */
.qr-code-container-inner {
    max-width: 100% !important;
    display: inline-block !important;
}

.qr-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    padding: 0px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.qr-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.social-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
}

.social-section h6 {
    color: #0063AF;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
    text-decoration: none;
    color: white;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    color: white;
}

.social-link.telegram {
    background: #0088cc;
}

.social-link.facebook {
    background: #1877f2;
}

.social-link.twitter {
    background: #1da1f2;
}

.social-link.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-link.youtube {
    background: #ff0000;
}

.book-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    line-height: 1.3;
}

.stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #f0f8ff;
    border-radius: 20px;
    margin-right: 12px;
    font-size: 14px;
    color: #0063AF;
    margin-bottom: 10px;
}

.stats-badge i {
    color: #0063AF;
}

.success-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: #5bca49;
    border-radius: 15px;
    font-size: 16px;
    color: #fff;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: #00b4d8;
    border-radius: 15px;
    font-size: 16px;
    color: #fff;
}


.info-table {
    width: 100%;
    margin-top: 20px;
}

.info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
    min-width: 160px;
}

.info-value {
    color: #1a1a1a;
    font-size: 15px;
    flex: 1;
}

.info-value a {
    color: #0063AF;
    text-decoration: none;
    transition: color 0.3s;
}

.info-value a:hover {
    color: #004d87;
    text-decoration: underline;
}

/* Kitob ta'rifi */
.book-description-section {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-top: 30px;
}

.book-description-section h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0063AF;
}

.book-description-section p {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
    text-align: justify;
}

@media (max-width: 991px) {
    .book-detail-container {
        padding: 25px;
    }

    .book-title {
        font-size: 22px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .info-label {
        min-width: auto;
    }

    .hemis-options {
        flex-direction: column;
    }

    .hemis-modal-content {
        padding: 30px 20px;
    }

    .qr-code-img {
        max-width: 200px;
    }
}

/* ═══ Tablet (768px) ═══ */
@media (max-width: 768px) {
    .book-detail-container {
        padding: 20px;
        margin: 20px 0;
    }

    .book-cover-wrapper {
        margin-bottom: 15px;
    }

    .book-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .stats-badge {
        font-size: 13px;
        padding: 6px 12px;
        margin-right: 8px;
        margin-bottom: 8px;
    }

    .success-badge {
        font-size: 13px;
        padding: 6px 12px;
    }

    .info-badge {
        font-size: 13px;
        padding: 6px 12px;
    }

    .info-label {
        font-size: 13px;
    }

    .info-value {
        font-size: 14px;
    }

    .book-description-section {
        padding: 25px 20px;
        margin-top: 20px;
    }

    .book-description-section h3 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .book-description-section p {
        font-size: 14px;
    }

    .qr-section,
    .social-section {
        padding: 20px;
        margin-bottom: 20px;
    }

    .qr-code-img {
        max-width: 180px;
    }

    .qr-logo {
        width: 40px;
        height: 40px;
    }

    .social-link {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }

    .hemis-modal-content {
        max-width: 380px;
        padding: 30px 18px;
    }

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

    .hemis-option {
        padding: 18px 8px;
        font-size: 14px;
    }

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

/* ═══ Mobile Large (576px) ═══ */
@media (max-width: 576px) {
    .book-detail-container {
        padding: 15px;
        margin: 15px 0;
        border-radius: 12px;
    }

    .book-cover-img {
        border-radius: 8px;
        margin-bottom: 12px;
    }

    .book-title {
        font-size: 18px;
        margin-bottom: 12px;
        line-height: 1.4;
    }

    .stats-badge {
        font-size: 12px;
        padding: 5px 10px;
        margin-right: 6px;
        margin-bottom: 6px;
        gap: 6px;
    }

    .info-table {
        margin-top: 15px;
    }

    .info-row {
        padding: 10px 0;
    }

    .info-label {
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 3px;
    }

    .info-value {
        font-size: 13px;
    }

    .book-description-section {
        padding: 20px 15px;
        margin-top: 15px;
        border-radius: 12px;
    }

    .book-description-section h3 {
        font-size: 18px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .book-description-section p {
        font-size: 13px;
        line-height: 1.7;
    }

    .qr-section,
    .social-section {
        padding: 18px 15px;
        margin-bottom: 15px;
        border-radius: 8px;
    }

    .qr-section h6,
    .social-section h6 {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .qr-code-img {
        max-width: 160px;
    }

    .qr-logo {
        width: 35px;
        height: 35px;
    }

    .social-links {
        gap: 10px;
    }

    .social-link {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .hemis-info-text {
        font-size: 12px;
        margin-top: 15px;
        margin-bottom: 8px;
    }

    .hemis-btn {
        padding: 10px 20px;
        font-size: 13px;
        gap: 6px;
    }

    .hemis-btn i {
        font-size: 15px;
    }

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

    .hemis-modal-header {
        margin-bottom: 20px;
    }

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

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

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

    .hemis-options {
        gap: 12px;
        margin-top: 18px;
    }

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

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

    .hemis-alert {
        padding: 12px 14px;
        font-size: 13px;
        gap: 8px;
        margin: 10px 0;
        border-radius: 6px;
    }

    .hemis-alert button {
        font-size: 18px;
    }
}

/* ═══ Mobile Small (480px) ═══ */
@media (max-width: 480px) {
    .book-detail-container {
        padding: 12px;
        border-radius: 10px;
    }

    .book-title {
        font-size: 17px;
    }

    .stats-badge {
        font-size: 11px;
        padding: 4px 9px;
    }

    .info-label,
    .info-value {
        font-size: 12px;
    }

    .book-description-section {
        padding: 15px 12px;
    }

    .book-description-section h3 {
        font-size: 16px;
    }

    .book-description-section p {
        font-size: 12px;
    }

    .qr-code-img {
        max-width: 140px;
    }

    .qr-logo {
        width: 30px;
        height: 30px;
    }

    .social-link {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .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;
    }
}

.hemis-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    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;
    padding: 0 4px;
    color: inherit;
    transition: opacity 0.2s;
}

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

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

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

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

.related-books-section {
    padding: 2rem 0;
    border-top: 2px solid #e9ecef;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0063AF;
    margin-bottom: 2rem;
}

.related-book-card {
    display: block;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.related-book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 99, 175, 0.2);
}

.related-book-cover {
    position: relative;
    width: 100%;
    padding-top: 140%; /* 1:1.4 aspect ratio */
    overflow: hidden;
    background: linear-gradient(135deg, #0063AF 0%, #004d8a 100%);
}

.related-book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-book-card:hover .related-book-cover img {
    transform: scale(1.05);
}

.related-book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 99, 175, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.related-book-card:hover .related-book-overlay {
    opacity: 1;
}

.related-book-overlay i {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
}

.related-book-overlay span {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.related-book-info {
    padding: 1rem;
}

.related-book-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;
}

.related-book-author {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.related-book-author i {
    font-size: 0.75rem;
    color: #0063AF;
}

.related-book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-book-category {
    font-size: 0.75rem;
    background: linear-gradient(135deg, #0063AF 0%, #004d8a 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.related-book-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #95a5a6;
}

.related-book-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.related-book-stats i {
    font-size: 0.7rem;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .related-book-card {
        max-width: 180px;
        margin: 0 auto;
    }

    .section-title {
        font-size: 1.4rem;
    }
}
