/* ===== Основные стили Bookly ===== */

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.pricing-card:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.pricing-popular {
    border: 2px solid #6366f1;
    position: relative;
}

.pricing-popular::after {
    content: "Популярный";
    position: absolute;
    top: -12px;
    right: 20px;
    background: #6366f1;
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.modal {
    transition: opacity 0.3s ease;
}

#bookModal .sm\:max-w-4xl {
    max-width: 56rem;
}

/* Кнопка "Показать еще" */
#show-more-btn {
    display: inline-flex;
    margin: 2rem auto;
}

#show-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#books-loader {
    transition: opacity 0.3s ease;
}

/* Стили для поиска */
#search-button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    /* Фиолетовый стиль Bookly */
    border: 1px solid #6366f1;
    background-color: #6366f1;
    color: white;
    transition: all 0.2s ease;
    position: absolute;
    right: 10px; /* Сдвинул на 2px вправо (было 8px) */
    top: 50%;
    transform: translateY(-50%);
}

#search-button:hover {
    background-color: #4f46e5;
    border-color: #4f46e5;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.dark #search-button {
    border-color: #818cf8;
    background-color: #818cf8;
}

.dark #search-button:hover {
    background-color: #6366f1;
    border-color: #6366f1;
    box-shadow: 0 2px 4px rgba(129, 140, 248, 0.3);
}

/* Стили для кнопки очистки */
#clear-search {
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    position: absolute;
    right: 50px; /* Отступ от кнопки поиска */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
}

#clear-search:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#clear-search:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark #clear-search:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Поле ввода поиска */
#search-input {
    border: 2px solid #d1d5db;
    transition: all 0.1s ease;
    outline: none;
    border-radius: 0.5rem;
    padding-right: 80px; /* 32px кнопка + 10px отступ + 24px крестик + 8px промежуток + 6px запаса */
    padding-left: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    width: 100%;
    height: 48px;
    box-sizing: border-box;
}

#search-input:hover {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

#search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.dark #search-input {
    border-color: #4b5563;
    background-color: #374151;
    color: white;
}

.dark #search-input:hover {
    border-color: #818cf8;
}

.dark #search-input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

/* Контейнер для поиска */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Адаптивность для поиска */
@media (max-width: 640px) {
    #search-button {
        width: 28px;
        height: 28px;
        right: 8px; /* 6px + 2px */
    }
    
    #clear-search {
        width: 20px;
        height: 20px;
        right: 42px; /* 28px кнопка + 8px отступ + 6px промежуток */
    }
    
    #search-input {
        padding-right: 62px;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
        height: 42px;
    }
}

/* Стили для кнопок жанров */
.genre-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #6b7280;
}

.dark .genre-btn {
    border-color: #4b5563;
    background-color: #374151;
    color: #d1d5db;
}

/* Активное состояние - полностью фиолетовая заливка */
.genre-btn.active-genre {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3), 0 2px 4px -1px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.dark .genre-btn.active-genre {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4), 0 2px 4px -1px rgba(99, 102, 241, 0.3);
}

/* Ховер эффект */
.genre-btn:not(.active-genre):hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.dark .genre-btn:not(.active-genre):hover {
    background-color: #4b5563;
    border-color: #6b7280;
    color: #e5e7eb;
}

/* Стили для кнопки избранного */
.favorites-circle-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #6b7280;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.dark .favorites-circle-btn {
    border-color: #4b5563;
    background-color: #374151;
    color: #d1d5db;
}

/* Активное состояние для кнопки избранного - полностью фиолетовая */
.favorites-circle-btn.active-genre {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3), 0 2px 4px -1px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.dark .favorites-circle-btn.active-genre {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4), 0 2px 4px -1px rgba(99, 102, 241, 0.3);
}

/* Ховер для кнопки избранного */
.favorites-circle-btn:not(.active-genre):hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.dark .favorites-circle-btn:not(.active-genre):hover {
    background-color: #4b5563;
    border-color: #6b7280;
    color: #e5e7eb;
}

/* Стили для кнопок навигации */
.genre-nav-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #6b7280;
    transition: all 0.2s ease;
}

.dark .genre-nav-btn {
    border-color: #4b5563;
    background-color: #374151;
    color: #d1d5db;
}

.genre-nav-btn:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.dark .genre-nav-btn:hover {
    background-color: #4b5563;
    border-color: #6b7280;
    color: #e5e7eb;
}

/* Анимация при наведении */
.genre-btn, .favorites-circle-btn, .genre-nav-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.genre-btn:active, .favorites-circle-btn:active, .genre-nav-btn:active {
    transform: scale(0.95);
}

/* Убираем любые другие стили которые могут переопределять фиолетовый цвет */
.genre-btn.active-genre,
.favorites-circle-btn.active-genre {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
    color: white !important;
}

