/* ============================================================
   Steam-style Achievements CSS
   Оригинальные имена классов сохранены
   ============================================================ */

/* ========== ОСНОВНОЙ КОНТЕЙНЕР ========== */
.profile_progress {
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 20px;
    background: linear-gradient(160deg, #1b2838 0%, #171d25 100%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(102, 192, 244, 0.06);
    margin-top: 13px;
    position: relative;
    border: 1px solid #2a3f5f;
    font-family: "Motiva Sans", Arial, sans-serif;
}

/* ========== ЗАГОЛОВОК ========== */
.ach-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(102, 192, 244, 0.12);
}

.ach-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ach-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ach-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    background: linear-gradient(135deg, #1b4a6b 0%, #2a5f80 100%);
    border: 1px solid rgba(102, 192, 244, 0.3);
    color: #66c0f4;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.ach-title {
    font-size: 15px;
    font-weight: 700;
    color: #c6d4df;
    margin: 0;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ach-subtitle {
    font-size: 11px;
    color: #8f98a0;
    margin: 2px 0 0 0;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ========== КОМПАКТНЫЙ БЕЙДЖ ========== */
.ach-badge-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(42, 71, 94, 0.4);
    border: 1px solid #2a3f5f;
    border-radius: 3px;
}

.ach-badge-label {
    font-size: 10px;
    font-weight: 600;
    color: #8f98a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ach-badge-num {
    font-size: 14px;
    font-weight: 700;
    color: #c6d4df;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.ach-badge-num span {
    font-size: 11px;
    color: #8f98a0;
    font-weight: 600;
}

.ach-badge-bar {
    width: 60px;
    height: 3px;
    background: rgba(102, 192, 244, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.ach-badge-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4c91b5 0%, #66c0f4 100%);
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== КНОПКИ ========== */
.ach-controls {
    display: flex;
    gap: 6px;
}

.ach-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(42, 71, 94, 0.3);
    border: 1px solid #2a3f5f;
    border-radius: 3px;
    color: #8f98a0;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ach-btn:hover {
    background: rgba(102, 192, 244, 0.12);
    border-color: rgba(102, 192, 244, 0.35);
    color: #c6d4df;
    transform: none;
    box-shadow: 0 0 8px rgba(102, 192, 244, 0.15);
}

.ach-btn.active {
    background: linear-gradient(180deg, #4c91b5 0%, #2a6080 100%);
    border-color: #66c0f4;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(102, 192, 244, 0.25);
}

.ach-btn svg {
    flex-shrink: 0;
}

/* ========== СЕТКА ========== */
.ach-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    padding: 2px;
}

/* ========== БЕЙДЖ ПРОГРЕССА ========== */
.ach-progress-badge {
    position: relative;
    border-radius: 3px;
    background: linear-gradient(135deg, rgba(42, 71, 94, 0.5) 0%, rgba(27, 40, 56, 0.5) 100%);
    border: 1px solid #2a3f5f;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
}

.ach-progress-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        #66c0f4 50%,
        transparent 100%
    );
    opacity: 0.5;
}

