/* ===================================
   BOOK DETAILS PAGE STYLES - DETAILS.CSS
   =================================== */

/* ========== MODERN CARD STYLES ========== */
.detail-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-color);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

    .detail-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-hover);
    }

/* ========== BOOK COVER STYLES ========== */
.book-cover-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    aspect-ratio: 2/3;
    max-width: 200px;
    margin: 0 auto;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .book-cover-wrapper:hover {
        /* Hover отключён по запросу */
    }

/* Lamination effect */
.cover-lamination {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient( 135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%, rgba(255, 255, 255, 0.1) 100% );
    border-radius: 8px;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: overlay;
    opacity: 0.4;
    animation: lamination-shimmer 8s infinite linear;
}

@keyframes lamination-shimmer {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(200%) rotate(45deg);
    }
}

/* Cover badges */
.cover-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 3;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    animation: badge-float 3s ease-in-out infinite;
}

    .cover-badge.featured-badge {
        background: linear-gradient(135deg, #f9c74f, #f8961e);
        color: #333;
    }

    .cover-badge.verified-badge {
        background: linear-gradient(135deg, #4cc9f0, #4895ef);
        color: white;
        top: 45px;
    }

@keyframes badge-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-3px) rotate(2deg);
    }
}

/* Cover image */
.book-cover-image {
    position: relative;
    z-index: 1;
    border-radius: 8px;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Hover на обложке отключён */

/* Placeholder */
.book-cover-placeholder {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-family: 'Georgia', serif;
    position: relative;
    width: 100%;
    height: 100%;
}

    .book-cover-placeholder::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
        animation: placeholder-shine 2s infinite linear;
    }

.book-cover-placeholder-letter {
    font-size: 4rem;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

@keyframes placeholder-shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ========== METADATA BADGES ========== */
.meta-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
    border: 2px solid transparent;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
    transition: all 0.3s ease;
}

    .meta-badge:hover {
        transform: translateY(-1px);
        background-color: var(--primary-light);
        color: var(--primary-color);
    }

.meta-badge-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

    .meta-badge-primary:hover {
        background-color: var(--secondary-color);
    }

/* ========== DESCRIPTION ========== */
/* ========== HERO INFO: блоки и отступы ========== */
.details-hero-info {
    padding-left: 0.5rem;
}

.details-hero-tagline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.details-tagline-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
}

.details-title {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    line-height: 1.3;
    color: var(--text-primary);
}

.details-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.details-author-block {
    padding-top: 0.25rem;
}

.details-meta {
    padding-top: 0.25rem;
}

.details-actions {
    padding-top: 0.5rem;
}

/* ========== БЛОК КРАТКОГО СОДЕРЖАНИЯ ========== */
.detail-card-summary .card-body {
    padding: 1.5rem 1.5rem !important;
}

@media (min-width: 768px) {
    .detail-card-summary .card-body {
        padding: 1.75rem 2rem !important;
    }
}

.detail-section-heading {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.details-char-count {
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color);
}

.book-description {
    line-height: 1.75;
    font-size: 1rem;
    color: var(--text-primary);
    max-width: 72ch;
    margin-top: 1rem;
}

    .book-description p {
        margin-bottom: 1.25rem;
    }

    .book-description br + br {
        display: block;
        content: "";
        margin-top: 0.75rem;
    }

/* ========== ACTION BUTTONS - MOBILE FIXED ========== */
.action-btn {
    padding: 12px 24px;
    border-radius: 12px !important;
    font-weight: 600;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    outline: none !important;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.2s ease;
    /* ✅ КРИТИЧНО для мобильных */
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
}

    .action-btn:active {
        transform: scale(0.98) !important;
        border-radius: 12px !important;
    }

    .action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(var(--bs-primary-rgb), 0.2);
    }

    .action-btn:focus {
        outline: none !important;
        box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.3) !important;
    }

    .action-btn i {
        font-size: 1.1rem;
        transition: transform 0.2s ease;
    }

    .action-btn:hover i {
        transform: translateX(3px);
    }