/* Темная тема */
.dark {
    color-scheme: dark;
}

.dark body {
    background-color: #111827;
    color: #f3f4f6;
}

.dark .bg-white {
    background-color: #1f2937;
}

.dark .bg-gray-50 {
    background-color: #1f2937;
}

.dark .bg-gray-100 {
    background-color: #374151;
}

.dark .text-gray-900 {
    color: #f3f4f6;
}

.dark .text-gray-700 {
    color: #d1d5db;
}

.dark .text-gray-600 {
    color: #9ca3af;
}

.dark .text-gray-500 {
    color: #6b7280;
}

.dark .border-gray-300 {
    border-color: #4b5563;
}

.dark .shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.dark #bookModal .bg-white {
    background-color: #1f2937;
}

.dark footer {
    background-color: #111827;
}

/* Темный режим для фона пересказа книги */
.dark .modal-book-summary {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
}

.dark .summary-content {
    background-color: #1f2937 !important;
}

.dark .summary-content .bg-gradient-to-r {
    background: linear-gradient(to right, #374151, #4b5563) !important;
    border-color: #4b5563 !important;
    color: #e5e7eb !important;
}

.dark .summary-content h3,
.dark .summary-content h4 {
    color: #f9fafb !important;
}

.dark .summary-content p {
    color: #d1d5db !important;
}

.dark .meta-info .meta-row {
    border-color: #4b5563 !important;
    background-color: #374151 !important;
}

.dark .meta-info span {
    color: #d1d5db !important;
}

.dark .meta-info .font-semibold {
    color: #e5e7eb !important;
}

/* Специфические стили для контента пересказа */
.dark .summary-content .prose {
    color: #d1d5db !important;
}

.dark .summary-content .prose strong {
    color: #e5e7eb !important;
}

.dark .summary-content .prose em {
    color: #9ca3af !important;
}

/* Стили для списков в пересказе */
.dark .summary-content .prose ul,
.dark .summary-content .prose ol {
    color: #d1d5db !important;
}

.dark .summary-content .prose li {
    color: #d1d5db !important;
}

/* Стили для цитат в пересказе */
.dark .summary-content .prose blockquote {
    color: #9ca3af !important;
    border-left-color: #4b5563 !important;
    background-color: #374151 !important;
}

.friend-item {
        transition: background-color 0.2s ease;
        border-radius: 0.5rem;
}
    
.friend-item:hover {
    background-color: #f3f4f6;
}
    
.dark .friend-item:hover {
    background-color: #374151;
}
    
.friend-item.active {
    background-color: #e5e7eb;
}
    
.dark .friend-item.active {
    background-color: #4b5563;
}
    
.message {
    animation: fadeIn 0.3s ease;
}
    
.message.outgoing {
    margin-left: auto;
}
    
.message.incoming {
    margin-right: auto;
}
    
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}
    
.unread-count {
    transition: all 0.3s ease;
    font-size: 0.75rem;
}
    
.friend-request-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem;
}
    
.dark .friend-request-item {
    border-bottom: 1px solid #4b5563;
}
    
.accept-request, .decline-request, .cancel-request {
    transition: color 0.2s ease;
}
    
.accept-request:hover {
    color: #059669 !important;
}
    
.decline-request:hover {
    color: #dc2626 !important;
}
    
.cancel-request:hover {
    color: #374151 !important;
}
    
.dark .cancel-request:hover {
    color: #d1d5db !important;
}


/* Мобильное меню */
.mobile-menu {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.mobile-menu.open {
    max-height: 500px;
}

.mobile-user-avatar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-user-avatar {
        display: flex;
        align-items: center;
    }

    .mobile-auth-button {
        display: block;
    }

    #mobile-user-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        background: white;
        border-radius: 0.5rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        z-index: 50;
        min-width: 150px;
        display: none;
    }

    .dark #mobile-user-dropdown {
        background: #374151;
    }

    #mobile-user-dropdown.show {
        display: block;
    }

    .mobile-dropdown-item {
        padding: 0.75rem 1rem;
        display: block;
        color: #374151;
        font-size: 0.875rem;
    }

    .dark .mobile-dropdown-item {
        color: #e5e7eb;
    }

    .mobile-dropdown-item:hover {
        background: #f3f4f6;
    }

    .dark .mobile-dropdown-item:hover {
        background: #4b5563;
    }
}

/* Модальное окно авторизации */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.auth-tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-weight: 500;
}

.auth-tab.active {
    border-bottom: 2px solid #6366f1 !important;
    color: #6366f1 !important;
}

.auth-tab:not(.active) {
    border-bottom: 2px solid transparent;
    color: #6b7280;
}

.dark .auth-tab:not(.active) {
    color: #9ca3af;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
}

.dark .form-input {
    background-color: #374151;
    border-color: #4b5563;
    color: white;
}

