/* Стили для счетчика избранного */

.bookmark-counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: #6b7280;
    transition: all 0.3s ease;
}

.bookmark-counter-clickable {
    cursor: pointer;
    border-radius: 4px;
    padding: 6px 8px;
    transition: all 0.3s ease;
    background-color: #f3f4f6;
    font-size: 14px;
}

.bookmark-counter-clickable:hover {
    background-color: #f59e0b;
    color: white;
}

.bookmark-counter i {
    font-size: 0.9rem;
    color: #f59e0b;
}

.bookmark-counter-clickable:hover i {
    color: white;
}

.bookmark-counter-text {
    font-weight: 500;
    min-width: 16px;
    text-align: center;
}

/* Интеграция со стилями кнопки избранного */
.bookmark-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.bookmark-btn i {
    font-size: 18px;
    transition: color 0.2s ease, transform 0.2s ease;
    color: #999;
}

.bookmark-btn:hover{
		background-color: hsla(0, 0%, 100%, 0);
		color: #ffffff;
} 

.bookmark-btn .bookmark-counter {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    min-width: 20px;
    text-align: center;
}

.bookmark-btn .bookmark-counter-clickable {
    padding: 0;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bookmark-btn .bookmark-counter-clickable:hover {
    color: #f59e0b;
}

/* При наведении на кнопку */
.bookmark-btn:hover i {
    color: #f59e0b;
    transform: scale(1.1);
}

.bookmark-btn:hover .bookmark-counter {
    color: #f59e0b;
}

/* Активное состояние - полностью оранжевая иконка (добавлено в избранное) */
.bookmark-btn.active i {
    color: #f59e0b;
    fill: #f59e0b;
}

.bookmark-btn.active .bookmark-counter {
    color: #f59e0b;
    font-weight: 700;
}

/* Текст кнопки скрывается */
.bookmark-btn .bookmark-text {
    display: none;
}

/* КРАСИВОЕ МОДАЛЬНОЕ ОКНО ИЗБРАННОГО */
.bookmarks-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.bookmarks-popup.active {
    display: flex;
    animation: fadeInOverlay 0.3s ease;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
}
.action-btn:hover {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

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

.bookmarks-popup-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 0;
    max-width: 650px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 10px 25px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    animation: popupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(40px) rotateY(10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0) rotateY(0deg);
    }
}

/* ЗАГОЛОВОК МОДАЛЬНОГО ОКНА */
.bookmarks-popup-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    position: relative;
}

.bookmarks-popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    pointer-events: none;
}

.bookmarks-popup-title {
    margin: 0;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bookmarks-popup-title::before {
    content: '⭐';
    font-size: 1.2em;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(5deg); }
}

.bookmarks-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.bookmarks-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg) scale(1.1);
}

/* СПИСОК ПОЛЬЗОВАТЕЛЕЙ */
.bookmarks-users-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    max-height: 60vh;
    overflow-y: auto;
}

.bookmarks-users-list::-webkit-scrollbar {
    width: 12px;
}

.bookmarks-users-list::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 10px;
    margin: 8px;
}

.bookmarks-users-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    border-radius: 10px;
    border: 2px solid #f1f5f9;
    transition: all 0.3s ease;
}

.bookmarks-users-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
    transform: scale(1.1);
}

/* КАРТОЧКИ ПОЛЬЗОВАТЕЛЕЙ - КОМПАКТНЫЙ ВИД */
.bookmark-user-item {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 8px;
}

/* Анимации удалены для более быстрого и компактного отображения */

/* АВАТАРЫ - КОМПАКТНЫЙ ВИД */
.bookmark-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f59e0b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.bookmark-user-item:hover {
    background: linear-gradient(145deg, #fef3e2 0%, #fef9e7 100%);
    border-color: #f59e0b;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.2);
    transform: translateY(-1px);
}

.bookmark-user-item:hover .bookmark-user-avatar {
    border-color: #d97706;
    transform: scale(1.05);
}

/* ИНФОРМАЦИЯ О ПОЛЬЗОВАТЕЛE - КОМПАКТНЫЙ ВИД */
.bookmark-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.bookmark-user-name {
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px 0;
    font-size: 1rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bookmark-user-nickname {
    color: #374151;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.bookmark-user-nickname:hover {
    color: #f59e0b;
    text-decoration: underline;
}

.bookmark-user-date {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 400;
}

.bookmark-user-date i {
    color: #f59e0b;
    font-size: 0.7rem;
}

/* СОСТОЯНИЕ БЕЗ ДАННЫХ */
.no-bookmarks {
    text-align: center;
    padding: 60px 30px;
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    margin: 20px;
}

.no-bookmarks i {
    font-size: 4rem;
    background: linear-gradient(45deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.no-bookmarks h4 {
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 1.25rem;
    font-weight: 700;
}

.no-bookmarks p {
    margin: 0;
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 768px) {

    .bookmark-user-item {
            margin-bottom: 4px;
        }

    .bookmarks-popup-content {
        margin: 15px;
        border-radius: 16px;
        max-width: calc(100vw - 30px);
    }
    
    .bookmarks-popup-header {
        padding: 16px 20px;
    }
    
    .bookmarks-popup-title {
        font-size: 1.2rem;
    }
    
    .bookmarks-users-list {
        padding: 10px;
        gap: 5px;
        justify-content: center;
    }
    
    .bookmark-user-item {
        padding: 8px;
    }
    
    .bookmark-user-avatar {
        width: 50px;
        height: 50px;
    }
    
    .bookmark-user-name {
        font-size: 0.9rem;
    }
    
    .bookmark-user-nickname {
        font-size: 0.8rem;
    }
    
    .bookmark-user-date {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .bookmarks-popup-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .bookmarks-users-list {
        padding: 5px;
        gap: 0;
    }
    
    .bookmark-user-item {
        padding: 8px;
    }
    
    .bookmark-user-avatar {
        width: 45px;
        height: 45px;
    }
}

/* Анимации загрузки */
.bookmark-counter.loading {
    opacity: 0.6;
    pointer-events: none;
}

.bookmark-counter.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #f59e0b;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: bookmarkSpin 0.8s linear infinite;
    margin-left: 4px;
}

@keyframes bookmarkSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Интеграция в карточки статей */
.article-card .bookmark-counter,
.article-item .bookmark-counter,
.stats-item .bookmark-counter {
    font-size: 0.875rem;
}

.article-stats .bookmark-counter {
    color: #f59e0b;
    font-weight: 500;
}

/* Стили для мини-счетчика */
.bookmark-counter-mini {
    font-size: 0.75rem;
    padding: 1px 4px;
}

.bookmark-counter-mini i {
    font-size: 0.75rem;
}

/* Успешное обновление */
.bookmark-counter-updated {
    animation: bookmarkPulse 0.5s ease;
}

@keyframes bookmarkPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Стили для списка в админ-панели */
.admin-bookmarks-stats .bookmark-counter {
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Tooltip стили */
.bookmark-counter[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 4px;
}

.bookmark-counter[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    z-index: 1000;
}
