/* Стили профиля в теме сайта (тёмный фон, голубые акценты) */

.user-profile-page {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
}

/* Хедер профиля */
.profile-header {
    background: linear-gradient(135deg, #01799E 0%, #3C78A7 100%);
    color: white;
    padding: 30px;
    display: flex;
    gap: 30px;
    align-items: center;
    background: url("../images/back_01.jpg") repeat scroll 0 0 rgba(0, 0, 0, 0);
}

.profile-avatar-section {
    position: relative;
}

.profile-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    object-fit: cover;
}

.profile-level-badge {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: #FFD700;
    border: 3px solid white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.level-number {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.level-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #666;
    line-height: 1;
}

.profile-info-section {
    flex: 1;
}

.profile-username {
    margin: 0 0 15px 0;
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.profile-stats-bar {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
}

.experience-bar {
    position: relative;
    background: rgba(255,255,255,0.3);
    border-radius: 20px;
    height: 30px;
    overflow: hidden;
}

.experience-bar-fill {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    height: 100%;
    transition: width 0.5s ease;
}

.experience-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Вкладки */
.profile-tabs {
    display: flex;
    background: #EDF5FA;
    border-bottom: 2px solid #C8DBEA;
}

.tab-item {
    padding: 15px 30px;
    color: #3C78A7;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.tab-item:hover {
    background: #E7F2F9;
    color: #01799E;
}

.tab-item.active {
    background: white;
    border-bottom-color: #01799E;
    font-weight: bold;
}

.tab-item .badge {
    background: #d54e21;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    margin-left: 5px;
}

/* Контент профиля */
.profile-content {
    padding: 20px 0 10px 0;
}

.profile-card {
    background: white;
    border: 1px solid #C8DBEA;
    border-radius: 8px;
    padding: 20px 20px 10px 20px;
    margin-bottom: 20px;
}

.profile-card h3 {
    color: #3C78A7;
    border-bottom: 2px solid #EDF5FA;
    padding-bottom: 10px;
    margin-bottom: 20px;
    margin-top: 0;
}

.profile-field {
    margin-bottom: 15px;
}

.profile-field label {
    font-weight: bold;
    color: #3C78A7;
    display: block;
    margin-bottom: 5px;
}

.profile-field p {
    margin: 0;
}

.not-specified {
    color: #999;
    font-style: italic;
}

/* Биографии */
.biography-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.biography-item {
    border-bottom: 1px solid #EDF5FA;
    padding-bottom: 10px;
}

.biography-link {
    display: flex;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}

.biography-link:hover {
    color: #01799E;
}

.biography-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.biography-info {
    flex: 1;
}

.biography-info h4 {
    margin: 0 0 5px 0;
    color: #3C78A7;
}

.biography-type,
.biography-date {
    font-size: 0.85em;
    color: #666;
    margin-right: 10px;
}

.view-all-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #01799E;
    text-decoration: none;
    font-weight: bold;
}

.view-all-link:hover {
    color: #d54e21;
}

/* Статистика */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #EDF5FA;
}

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

.stat-row .stat-label {
    color: #666;
}

.stat-row .stat-value {
    font-weight: bold;
    color: #01799E;
}

/* Ачивки */
.achievements-progress {
    margin-bottom: 30px;
}

.category-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.category-progress-card {
    background: #F9F9F9;
    border: 1px solid #C8DBEA;
    border-radius: 8px;
    padding: 15px;
}

.category-progress-card h4 {
    margin: 0 0 10px 0;
    color: #3C78A7;
    font-size: 16px;
}

.progress-bar {
    background: #E0E0E0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    height: 100%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 12px;
    color: #666;
}

.achievements-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #C8DBEA;
    background: white;
    color: #3C78A7;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.filter-btn:hover {
    background: #EDF5FA;
}

.filter-btn.active {
    background: #01799E;
    color: white;
    border-color: #01799E;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.achievement-card {
    display: flex;
    gap: 15px;
    background: white;
    border: 2px solid #C8DBEA;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.achievement-card.unlocked {
    border-color: #4CAF50;
    background: linear-gradient(to right, rgba(76, 175, 80, 0.05), white);
}

.achievement-card.locked {
    opacity: 0.6;
}

.achievement-card.rarity-legendary {
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.achievement-card.rarity-epic {
    border-color: #9C27B0;
}

.achievement-card.rarity-rare {
    border-color: #2196F3;
}

.achievement-card-icon {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.achievement-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.achievement-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, #EDF5FA, #C8DBEA);
    border-radius: 8px;
}

.grayscale {
    filter: grayscale(100%);
}

.locked-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
}