.ach-progress-badge-icon {
    width: 40px;
    height: 40px;
    border-radius: 3px;
    background: linear-gradient(135deg, #1b4a6b 0%, #2a5f80 100%);
    border: 1px solid rgba(102, 192, 244, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #66c0f4;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.ach-progress-badge-info {
    flex: 1;
    min-width: 0;
}

.ach-progress-badge-title {
    font-size: 10px;
    font-weight: 600;
    color: #8f98a0;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ach-progress-badge-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ach-badge-numbers {
    font-size: 18px;
    font-weight: 700;
    color: #c6d4df;
}

.ach-badge-percent {
    font-size: 13px;
    font-weight: 600;
    color: #66c0f4;
    background: rgba(102, 192, 244, 0.12);
    border: 1px solid rgba(102, 192, 244, 0.2);
    padding: 2px 8px;
    border-radius: 2px;
}

.ach-progress-badge-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(102, 192, 244, 0.1);
    overflow: hidden;
}

.ach-progress-badge-fill {
    height: 100%;
    background: linear-gradient(90deg, #4c91b5 0%, #66c0f4 100%);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ach-progress-badge-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: badgeShine 2.5s ease-in-out infinite;
}

@keyframes badgeShine {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========== СКРОЛЛБАР ========== */
.ach-grid::-webkit-scrollbar {
    width: 4px;
}

.ach-grid::-webkit-scrollbar-track {
    background: rgba(102, 192, 244, 0.04);
    border-radius: 2px;
}

.ach-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4c91b5 0%, #2a6080 100%);
    border-radius: 2px;
}

/* ========== КАРТОЧКА ========== */
.ach-card {
    position: relative;
    border-radius: 3px;
    background: linear-gradient(160deg, #213547 0%, #1b2c3a 100%);
    border: 1px solid #2a3f5f;
    padding: 14px;
    transition: all 0.2s ease;
    animation: achFadeIn 0.35s ease-out;
    cursor: pointer;
    overflow: hidden;
}

.ach-card:hover {
    border-color: rgba(102, 192, 244, 0.45);
    background: linear-gradient(160deg, #264559 0%, #1e3345 100%);
    box-shadow: 0 0 14px rgba(102, 192, 244, 0.12), inset 0 1px 0 rgba(102, 192, 244, 0.08);
}

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

/* Блеск для ПОЛУЧЕННЫХ */
.ach-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
        transparent 30%,
        rgba(102, 192, 244, 0.06) 50%,
        transparent 70%
    );
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    pointer-events: none;
    opacity: 0;
}




/* Рамка для ПОЛУЧЕННЫХ — Steam золото */
.ach-card:not(.not-earned)::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 3px;
    padding: 1px;
    background: linear-gradient(135deg,
        #c2a84d 0%,
        #66c0f4 40%,
        #c2a84d 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.55;
    animation: rotateBorder 5s linear infinite;
}


/* Рамка для НЕВЫПОЛНЕННЫХ */
.ach-card.not-earned::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 3px;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(102, 192, 244, 0) 0%,
        rgba(102, 192, 244, 0.35) 50%,
        rgba(102, 192, 244, 0) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ach-card.not-earned:hover::before {
    opacity: 1;
}

/* ГОРИЗОНТАЛЬНЫЙ LAYOUT (везде — как в Steam) */
.ach-card-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 12px;
    position: relative;
    z-index: 1;
}

/* ========== ИЗОБРАЖЕНИЕ ========== */
.ach-img-wrap {
    position: relative;
    flex-shrink: 0;
}

.ach-img {
    width: 50px;
    height: 50px;
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid rgba(102, 192, 244, 0.25);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.ach-card:hover .ach-img {
    border-color: rgba(102, 192, 244, 0.6);
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(102, 192, 244, 0.2);
}

.ach-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(102, 192, 244, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.ach-card:hover .ach-glow {
    opacity: 1;
}

/* Бейдж выполнено */
.ach-earned-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c2a84d 0%, #e6c96e 100%);
    border: 1px solid rgba(194, 168, 77, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(194, 168, 77, 0.5);
    animation: badgePulse 2.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(194, 168, 77, 0.45); }
    50%       { box-shadow: 0 2px 14px rgba(194, 168, 77, 0.75); }
}

.ach-earned-badge svg {
    color: #1b2838;
}

/* ========== ИНФОРМАЦИЯ ========== */
.ach-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.ach-name {
    font-size: 12px;
    font-weight: 700;
    color: #c6d4df;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.ach-desc {
    font-size: 10px;
    color: #8f98a0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ========== СТАТУС ========== */
.ach-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.achievs_success {
    color: #90ba4b;
}

.achievs_info {
    color: #c2a84d;
}

/* ========== ПРОГРЕСС-БАР ========== */
.ach-progress {
    height: 3px;
    background: rgba(102, 192, 244, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 3px;
}

.ach-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a08830 0%, #c2a84d 100%);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* 100% — Steam зелёный */
.ach-progress-complete .ach-progress-fill {
    background: linear-gradient(90deg, #6a9e2e 0%, #90ba4b 100%);
}

.ach-progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 100%
    );
    animation: progressShine 1.8s ease-in-out infinite;
}

@keyframes progressShine {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========== НЕЗАРАБОТАННЫЕ ========== */
.ach-card.not-earned {
    opacity: 0.45;
    filter: grayscale(60%);
    background: linear-gradient(160deg, #192531 0%, #141c24 100%);
}

.ach-card.not-earned:hover {
    opacity: 0.65;
    filter: grayscale(30%);
}

.ach-card.not-earned .ach-img {
    border-color: rgba(102, 192, 244, 0.1);
}

.ach-card.not-earned .ach-name {
    color: #6d7a84;
}

/* ========== ПУСТОЕ СОСТОЯНИЕ ========== */
.ach-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: rgba(42, 71, 94, 0.08);
    border-radius: 3px;
    border: 1px dashed rgba(102, 192, 244, 0.15);
}

.ach-empty svg {
    width: 48px;
    height: 48px;
    color: rgba(102, 192, 244, 0.2);
    margin-bottom: 12px;
}

.ach-empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #c6d4df;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ach-empty-text {
    font-size: 11px;
    color: #8f98a0;
    max-width: 300px;
    line-height: 1.5;
}

/* ========== ЗАГРУЗКА ========== */
.ach-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.ach-loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(102, 192, 244, 0.15);
    border-top-color: #66c0f4;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 12px;
}

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

.ach-loading-text {
    font-size: 11px;
    font-weight: 600;
    color: #66c0f4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 1200px) {
    .ach-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ach-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ach-header-right {
        width: 100%;
        flex-direction: column;
    }

    .ach-controls {
        width: 100%;
    }

    .ach-btn {
        flex: 1;
        justify-content: center;
    }

    .ach-grid {
        grid-template-columns: 1fr;
        max-height: 400px;
    }

    .ach-card {
        padding: 10px;
    }

    .ach-img {
        width: 56px;
        height: 56px;
    }

    .ach-name {
        font-size: 11px;
    }

    .ach-desc {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .profile_progress {
        padding: 10px;
    }

    .ach-icon {
        width: 30px;
        height: 30px;
    }

    .ach-title {
        font-size: 13px;
    }

    .ach-btn {
        font-size: 10px;
        padding: 5px 10px;
    }

    .ach-card {
        padding: 9px;
    }

    .ach-img {
        width: 50px;
        height: 50px;
    }

    .ach-badge-compact {
        width: 100%;
        justify-content: space-between;
    }
}

/* ========== СТАРЫЕ КЛАССЫ (совместимость) ========== */
.achievs-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: rgba(42, 71, 94, 0.08);
    border-radius: 3px;
    border: 1px dashed rgba(102, 192, 244, 0.15);
}

.achievs-empty svg {
    width: 48px;
    height: 48px;
    color: rgba(102, 192, 244, 0.2);
    margin-bottom: 12px;
}

.achievs-empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #c6d4df;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.achievs-empty-text {
    font-size: 11px;
    color: #8f98a0;
    max-width: 300px;
    line-height: 1.5;
}

.achievs-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.achievs-loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(102, 192, 244, 0.15);
    border-top-color: #66c0f4;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 12px;
}

.achievs-loading-text {
    font-size: 11px;
    font-weight: 600;
    color: #66c0f4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}