/* CommentPro - Дополнительные стили для комментариев */

/* Кнопка спойлера в тулбаре редактора */
.commentpro-standalone-container .ql-spoiler,
.commentpro .ql-spoiler {
    width: auto !important;
    min-width: 28px;
    font-size: 12px;
}

/* Аватар комментария */
.commentpro-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.commentpro-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Стили для формы */
.commentpro-form_group {
    margin-top: 10px;
}

/* Тело комментария */
.commentpro-body {
    width: calc(100% - 50px);
    margin: 0 0 10px;
}

.commentpro-text {
    margin: 8px 0 10px;
    word-wrap: break-word;
}

/* Индикатор ответа */
.commentpro-reply-to {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.commentpro-reply-to strong {
    color: var(--main-color, #e91e63);
}

/* Стили для дочерних комментариев (ответов) */
.commentpro-items_child {
    margin-left: 40px;
    margin-top: 10px;
    padding-left: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    list-style: none;
}

body:not(.dark) .commentpro-items_child {
    border-left-color: rgba(0, 0, 0, 0.1);
}

/* Фиксированная форма комментариев для ПК */
@media (min-width: 769px) {
    .commentpro.two-columns {
        display: flex;
        gap: 20px;
        align-items: flex-start;
    }
    
    .commentpro-form-wrapper {
        position: sticky;
        top: 20px;
        flex: 0 0 400px;
        max-width: 400px;
    }
    
    .commentpro-comments {
        flex: 1;
        min-width: 0;
    }
}

/* Стили для селектора аватаров */
.avatar-selector {
    position: relative;
    z-index: 1;
}

.avatar-selector-trigger {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--main-color, #e91e63);
    transition: transform 0.2s;
}


.avatar-selector-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
}

.avatar-selector-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background: var(--color-player-gray-16, #1a1a1a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    display: none;
    grid-template-columns: repeat(4, 50px);
    gap: 10px;
    z-index: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.avatar-selector-dropdown[style*="display: grid"] {
    display: grid !important;
}

body:not(.dark) .avatar-selector-dropdown {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

.avatar-option {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
}

.avatar-option:hover {
    border-color: var(--main-color, #e91e63);
}

.avatar-option.selected {
    border-color: var(--main-color, #e91e63);
}

/* Спиннер загрузки */
.commentpro-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
}

.commentpro-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid var(--main-color, #e91e63);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Сообщения */
.commentpro-no-comments {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
}

.commentpro-error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    margin: 10px 0;
}

/* Всплывающие уведомления */
.commentpro-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    z-index: 99999;
    animation: slideInRight 0.3s ease;
    max-width: 350px;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.commentpro-notification--success {
    background: #28a745;
}

.commentpro-notification--error {
    background: #dc3545;
}

.commentpro-notification--info {
    background: #007bff;
}

@keyframes slideInRight {
    from { 
        transform: translateX(400px);
        opacity: 0;
    }
    to { 
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from { 
        transform: translateX(0);
        opacity: 1;
    }
    to { 
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ==================== Admin comment styles ==================== */

.commentpro-admin {
    position: relative;
    border-left: 3px solid #ffd700 !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(255, 140, 0, 0.03)) !important;
    border-radius: 8px;
    padding: 4px 0;
}

.commentpro-admin .commentpro-inner {
    position: relative;
}

.commentpro-avatar-admin {
    border: 2px solid #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.commentpro-name-admin {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffd700 !important;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
}

.commentpro-admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a2e;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: adminBadgeGlow 2s ease-in-out infinite alternate;
    text-shadow: none;
}

@keyframes adminBadgeGlow {
    from { box-shadow: 0 0 4px rgba(255, 215, 0, 0.4); }
    to   { box-shadow: 0 0 12px rgba(255, 215, 0, 0.8); }
}

body:not(.dark) .commentpro-admin {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 140, 0, 0.04)) !important;
}

body:not(.dark) .commentpro-name-admin {
    color: #b8860b !important;
    text-shadow: none;
}

.commentpro-admin .commentpro-text a {
    color: #4a90d9;
    text-decoration: underline;
}

.commentpro-admin .commentpro-text a:hover {
    color: #ffd700;
}

/* ==================== Crosslinks block ==================== */

.crosslinks-block {
    margin: 20px 0;
    padding: 20px;
    background: var(--color-player-gray-16, #1a1a2e);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body:not(.dark) .crosslinks-block {
    background: #f8f9fa;
    border-color: #e0e0e0;
}

.crosslinks-block h2 {
    margin: 0 0 8px;
    font-size: 17px;
    color: #e0e0e0;
    font-weight: 600;
    line-height: 1.4;
}

body:not(.dark) .crosslinks-block h2 {
    color: #222;
}

.crosslinks-desc {
    margin: 0 0 16px;
    font-size: 13px;
    color: #999;
    line-height: 1.5;
}

body:not(.dark) .crosslinks-desc {
    color: #666;
}

.crosslinks-block h3 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #ccc;
    font-weight: 600;
}

body:not(.dark) .crosslinks-block h3 {
    color: #333;
}

.crosslinks-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: space-around;
}

.crosslink-card {
    flex: 1;
    min-width: 200px;
    max-width: 340px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

body:not(.dark) .crosslink-card {
    background: #fff;
    border-color: #ddd;
}

.crosslink-card:hover {
    border-color: var(--main-color, #e91e63);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body:not(.dark) .crosslink-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.crosslink-poster {
    width: 40px;
    height: 58px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.crosslink-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.crosslink-title {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    line-height: 1.3;
}

body:not(.dark) .crosslink-title {
    color: #222;
}

.crosslink-genre {
    font-size: 11px;
    color: #888;
    text-transform: lowercase;
}

@media (max-width: 480px) {
    .crosslinks-list {
        flex-direction: column;
    }
    .crosslink-card {
        max-width: 100%;
    }
}