.unlocked-stamp {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.achievement-card-content {
    flex: 1;
}

.achievement-card-content h4 {
    margin: 0 0 10px 0;
    color: #3C78A7;
}

.achievement-description {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

.achievement-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.achievement-meta span {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.achievement-rarity {
    background: #E0E0E0;
    color: #333;
    text-transform: uppercase;
    font-weight: bold;
}

.achievement-rarity.rarity-legendary {
    background: #FFD700;
    color: #333;
}

.achievement-rarity.rarity-epic {
    background: #9C27B0;
    color: white;
}

.achievement-rarity.rarity-rare {
    background: #2196F3;
    color: white;
}

.achievement-points {
    background: #4CAF50;
    color: white;
    font-weight: bold;
}

.achievement-date {
    background: #F5F5F5;
    color: #666;
}

/* Сообщения */
.messages-placeholder {
    text-align: center;
    padding: 60px 20px;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.messages-placeholder h4 {
    color: #3C78A7;
    margin-bottom: 10px;
}

.messages-placeholder p {
    color: #666;
}

/* Биографии */
.biographies-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #3C78A7;
}

.biographies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.biography-card {
    border: 1px solid #C8DBEA;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    background: white;
}

.biography-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.biography-card-image {
    position: relative;
    height: 200px;
    background: #F5F5F5;
}

.biography-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
}

/* Как .list-grid .item-premiere и .node-news .editorial-img … editorial-stats i */
.biography-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    pointer-events: none;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.25;
    text-transform: none;
}

.biography-card-content {
    padding: 15px;
}

.biography-card-content h4 {
    margin: 0 0 10px 0;
}

.biography-card-content h4 a {
    color: #3C78A7;
    text-decoration: none;
}

.biography-card-content h4 a:hover {
    color: #01799E;
}

.biography-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

/* Вкладка комментариев, /comments/recent — общая вёрстка (шаблон profile_comment_card) */
.recent-comments-page {
    max-width: 52rem;
}

.profile-comments-lead {
    font-size: 0.95rem;
    color: #555;
    margin: 0 0 1.25rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, rgba(60, 120, 167, 0.08) 0%, rgba(255, 255, 255, 0.6) 100%);
    border-left: 4px solid #3c78a7;
    border-radius: 0 6px 6px 0;
}

.profile-comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-comment-item {
    position: relative;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid #d4e4f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 45, 80, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.profile-comment-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #3c78a7 0%, #5a9fd4 100%);
    border-radius: 10px 0 0 10px;
}

.profile-comment-item:hover {
    border-color: #b8d4ea;
    box-shadow: 0 4px 14px rgba(15, 60, 100, 0.08);
}

.profile-comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.85rem 1rem 0.65rem 1.25rem;
    font-size: 0.8125rem;
    color: #666;
    border-bottom: 1px solid #eef4f9;
    background: linear-gradient(180deg, #fafcfe 0%, #fff 100%);
    margin-bottom: 0;
}

.profile-comment-date {
    color: #888;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.profile-comment-meta-sep {
    color: #ccc;
    user-select: none;
}

.profile-comment-author {
    font-weight: 600;
    color: #334;
}

.profile-comment-author a {
    color: #1a5f96;
    text-decoration: none;
}

.profile-comment-author a:hover {
    color: #d54e21;
    text-decoration: underline;
}

.profile-comment-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #3c78a7;
    background: rgba(60, 120, 167, 0.12);
    border-radius: 999px;
}

.profile-comment-material {
    flex: 1 1 100%;
    margin-top: 0.15rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #2c6a9e;
    text-decoration: none;
    line-height: 1.35;
}

.profile-comment-material:hover {
    color: #d54e21;
    text-decoration: underline;
}

.profile-comment-body {
    padding: 0.85rem 1rem 1rem 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #333;
}

.profile-comment-body p {
    margin: 0 0 0.5em;
}

.profile-comment-body p:last-child {
    margin-bottom: 0;
}

/* Масштабирование с сохранением пропорций (вписывание в область по ширине и высоте) */
.profile-comment-body img {
    display: block;
    max-width: 100%;
    width: auto;
    /* ограничиваем «коробку» — картинка целиком влезает, как object-fit: contain */
    max-height: min(75vh, 640px);
    height: auto !important;
    object-fit: contain;
    object-position: center;
    margin: 0.75em auto;
}

.profile-comment-body svg,
.profile-comment-body video {
    display: block;
    max-width: 100%;
    width: auto;
    max-height: min(75vh, 640px);
    height: auto;
    object-fit: contain;
    object-position: center;
    margin: 0.75em auto;
}

.profile-comments .empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #888;
    background: #fafbfc;
    border: 1px dashed #c8dbea;
    border-radius: 10px;
}

.profile-comments-pagination {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e8eef4;
}

@media (max-width: 576px) {
    .profile-comment-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-comment-meta-sep {
        display: none;
    }
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Адаптивность */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-stats-bar {
        justify-content: center;
    }
    
    .profile-tabs {
        flex-wrap: wrap;
    }
    
    .tab-item {
        flex: 1 1 50%;
        text-align: center;
        padding: 12px 10px;
    }
    
    .biographies-grid {
        grid-template-columns: 1fr;
    }
    
    .category-progress-grid {
        grid-template-columns: 1fr;
    }
    
    .achievement-card {
        flex-direction: column;
        text-align: center;
    }
    
    .achievement-card-icon {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
}