.form-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.auth-success {
    background-color: #dcfce7;
    border: 1px solid #22c55e;
    color: #166534;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.dark .auth-success {
    background-color: #166534;
    color: #dcfce7;
}

/* Форма регистрации */
.grid.grid-cols-2.gap-4 {
    gap: 1rem;
}

.form-input[type="date"] {
    padding: 0.7rem;
}

.form-input[type="password"] {
    padding: 0.7rem;
}

select.form-input {
    padding: 0.7rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1.2rem;
    padding-right: 2.5rem;
}

.dark select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Профиль пользователя */
#profile-avatar-preview {
    transition: all 0.3s ease;
    cursor: pointer;
}

#profile-avatar-preview:hover {
    transform: scale(1.05);
}

#profile-avatar-preview::after {
    content: '✎';
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#profile-avatar-preview:hover::after {
    opacity: 1;
}

/* Аватары */
#user-avatar,
#mobile-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #6366f1;
    color: white;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    #user-avatar,
    #mobile-user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

.hidden {
    display: none;
}

/* Бейджи подписок */
.subscription-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.subscription-badge[data-subscription="free"] {
    background-color: #9CA3AF;
    color: white;
}

.subscription-badge[data-subscription="pro"] {
    background-color: #10B981;
    color: white;
}

.subscription-badge[data-subscription="unlimited"] {
    background-color: #8B5CF6;
    color: white;
}

.subscription-badge[data-subscription="admin"] {
    background-color: #144efb;
    color: white;
}

/* Кнопка "Читать" */
.read-btn {
    background: #6366f1;
    border: none;
    color: white;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 80px;
    border-radius: 0.375rem;
}

.read-btn:hover {
    background: #4f46e5;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

/* Анимации */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* Лоадер */
.loader {
    display: none;
    width: 48px;
    height: 48px;
    border: 5px solid #f3f4f6;
    border-bottom-color: #4f46e5;
    border-radius: 50%;
    animation: rotation 1s linear infinite;
    margin: 20px auto;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Кнопка избранного */
.favorite-btn {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.favorite-btn i.fa-star {
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
}

.favorite-btn i.fas.fa-star {
    color: #fbbf24 !important;
}

.favorite-btn i.far.fa-star {
    color: #9ca3af !important;
}

.favorite-btn:hover i {
    transform: scale(1.25);
    transition: transform 0.2s ease;
}

/* Круглая кнопка избранного */
.favorites-circle-btn {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorites-circle-btn:hover {
    background-color: #f9fafb;
}

.favorites-circle-btn.active-genre {
    background-color: #6366f1;
    border-color: #6366f1;
}

.favorites-circle-btn.active-genre i {
    color: white !important; /* Это меняет цвет на белый */
}

.favorites-circle-btn:not(.active-genre) i {
    color: #f59e0b !important;
}

.dark .favorites-circle-btn {
    border-color: #4b5563;
}

.dark .favorites-circle-btn:hover {
    border-color: #818cf8;
    background-color: #374151;
}

.dark .favorites-circle-btn i {
    color: #fcd34d !important;
}

/* Cookie баннер */
#cookie-banner {
    transform: translateY(100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    background: rgba(17, 24, 39, 0.95);
}

#cookie-banner.translate-y-0 {
    transform: translateY(0);
}

#cookie-banner.translate-y-full {
    transform: translateY(100%);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#cookie-banner {
    animation: slideUp 0.5s ease-out forwards;
}

@media (max-width: 768px) {
    #cookie-banner {
        padding: 16px;
    }
}

/* Утилитарные классы */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Адаптивность */
@media (max-width: 640px) {
    .genre-btn {
        padding: 0.35rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .read-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        min-width: 70px;
    }
    
    .book-card {
        margin-bottom: 1rem;
    }
    
    #search-button {
        width: 28px;
        height: 28px;
    }
    
    #clear-search {
        width: 20px;
        height: 20px;
    }
}

/* Вкладки профиля */
.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
}

.profile-tab.active {
    border-bottom: 2px solid #6366f1 !important;
    color: #111827 !important;
}

.dark .profile-tab.active {
    color: #ffffff !important;
}

/* Счетчик просмотров */
.fa-eye {
    font-size: 11px;
}

.book-card .flex.items-center.text-gray-500 {
    transition: opacity 0.2s ease;
}

.book-card:hover .flex.items-center.text-gray-500 {
    opacity: 0.8;
}

.dark .book-card .flex.items-center.text-gray-500 {
    color: #9CA3AF;
}
.context-menu {
    min-width: 120px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.context-menu button {
    transition: background-color 0.2s;
}

.context-menu button:hover {
    background-color: #f3f4f6;
}

.dark .context-menu {
    border-color: #4b5563;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.dark .context-menu button:hover {
    background-color: #374151;
}

.status-online {
    background-color: #10B981; /* зеленый */
}

.status-recently {
    background-color: #F59E0B; /* оранжевый */
}

.status-offline {
    background-color: #9CA3AF; /* серый */
}
/* Анимации для плавного перехода */
.friends-list {
    transition: transform 0.3s ease;
}

/* Скрываем кнопки на десктопе */
@media (min-width: 768px) {
    #toggleFriendsList, #backToFriends {
        display: none !important;
    }
}

