/**
 * Стили для страницы профиля пользователя
 */

/* === Основные блоки профиля === */
.profile-container {
    display: grid;
    gap: 1.5rem;
}

/* Стили для улучшенного аватара профиля */
#profile-avatar {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

#profile-avatar img {
    transition: opacity 0.3s ease;
}

#profile-avatar img:hover {
    opacity: 0.9;
}

/* Анимации для карточек */
.bg-\[#252525\], .bg-\[#2a2a2a\] {
    transition: all 0.3s ease;
}

.bg-\[#252525\]:hover {
    background-color: #2a2a2a;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.bg-\[#2a2a2a\]:hover {
    background-color: #333333;
    transform: translateY(-1px);
}

/* Улучшенные кнопки */
.inline-flex {
    transition: all 0.3s ease;
}

.inline-flex:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Улучшенный прогресс бар */
#profile-progress-bar {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Стили для статистических карточек */
.grid > div[class*="bg-[#2a2a2a]"] {
    position: relative;
    overflow: hidden;
}

.grid > div[class*="bg-[#2a2a2a]"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), transparent);
    transition: left 0.5s ease;
}

.grid > div[class*="bg-[#2a2a2a]"]:hover::before {
    left: 100%;
}

/* Стили для уровня на аватаре */
.absolute.-bottom-2.-right-2 {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive улучшения */
@media (max-width: 768px) {
    #profile-avatar {
        margin: 0 auto;
    }
    
    .grid.grid-cols-2.lg\\:grid-cols-1 {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Скролл для операций */
.max-h-64 {
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #2d3748;
}

.max-h-64::-webkit-scrollbar {
    width: 6px;
}

.max-h-64::-webkit-scrollbar-track {
    background: #2d3748;
    border-radius: 3px;
}

.max-h-64::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 3px;
}

.max-h-64::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Сетка для планшетов и выше */
@media (min-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr 2fr;
    }
}

/* Стили для нового layout профиля 1/4 и 3/4 */
.profile-user-info {
    background-color: #252525;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #3a3a3a;
    height: fit-content;
}

.profile-stats-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Компактные стили для статистики */
.compact-stat-card {
    background-color: #2a2a2a;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.compact-stat-card:hover {
    background-color: #333333;
    transform: translateY(-2px);
}

/* Стили для блоков 50/50 */
.profile-half-blocks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .profile-half-blocks {
        grid-template-columns: 1fr 1fr;
    }
}

/* Компактные аватары и иконки */
.compact-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Анимации для новых блоков */
.profile-block {
    transition: all 0.3s ease;
}

.profile-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Левая колонка профиля - информация о пользователе */
.profile-sidebar {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
    height: max-content;
    position: sticky;
    top: 2rem;
}

/* Аватар в профиле */
.profile-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 6rem;
    height: 6rem;
    background-color: #2a2a2a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 1rem;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-align: center;
}

.profile-username {
    color: #9ca3af;
    text-align: center;
}

.profile-points {
    display: flex;
    align-items: center;
    background-color: #2a2a2a;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

.profile-points-value {
    color: #fbbf24;
    font-weight: 500;
    margin-right: 0.25rem;
}

.profile-points-icon {
    color: #fbbf24;
    font-size: 0.875rem;
}

/* Статистика профиля */
.profile-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #3a3a3a;
}

.profile-stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.profile-stat-label {
    color: #9ca3af;
}

.profile-stat-value {
    display: flex;
    align-items: center;
}

.level-badge {
    background-color: #2a2a2a;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.level-info-button {
    width: 1.25rem;
    height: 1.25rem;
    background-color: #3a3a3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: background-color 0.2s;
}

.level-info-button:hover {
    background-color: #4a4a4a;
}

/* === Правая колонка профиля === */

/* Компактные блоки */
.profile-compact-blocks {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .profile-compact-blocks {
        grid-template-columns: 1fr 2fr;
    }
}

