/* СИСТЕМА ДОСТИЖЕНИЙ - ЗАТЕМНЁННАЯ ЗОЛОТИСТО-БРОНЗОВАЯ ПАЛИТРА */

/* Основные стили */
.achievements-page {
    min-height: 100vh;
    padding: 2rem 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.achievements-page .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #b8930b 0%, #d4a04f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header .subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
}

.user-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.user-header .user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #b8930b;
    box-shadow: 0 4px 12px rgba(184, 147, 11, 0.3);
}

/* Статистика */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(184, 147, 11, 0.5);
    box-shadow: 0 8px 24px rgba(184, 147, 11, 0.2);
}

.stat-card.highlight {
    background: linear-gradient(135deg, rgba(184, 147, 11, 0.15) 0%, rgba(139, 115, 9, 0.15) 100%);
    border-color: #b8930b;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 0.5rem;
}



.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(184, 147, 11, 0.5);
    color: #fff;
}

.filter-btn.active {
    background: linear-gradient(135deg, #8b7309 0%, #b8930b 100%);
    border-color: transparent;
    color: #fff;
}

/* Фильтры */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(184, 147, 11, 0.5);
    color: #fff;
}

.filter-btn.active {
    background: linear-gradient(135deg, #8b7309 0%, #b8930b 100%);
    border-color: transparent;
    color: #fff;
}


/* Вкладки */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.category-tab {
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(184, 147, 11, 0.5);
    color: #fff;
}

.category-tab.active {
    background: linear-gradient(135deg, #8b7309 0%, #b8930b 100%);
    border-color: transparent;
    color: #fff;
}

.category-tab .count {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.category-tab.active .count {
    background: rgba(255, 255, 255, 0.25);
}

/* Карточки достижений */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8b7309 0%, #b8930b 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.achievement-card:hover {
    transform: translateY(-5px);
    border-color: rgba(184, 147, 11, 0.5);
    box-shadow: 0 8px 24px rgba(139, 115, 9, 0.2);
}

.achievement-card:hover::before {
    opacity: 1;
}

.achievement-card.locked {
    opacity: 0.6;
}

.achievement-card.locked .badge-icon {
    filter: grayscale(100%) brightness(0.5);
}

.achievement-card.unlocked {
    border-color: rgba(184, 147, 11, 0.3);
}

.achievement-card.unlocked::before {
    opacity: 1;
}

.achievement-card.in-progress {
    border-color: rgba(255, 193, 7, 0.3);
}

.achievement-card.in-progress::before {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    opacity: 1;
}

.achievement-card.near-complete {
    border-color: rgba(16, 185, 129, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

.achievement-card.near-complete::before {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    }

    50% {
        box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    }
}

/* Бейджи */
.badge-icon-wrapper {
    position: relative;
    flex-shrink: 0;
}

.badge-icon {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.lock-overlay i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Информация */
.achievement-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.achievement-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    margin: 0;
}

.achievement-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.achievement-unlocked {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #10b981;
    font-weight: 500;
    font-size: 0.9rem;
}

.unlock-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-left: auto;
}

/* Прогресс */
.progress-info {
    margin-top: auto;
}

.progress-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.almost-there {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #fff;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b7309 0%, #b8930b 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.achievement-card.in-progress .progress-fill {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.achievement-card.near-complete .progress-fill {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.progress-percent {
    text-align: right;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.special-requirement {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    font-size: 0.85rem;
}

.achievement-points {
    color: #b8930b;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
}

/* Секция в профиле */
.profile-achievements {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.profile-achievements h3 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.profile-achievements h3 i {
    color: #b8930b;
    transition: transform 0.3s ease;
}

.profile-achievements h3.collapsed i.fa-chevron-down {
    transform: rotate(-90deg);
}

.profile-achievements h3 .fa-chevron-down {
    margin-left: auto;
    font-size: 1rem;
}

.achievements-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.summary-text {
    color: rgba(255, 255, 255, 0.8);
}

.view-all-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #8b7309 0%, #b8930b 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 147, 11, 0.4);
}

.badges-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.badge-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.badge-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(184, 147, 11, 0.2);
}

.badge-item img {
    width: 64px;
    height: 64px;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.badge-item:hover img {
    transform: scale(1.1) rotate(5deg);
}

.badge-item-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Виджет "Близко к цели" */
.near-completion-widget {
    margin-top: 1.5rem;
}

.near-completion-widget h4 {
    color: #10b981;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.near-completion-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.near-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #10b981;
}

.near-item img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.near-item-info {
    flex: 1;
}

.near-item-name {
    color: #fff;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

background: rgba(255, 255, 255, 0.1);
border-radius: 4px;
overflow: hidden;
margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b7309 0%, #b8930b 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.achievement-card.in-progress .progress-fill {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.achievement-card.near-complete .progress-fill {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.progress-percent {
    text-align: right;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.special-requirement {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    font-size: 0.85rem;
}

.achievement-points {
    color: #b8930b;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
}

/* Секция в профиле */
.profile-achievements {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.profile-achievements h3 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.profile-achievements h3 i {
    color: #b8930b;
    transition: transform 0.3s ease;
}

.profile-achievements h3.collapsed i.fa-chevron-down {
    transform: rotate(-90deg);
}

.profile-achievements h3 .fa-chevron-down {
    margin-left: auto;
    font-size: 1rem;
}

.achievements-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.summary-text {
    color: rgba(255, 255, 255, 0.8);
}

.view-all-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #8b7309 0%, #b8930b 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 147, 11, 0.4);
}

.badges-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.badge-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.badge-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(184, 147, 11, 0.2);
}

.badge-item img {
    width: 64px;
    height: 64px;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.badge-item:hover img {
    transform: scale(1.1) rotate(5deg);
}

.badge-item-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Виджет "Близко к цели" */
.near-completion-widget {
    margin-top: 1.5rem;
}

.near-completion-widget h4 {
    color: #10b981;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.near-completion-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.near-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #10b981;
}

.near-item img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.near-item-info {
    flex: 1;
}

.near-item-name {
    color: #fff;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.near-item-progress {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Исправление для мобильных устройств */
@media (max-width: 768px) {
    .stats-panel {
        grid-template-columns: repeat(2, 1fr); /* 2 карточки в ряд */
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.8rem; /* Меньше размер */
    }
    
    .stat-label {
        font-size: 0.75rem; /* Меньше текст */
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .stats-panel {
        grid-template-columns: 1fr; /* 1 карточка на ряд */
    }
}



/* Сворачиваемый контент (для мобильных) */
.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible-content.collapsed {
    max-height: 0 !important;
}

/* Бейдж возле никнейма */
.user-badge {
    display: inline-block;
    width: 18px;
    height: 18px;
  
    vertical-align: middle;
    border-radius: 4px;
    border: 1px solid rgba(184, 147, 11, 0.4);
    box-shadow: 0 1px 4px rgba(184, 147, 11, 0.15);
    opacity: 0.85;
}

.user-badge:hover {
    opacity: 1;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* Адаптив */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .user-header {
        flex-direction: column;
        text-align: center;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    .achievement-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .badge-icon {
        width: 100px;
        height: 100px;
    }

    /* На мобильных блок скрыт по умолчанию */
    .profile-achievements .collapsible-content {
        max-height: 0;
    }

    .profile-achievements h3 {
        cursor: pointer;
    }
}