/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif !important;
    background-color: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Стили для страницы достижений */
.achievements-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: var(--tg-theme-bg-color, #ffffff);
}

.achievements-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
}

.achievements-header {
    text-align: center;
    margin-bottom: 30px;
}

.achievements-title {
    font-size: 31px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin-bottom: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Display', system-ui, sans-serif !important;
    letter-spacing: -0.3px;
}

.achievements-subtitle {
    font-size: 21px;
    color: var(--tg-theme-hint-color, #666666);
    margin-bottom: 5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Display', system-ui, sans-serif !important;
    font-weight: 500;
    letter-spacing: -0.2px;
}

.achievements-count {
    font-size: 18px;
    color: var(--tg-theme-hint-color, #888888);
    font-style: italic;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Display', system-ui, sans-serif !important;
    font-weight: 400;
}

/* Галерея достижений */
.achievements-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 5px;
}

/* Карточка достижения */
.achievement-card {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 15px;
    padding: 12px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    background-clip: padding-box;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Неполученные достижения */
.achievement-card.not-earned {
    opacity: 0.6;
    background: linear-gradient(145deg, #f5f5f5, #e8e8e8);
}

.achievement-card.not-earned .achievement-name {
    color: var(--tg-theme-hint-color, #888888);
}

.achievement-card.not-earned .achievement-description {
    color: var(--tg-theme-hint-color, #999999);
    font-style: italic;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, #e3f2fd, #fff8e1, #f3e5f5);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.achievement-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(74, 144, 226, 0.3);
}

.achievement-card:hover::before {
    opacity: 0.1;
}

/* Изображение достижения */
.achievement-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 10px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(45deg, #f5f5f5, #e0e0e0);
    z-index: 1;
    flex-shrink: 0;
}

.achievement-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
    border-radius: 12px;
    background-color: #ffffff;
}

/* Черно-белые изображения для неполученных достижений */
.achievement-card.not-earned .achievement-image {
    filter: grayscale(100%) brightness(0.8);
}

.achievement-card:hover .achievement-image {
    transform: scale(1.03);
}

.achievement-card.not-earned:hover .achievement-image {
    filter: grayscale(80%) brightness(0.9);
}

/* Иконка направления */
.direction-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* Заглушка для отсутствующих изображений */
.achievement-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 60px;
    border-radius: 15px;
}

/* Информация о достижении */
.achievement-info {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.achievement-name {
    font-size: 20px;
    font-weight: 600;
    color: #000000 !important; /* Черный цвет для темной темы */
    margin-bottom: 5px;
    line-height: 1.2;
    text-align: center;
    min-height: 47px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Display', system-ui, sans-serif !important;
    letter-spacing: -0.1px;
}

.achievement-description {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #666666);
    margin-bottom: 5px;
    line-height: 1.3;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievement-date {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #888888);
    background-color: rgba(74, 144, 226, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    font-style: italic;
    text-align: center;
    align-self: center;
}

.achievement-card.not-earned .achievement-date {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Пустое состояние */
.no-achievements {
    text-align: center;
    padding: 60px 20px;
    color: var(--tg-theme-hint-color, #999999);
}

.no-achievements-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-achievements-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.no-achievements-text {
    font-size: 16px;
    line-height: 1.5;
}

/* Адаптивность */
@media (max-width: 768px) {
    .achievements-content {
        padding: 12px;
    }
    
    .achievements-gallery {
        gap: 12px;
        padding: 0 3px;
    }
    
    .achievement-card {
        padding: 10px;
    }
    
    .achievements-title {
        font-size: 26px;
    }
    
    .achievement-name {
        font-size: 16px;
        min-height: 39px;
    }
    
    .achievement-description {
        font-size: 13px;
    }
    
    .achievement-date {
        font-size: 12px;
        padding: 3px 5px;
    }
}

@media (max-width: 480px) {
    .achievements-content {
        padding: 10px;
    }
    
    .achievements-gallery {
        gap: 10px;
        padding: 0 2px;
    }
    
    .achievement-card {
        padding: 8px;
        border-radius: 12px;
    }
    
    .achievement-image-wrapper {
        margin-bottom: 8px;
        border-radius: 10px;
    }
    
    .achievement-image {
        border-radius: 10px;
    }
    
    .achievement-placeholder {
        border-radius: 10px;
        font-size: 40px;
    }
    
    .achievements-title {
        font-size: 23px;
    }
    
    .achievement-name {
        font-size: 14px;
        min-height: 34px;
    }
    
    .achievement-description {
        font-size: 12px;
    }
    
    .achievement-date {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .direction-badge {
        width: 20px;
        height: 20px;
        font-size: 10px;
        top: 4px;
        right: 4px;
    }
}

/* Анимация загрузки */
.achievements-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--tg-theme-hint-color, #999999);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(74, 144, 226, 0.1);
    border-left-color: #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
} 