@media (min-width: 1280px) {
    .profile-compact-blocks {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Горизонтальная прокрутка для активности */
.profile-activity-scroll {
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #2d3748;
}

.profile-activity-scroll::-webkit-scrollbar {
    height: 4px;
}

.profile-activity-scroll::-webkit-scrollbar-track {
    background: #2d3748;
    border-radius: 2px;
}

.profile-activity-scroll::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 2px;
}

.profile-activity-scroll::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Улучшения для иконок в компактных блоках */
.profile-compact-icon {
    transition: all 0.3s ease;
}

.profile-compact-icon:hover {
    transform: scale(1.1);
}

/* Блок прогресса уровня */
.progress-level-section {
    margin-bottom: 2rem;
}

.level-progress-container {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
}

.level-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 1rem;
    background-color: #2a2a2a;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #10b981, #3b82f6);
    border-radius: 9999px;
    transition: width 0.5s ease;
}

.level-progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #9ca3af;
}

.level-progress-summary {
    margin-top: 1rem;
    text-align: center;
}

.xp-needed {
    font-weight: 500;
}

/* XP История */
.xp-history-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #3a3a3a;
}

.xp-history-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2a2a2a;
    color: #d1d5db;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.xp-history-toggle:hover {
    background-color: #3a3a3a;
}

.xp-history-content {
    padding: 0.5rem 0;
}

.xp-history-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #3a3a3a;
}

.xp-history-item:last-child {
    border-bottom: none;
}

.xp-history-text {
    display: flex;
    align-items: center;
}

.xp-history-icon {
    margin-right: 0.5rem;
}

.xp-history-amount {
    font-weight: 500;
    color: #10b981;
}

/* Операции */
.operations-container {
    margin-bottom: 2rem;
}

.operation-item {
    display: flex;
    padding: 1rem;
    background-color: #2a2a2a;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
}

.operation-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    margin-right: 1rem;
    flex-shrink: 0;
}

.operation-content {
    flex: 1;
}

.operation-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.operation-description {
    font-size: 0.875rem;
    color: #9ca3af;
}

.operation-date {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Настройки уведомлений */
.notification-settings-container {
    margin-bottom: 2rem;
}

.notification-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #3a3a3a;
}

.notification-setting-item:last-child {
    border-bottom: none;
}

.notification-setting-label {
    display: flex;
    flex-direction: column;
}

.notification-setting-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.notification-setting-description {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Переключатель */
.notification-toggle {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.5rem;
}

.notification-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.notification-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    transition: 0.4s;
    border-radius: 1rem;
}

.notification-toggle-slider:before {
    position: absolute;
    content: "";
    height: 1.125rem;
    width: 1.125rem;
    left: 0.25rem;
    bottom: 0.1875rem;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.notification-toggle input:checked + .notification-toggle-slider {
    background-color: #3b82f6;
}

.notification-toggle input:checked + .notification-toggle-slider:before {
    transform: translateX(1.5rem);
}

/* Модальное окно уровней */
.level-info-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.level-info-content {
    background-color: #252525;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 42rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.level-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #3a3a3a;
}

.level-info-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.level-info-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.level-info-close:hover {
    color: #f9fafb;
}

.level-info-body {
    padding: 1.5rem;
}

.level-info-section {
    margin-bottom: 1.5rem;
}

.level-info-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.level-info-text {
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.level-info-formula {
    color: #9ca3af;
    font-size: 0.875rem;
}

.level-info-levels {
    display: grid;
    gap: 1rem;
}

.level-info-level {
    background-color: #2a2a2a;
    border-radius: 0.375rem;
    padding: 0.75rem;
}

.level-info-level-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.level-info-badge {
    background-color: #3a3a3a;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.level-info-level-title {
    font-weight: 500;
}

.level-info-level-description {
    color: #d1d5db;
    font-size: 0.875rem;
}