/* ========== STATS CONTAINER ========== */
.stats-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
    padding: 0.875rem;
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

    .stat-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px var(--shadow-hover);
    }

    .stat-item .stat-value {
        font-size: 1.6rem;
        font-weight: 700;
        color: var(--primary-color);
        margin-bottom: 0.375rem;
    }

    .stat-item .stat-label {
        font-size: 0.85rem;
        color: var(--text-tertiary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

/* ========== TAGS ========== */
.book-tags {
    margin-top: 1.5rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    color: white;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.2);
}

    .tag-badge:hover {
        background: linear-gradient(135deg, #7209b7, #4361ee);
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
        color: white;
        text-decoration: none;
    }

    .tag-badge i {
        font-size: 0.8rem;
    }

.category-tag {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 25px !important;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    outline: none !important;
    transition: all 0.3s ease;
}

    .category-tag:hover {
        background: rgba(var(--bs-primary-rgb), 0.2);
        transform: translateY(-2px);
        text-decoration: none;
        color: var(--primary-color);
        border-color: var(--primary-color);
    }

    .category-tag:active {
        transform: scale(0.98) !important;
        border-radius: 25px !important;
    }

/* ========== ICON CIRCLES ========== */
.icon-circle {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    transition: transform 0.3s ease;
}

    .icon-circle:hover {
        transform: scale(1.05);
    }

.bg-primary-circle {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.bg-success-circle {
    background: linear-gradient(135deg, #4cc9f0, #4895ef);
}

.bg-warning-circle {
    background: linear-gradient(135deg, #f9c74f, #f8961e);
}

.bg-info-circle {
    background: linear-gradient(135deg, #7209b7, #3a0ca3);
}

.bg-danger-circle {
    background: linear-gradient(135deg, #f72585, #b5179e);
}

/* ========== REPORT BUTTON ========== */
.btn-report {
    background-color: transparent;
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px !important;
    font-size: 0.9rem;
    outline: none !important;
    transition: all 0.3s ease;
}

    .btn-report:hover {
        background-color: rgba(220, 53, 69, 0.1);
        color: #dc3545;
        border-color: #dc3545;
        transform: translateY(-1px);
    }

    .btn-report:active {
        transform: scale(0.98) !important;
        border-radius: 8px !important;
    }

    .btn-report:focus {
        box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2) !important;
    }

/* ========== REPORT MODAL (форма жалобы) ========== */
#reportModal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border-color);
    overflow: hidden;
}

#reportModal .modal-header {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.08), rgba(220, 53, 69, 0.04));
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

#reportModal .modal-title {
    font-weight: 600;
    color: var(--text-primary);
}

#reportModal .modal-body {
    padding: 1.25rem 1.5rem;
}

#reportModal .form-label {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

#reportModal .form-select,
#reportModal .form-control {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.85rem;
    background: var(--card-bg);
    color: var(--text-primary);
}

#reportModal .form-select:focus,
#reportModal #reportDetails:focus {
    border-color: rgba(220, 53, 69, 0.5);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

#reportModal #reportDetails {
    resize: vertical;
    min-height: 100px;
}

#reportModal .alert-info {
    border-radius: 10px;
    border: 1px solid rgba(13, 202, 240, 0.25);
    background: rgba(13, 202, 240, 0.08);
}

#reportModal .modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
}

#reportModal .modal-footer .btn {
    border-radius: 10px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
}

/* ========== UNIFORM BLOCKS ========== */
.uniform-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.uniform-block {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

    .uniform-block:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 30px var(--shadow-hover);
        border-color: rgba(67, 97, 238, 0.2);
    }

/* ========== SIMILAR BOOKS ========== */
.similar-books-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.similar-book-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    outline: none !important;
    transition: all 0.3s ease;
}

    .similar-book-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px var(--shadow-hover);
        border-color: var(--primary-color);
        text-decoration: none;
        color: var(--text-primary);
    }

    .similar-book-card:active {
        transform: translateY(-1px);
    }

    .similar-book-card:focus {
        box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.2) !important;
    }