/* Адаптивные отступы для мобильных */
@media (max-width: 767px) {
    #chatModal .sm\:max-w-6xl {
        max-width: 100% !important;
        margin: 0.5rem !important;
    }
    
    .chat-container {
        height: 80vh !important;
        min-height: 400px !important;
    }
    
    .friends-list {
        width: 80% !important;
        max-width: 300px;
        box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    }
}

/* Скрываем кнопку с тремя точками по умолчанию */
.friend-more-btn {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Показываем кнопку при наведении на элемент друга */
.friend-item:hover .friend-more-btn {
    opacity: 1;
    visibility: visible;
}

.dark .friend-more-btn {
    color: #d1d5db;
}

.dark .friend-more-btn:hover {
    color: #f9fafb;
}

/* Для мобильных устройств всегда показываем кнопку */
@media (max-width: 768px) {
    .friend-more-btn {
        opacity: 1;
        visibility: visible;
    }
}

/* Добавьте эти стили в ваш CSS */
#friends-list-container {
    position: relative;
    overflow-y: auto;
}

.context-menu {
    position: fixed; /* Изменяем на fixed */
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    min-width: 120px;
    z-index: 1000;
}

.dark .context-menu {
    background: #374151;
    border-color: #4b5563;
}

.context-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.context-menu button:hover {
    background-color: #f3f4f6;
}

.dark .context-menu button:hover {
    background-color: #4b5563;
}

/* Стили для уведомлений */
#messages-notifications > * { pointer-events: auto; }

.notification-enter {
    animation: notificationSlideIn 0.3s ease-out;
}

.notification-exit {
    animation: notificationSlideOut 0.3s ease-in;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes notificationSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Адаптивность для мобильных */
@media (max-width: 640px) {
    #messages-notifications {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Добавим в ваш CSS файл */
.notification-container {
    position: fixed;
    right: 1rem;
    top: 5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 320px;
}

.notification {
    background: white;
    border-left: 4px solid #6366f1;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: all 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification .avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #4f46e5;
    flex-shrink: 0;
}

.notification .content {
    flex-grow: 1;
}

.notification .close-btn {
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
}

.dark .notification {
    background: #374151;
    border-left-color: #818cf8;
}

.dark .notification .avatar {
    background: #1e1b4b;
    color: #a5b4fc;
}
/* Важные стили для панели эмодзи */
.message-input-container {
    position: relative;
}

/* Эмодзи крупнее внутри пузыря сообщения */
.msg-text .emoji {
  font-size: 1.6em;      /* ↑ масштаб только для эмодзи */
  line-height: 1;
  vertical-align: -0.1em; /* чутка опустить, чтобы не «выпрыгивали» */
}

/* Если сообщение состоит только из эмодзи — можно сделать их ещё крупнее */
.msg-text.only-emoji {    /* сам контейнер крупный... */
  font-size: 2.25rem;
  line-height: 1.1;
}
.msg-text.only-emoji .emoji { /* ...а сами эмодзи 1:1 внутри */
  font-size: 1em;
}

/* Утилиты для скрытия/показа */
.hidden {
    display: none;
}

/* Обрезка текста */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Анимации для плавного перехода */
main {
    transition: opacity 0.3s ease;
}

.catalog-book-card {
    transition: all 0.3s ease;
}

.catalog-book-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Для темной темы */
.dark .catalog-book-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.book-card {
    transition: all 0.3s ease;
}

.book-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.dark .book-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
}

/* Анимации для модального окна */
#bookModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
}

#bookModal.active .modal-overlay {
    opacity: 0.5;
}

#bookModal.active .modal-container {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-overlay {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal-container {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition-property: opacity, transform;
}

/* Анимации для модального окна */
#bookModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
}

#bookModal.active .modal-overlay {
    opacity: 0.5;
}

#bookModal.active .modal-container {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-overlay {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal-container {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition-property: opacity, transform;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.modal-header {
    flex-shrink: 0;
}

.modal-content {
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    flex-shrink: 0;
}

/* Кастомный скроллбар для модального окна */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark .modal-content::-webkit-scrollbar-track {
    background: #374151;
}

.dark .modal-content::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark .modal-content::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Анимация для кнопки закрытия */
#closeModal {
    transform: scale(0);
    transition: transform 0.2s ease-in-out;
}

#bookModal.active #closeModal {
    transform: scale(1);
    transition-delay: 0.1s;
}