:root {
    --primary-color: #6855f8;
    --primary-hover: #5645e6;
    --text-primary: #0f0f1e;
    --text-secondary: #7777a6;
    --bg-light: #f7f7f9;
    --border-color: #f0f0f5;
    --white: #ffffff;
    --accent-blue: #42a2ff;
    --accent-orange: #ff862e;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --status-active: #42a2ff;
    --status-completed: #6855f8;
}

.profile-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 600px;
    padding: 50px 15px;
}

.profile-info {
    display: flex;
    gap: 32px;
}

.profile-avatar-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    padding: 2px;
    flex-shrink: 0;
}

.profile-avatar-container--editable {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 120px;
    height: auto;
    border: none;
    padding: 0;
}

.profile-avatar-upload {
    position: relative;
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    padding: 2px;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-upload:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.profile-avatar-upload .profile-avatar {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.profile-avatar-upload-overlay {
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.profile-avatar-upload-overlay i {
    font-size: 1.25rem;
}

.profile-avatar-upload:hover .profile-avatar-upload-overlay,
.profile-avatar-upload:focus-within .profile-avatar-upload-overlay {
    opacity: 1;
}

.profile-avatar-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-avatar-error {
    margin: 0;
    font-size: 12px;
    color: #e53935;
    text-align: center;
    max-width: 160px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

.profile-name-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

.profile-name {
    font-size: 32px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.25;
}

.edit-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-light);
    border-radius: 100px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.edit-profile-btn:hover {
    background: var(--border-color);
}

.profile-about {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary);
    max-width: 800px;
}

.profile-stats {
    display: flex;
    gap: 24px;
    width: 100%;
}

.profile-telegram,
.profile-vk,
.profile-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.profile-telegram:hover,
.profile-vk:hover {
    color: var(--primary-color);
}

.profile-badges-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.profile-badges-line {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.profile-badges-link {
    display: inline;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    font: inherit;
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.profile-badges-link:hover {
    color: var(--primary-color);
}

.profile-badges-icons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.profile-badge-thumb {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-badge-thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.profile-badge-thumb img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-badge {
    padding: 6px 12px;
    background: var(--bg-light);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-tabs {
    display: flex;
    gap: 32px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
    width: 100%;
    max-width: fit-content;
    padding: 0 15px;
    justify-content: center;
}

.profile-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}

.profile-tab:hover {
    color: var(--text-primary);
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

.tab-count {
    padding: 2px 8px;
    background: var(--bg-light);
    border-radius: 100px;
    font-size: 12px;
}

.profile-content {
    width: 100%;
}

.profile-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
    width: 100%;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    font-size: 16px;
    position: relative;
}

.profile-empty::before {
    content: '\f01c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 64px;
    display: block;
    color: var(--border-color);
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Пустое состояние в grid: на всю ширину, по центру */
.works-grid > .profile-empty,
.likes-grid > .profile-empty {
    grid-column: 1 / -1;
}

/* В колонке flex с align-items: flex-start — растягиваем на всю ширину */
.task-set__container > .profile-empty {
    width: 100%;
    align-self: stretch;
    box-sizing: border-box;
}

.comments-list > .profile-empty {
    width: 100%;
    align-self: stretch;
    box-sizing: border-box;
}

/* Стили для работ */
/* Стили для карточек работ теперь находятся в submission-card.css */
.works-grid,
.likes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(10px, 2vw, 20px);
}

/* Стили для заданий */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.task-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.task-info {
    flex-grow: 1;
    padding-left: 4px;
}

.task-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 14px 0;
    letter-spacing: -0.3px;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.task-status {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.task-status.active {
    background: rgba(66, 162, 255, 0.1);
    color: var(--status-active);
}

.task-status.completed {
    background: rgba(104, 85, 248, 0.1);
    color: var(--status-completed);
}

.task-date {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-date::before {
    content: '•';
    color: var(--border-color);
    font-size: 18px;
}

.task-details {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.task-participants,
.task-prize {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    background: var(--bg-light);
    border-radius: 100px;
    transition: all 0.3s ease;
}

.task-participants i,
.task-prize i {
    font-size: 20px;
    color: var(--primary-color);
    opacity: 0.8;
}

.task-card:hover .task-participants,
.task-card:hover .task-prize {
    background: rgba(104, 85, 248, 0.08);
    color: var(--text-primary);
}

.view-task-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 100px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.view-task-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Комментарии в профиле — в духе карточек сайта, по работе (группировка) */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-card {
    padding: 20px;
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

.comment-card--link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.comment-card--link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.comment-card--link:hover {
    background-color: var(--bg-color);
    border-color: transparent;
}

.comment-card--link:hover .comment-card__entry {
    background-color: var(--white);
    border-color: var(--border-color);
}

.comment-card__work {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.comment-card__preview-wrap {
    flex-shrink: 0;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    width: 112px;
    height: 84px;
    background: var(--bg-light);
}

.comment-card__preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.comment-card__work-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.comment-card__task-title {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-primary);
    margin: 0;
    transition: color 0.2s ease;
}

.comment-card--link:hover .comment-card__task-title {
    color: var(--primary-color);
}

.comment-card__badge {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.comment-card__thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 0;
}

.comment-card__entry {
    padding: 12px 14px;
    border-radius: 12px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.comment-card__entry-date {
    display: block;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.comment-card__entry-text {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 600px) {
    .comment-card__work {
        flex-direction: column;
        align-items: stretch;
    }

    .comment-card__preview-wrap {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 10;
        max-height: 200px;
    }
}

@media (max-width: 1200px) {
    .works-grid,
    .likes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .task-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .task-details {
        margin-top: 16px;
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
    }

    .profile-name-actions {
        flex-direction: column;
        gap: 16px;
    }

    .profile-stats {
        justify-content: center;
    }

    .profile-badges {
        justify-content: center;
    }

    .profile-tabs {
        overflow-x: auto;
        padding-bottom: 8px;
        gap: 16px;
    }
    
    .works-grid,
    .likes-grid {
        grid-template-columns: 1fr;
    }
    
    .task-details {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .view-task-btn {
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }
} 