.similar-book-cover {
    width: 60px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.similar-book-cover-letter {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.similar-book-info {
    flex: 1;
    min-width: 0;
}

.similar-book-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.similar-book-authors {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== REVIEW CARDS ========== */
.review-card {
    border: none;
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 5px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

    .review-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px var(--shadow-hover);
    }

.rating-stars {
    color: #ffc107;
    font-size: 1.1rem;
}

/* ========== UTILITIES ========== */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: 2rem 0;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.reading-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4cd964, #5ac8fa);
    border-radius: 3px;
}

/* ========== DROPDOWN ========== */
.dropdown-menu {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px var(--shadow-hover);
}

.dropdown-item {
    color: var(--text-primary);
    outline: none !important;
}

    .dropdown-item:hover {
        background-color: var(--bg-secondary);
        color: var(--primary-color);
    }

    .dropdown-item:active {
        background-color: var(--primary-color);
        color: white;
    }

/* ========== DARK THEME ========== */
:root[data-theme="dark"] .book-cover-wrapper {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 5px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .cover-lamination {
    opacity: 0.3;
    background: linear-gradient( 135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 25%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.08) 75%, rgba(255, 255, 255, 0.15) 100% );
}

:root[data-theme="dark"] .tag-badge {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

    :root[data-theme="dark"] .tag-badge:hover {
        background: linear-gradient(135deg, #7209b7, #4361ee);
        box-shadow: 0 4px 15px rgba(67, 97, 238, 0.5);
    }

:root[data-theme="dark"] .similar-book-cover {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

:root[data-theme="dark"] .gradient-text {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

:root[data-theme="dark"] .btn-report:hover {
    background-color: rgba(220, 53, 69, 0.15);
    color: #ff6b6b;
    border-color: #ff6b6b;
}

/* Тех. информация: светлые лейблы в тёмной теме */
:root[data-theme="dark"] .uniform-block small.text-muted {
    color: rgba(255, 255, 255, 0.75) !important;
}

:root[data-theme="dark"] .uniform-block .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Форма жалобы: placeholder и кнопка закрыть в тёмной теме */
:root[data-theme="dark"] #reportModal .modal-content {
    background: var(--card-bg);
}

:root[data-theme="dark"] #reportModal #reportDetails::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

:root[data-theme="dark"] #reportModal .modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(2);
    opacity: 0.9;
}

:root[data-theme="dark"] #reportModal .modal-header .btn-close:hover {
    opacity: 1;
}

/* Окно увеличенной обложки: кнопка закрыть в тёмной теме */
:root[data-theme="dark"] #coverPreviewModal .modal-content {
    background: var(--card-bg);
}

:root[data-theme="dark"] #coverPreviewModal .modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(2);
    opacity: 0.9;
}

:root[data-theme="dark"] #coverPreviewModal .modal-header .btn-close:hover {
    opacity: 1;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .action-btn {
        padding: 14px 20px;
        font-size: 1rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .stat-item {
        padding: 0.75rem;
    }

    .book-cover-placeholder-letter {
        font-size: 3.2rem;
    }

    .book-cover-wrapper {
        height: 280px;
    }

    .uniform-blocks {
        grid-template-columns: 1fr;
    }

    .detail-card {
        margin-bottom: 1rem;
    }

    .similar-book-cover {
        width: 50px;
        height: 70px;
    }

    .similar-book-cover-letter {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .meta-badge {
        margin-bottom: 0.5rem;
    }

    .dropdown {
        width: 100%;
    }

        .dropdown .action-btn {
            width: 100%;
        }

    .similar-book-card {
        padding: 0.75rem;
    }

    .similar-book-cover {
        width: 45px;
        height: 65px;
    }

    .tag-badge {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

/* ========== MOBILE FIXES ========== */
@media (max-width: 768px) {
    /* Убираем сложные эффекты на мобильных */
    .action-btn:hover {
        transform: none;
    }

    /* Увеличиваем область клика */
    .btn, .action-btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    /* Убираем transitions для лучшей производительности */
    * {
        transition: none !important;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

.book-share {
    color: #9ca3af;
}


[data-theme="dark"] .book-share {
    color: #d1d5db;
}