@font-face {
  font-family: 'BaseFont';
  src: url('../../uploads/font/base-Light.ttf') format('truetype');
  font-weight: 300; 
}

@font-face {
  font-family: 'TextFont';
  src: url('../../uploads/font/Text-Medium.ttf') format('truetype');
  font-weight: 500; 
}

@font-face {
  font-family: 'AdditionalFont';
  src: url('../../uploads/font/additional-Bold.ttf') format('truetype');
  font-weight: 700; 
}

/* 🎯 ФИКС СКРОЛЛА - БЛОКИРОВКА СТРАНИЦЫ */
html, body {
    overflow: hidden !important;
    position: fixed !important;
    height: 100% !important;
    width: 100% !important;
}

body {
    font-family: 'BaseFont', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f7f3ff; 
    color: #333333;
    --profile-top-offset: var(--top-offset); /* Базовое значение равно глобальному --top-offset */
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* Добавляем safe area bottom */
    box-sizing: border-box;
    width: 100%;
    min-height: 100dvh; /* Используем dvh для лучшей поддержки */
    overflow-x: hidden;
    overscroll-behavior: none !important;
    overscroll-behavior-y: none !important;
    -webkit-overscroll-behavior: none !important;
    -webkit-overflow-scrolling: auto !important;
    touch-action: pan-y !important;
}

.profile-container {
    /* 🚀 ФИКС СКРОЛЛА - ВКЛЮЧАЕМ СКРОЛЛ КОНТЕЙНЕРА */
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    
    /* 🎭 СКРЫВАЕМ ПОЛОСУ ПРОКРУТКИ */
    scrollbar-width: none;
    -ms-overflow-style: none;
    
    width: 100%;
    max-width: 355px; 
    display: flex;
    flex-direction: column;
    gap: 18px; 
    padding-top: var(--top-offset); /* Добавляем верхний отступ */
    padding-bottom: 110px !important;
    margin: 0 auto;
}

/* СКРЫВАЕМ СКРОЛЛБАР В WEBKIT */
.profile-container::-webkit-scrollbar {
    display: none;
}

.card {
    background-image: linear-gradient(to bottom right, #ffffff, #8c52ff3d);
    padding: 18px 20px;
    border-radius: 24px;
}

/* Отдельный селектор для плашки напоминания - можно переопределить для кастомизации */
.card.reminder-section {
    background-image: linear-gradient(to bottom, #ffffff, #b28bff);
}

.card p,
.card h3,
.card .reminder-text,
.card .edit-reminder-link {
    color: rgba(87, 72, 148, 0.92);
}

.card .progress-circle span {
    color: rgb(0, 0, 0);
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1 !important;
}

.card .skill-item p {
    color: rgba(86, 76, 126, 0.92);
}

.greeting-section {
    text-align: center;
    padding-bottom: 10px; 
}

.greeting-section .main-greeting {
    font-family: 'Soyuz Grotesk', sans-serif; 
    font-size: 32px; 
    font-weight: 500; 
    color: rgba(87, 72, 148, 0.92);
    margin: 0 0 15px 0; 
}

.greeting-section .character-image {
    width: 220px; 
    height: auto;
    margin-bottom: 18px; /* Изменяем отступ на 18px как gap между плашками */
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Стили для маскота, если он должен отличаться от character-image или для уточнений */
.mascot-profile-avatar {
    /* Если нужны специфичные стили для маскотов на странице профиля, 
       отличные от стандартного character-image, их можно добавить сюда.
       Пока что он будет наследовать от .character-image */
}

/* Стили для эмодзи-аватара на странице профиля */
.emoji-avatar-profile {
    font-size: 80px;
    display: block;
    text-align: center;
    margin-bottom: 18px; /* Изменяем отступ на 18px как gap между плашками */
    line-height: 1;
}

/* Стили для аватара пользователя в круге */
.user-avatar-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 18px auto; /* Изменяем отступ на 18px как gap между плашками */
    background-color: var(--tg-theme-hint-color, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.goal-section {
    margin-top: -28px; /* Возвращаем отрицательный отступ, но меньше чем было (-60px), чтобы создать отступ 18px */
    position: relative; 
    z-index: 2; 
}

.goal-section .goal-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goal-section p {
    margin: 0;
    font-family: 'TextFont', sans-serif;
    font-size: 15px;
    color: rgba(86, 76, 126, 0.92);
    flex-grow: 1;
    line-height: 1.4;
    text-align: center; 
}

.skills-progress-section h3 {
    font-family: 'TextFont', sans-serif;
    font-size: 17px;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 10px 8px; 
    justify-items: center;
}

.skill-item {
    text-align: center;
    max-width: 75px; 
}

.progress-circle {
    width: 60px; 
    height: 60px; 
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 0 auto 8px auto;
    background-color: transparent;
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    background: transparent;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.progress-circle span {
    position: relative;
    z-index: 1;
    font-family: 'AdditionalFont', sans-serif;
    font-size: 14px; 
    font-weight: 700;
    color: #333333;
}

.skill-item p {
    margin: 0;
    font-family: 'BaseFont', sans-serif;
    font-size: 10px; 
    color: #5f5f5f;
    line-height: 1.2; 
}

.clean-days-section {
    /* background-color: #FEFBF3; */
}

.clean-days-section p {
    margin: 0;
    font-family: 'TextFont', sans-serif;
    font-size: 17px;
    font-weight: 500;
    color: rgba(86, 76, 126, 0.92);
    text-align: center;
}

.reminder-section {
    text-align: left;
}

.reminder-section .reminder-content {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 5px;
}

.reminder-section .reminder-text {
    font-family: 'TextFont', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.reminder-section .edit-reminder-link {
    font-family: 'TextFont', sans-serif;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    display: block; 
    margin-top: 2px; 
}

.profile-settings-section {
}

.todo-list-section {
    will-change: opacity, transform; /* Оптимизация производительности анимации */
}

.todo-list-section .main-action-button {
    background-image: linear-gradient(to bottom, #d5c3f8, #8c52ff); /* Вертикальный градиент сверху вниз */
}

.main-action-button {
    background-image: linear-gradient(to bottom, #a171ff, #bd69ed);
    color: rgba(70, 52, 144, 1);
    border: none;
    padding: 14px 20px;
    border-radius: 25px;
    font-family: 'TextFont', sans-serif; 
    font-size: 16px;
    font-weight: 500; 
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background-color 0.2s ease;
    display: block;
}

.values-custom-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    border-radius: 25px;
    border: none;
    font-family: 'TextFont', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    /* Такой же градиент, как у Todo List */
    background-image: linear-gradient(to bottom, #d5c3f8, #8c52ff);
    color: rgba(70, 52, 144, 1);
    text-decoration: none;
}

/* Стиль для выделения слова без обводки */
.no-border-highlight {
    font-weight: 600;
    color: #8c52ff;
    margin-left: 4px;
    display: inline;
}

.main-action-button:hover {
    background-color: #7a45e0;
} 

.reminder-section .reminder-content, .edit-reminder-link {
    text-align: center;
    display: block;
    width: 100%;
}

/* Styles for the highlighted oval word part inside the main-action-button */
.main-action-button span.highlight-word-oval {
    display: inline-block;
    padding: 0.1em 0.5em;
    border: 1.5px solid rgba(70, 52, 144, 1); /* White border for the oval */
    border-radius: 1em;   /* Makes it oval/pill-shaped */
    margin-left: 4px;     /* A little space after "DO" */
    color: rgba(70, 52, 144, 1);       /* Text "LIST" should also be white */
    font-weight: inherit; /* Inherit font-weight from parent button */
    line-height: 1;       /* Helps with vertical alignment */
    background-color: transparent; /* Ensure no background color interferes */
}

/* Стиль для текстовой кнопки ценностей и приоритетов без обводки */
.text-only-button {
    background: transparent;
    box-shadow: none;
    color: rgba(70, 52, 144, 1);
    font-weight: 500;
    border: none;
    padding: 0;
    text-align: center;
    width: 100%;
}

.text-only-button span.highlight-word {
    font-weight: 600;
    display: inline;
    color: #8c52ff;
    margin-left: 4px;
    border: none;
    padding: 0;
}

/* The main-action-button already handles its own hover states and text color */

/* Отступы для fullscreen-mode */
html.fullscreen-mode .profile-container,
body.fullscreen-mode .profile-container {
    padding-top: var(--top-offset);
}

/* Контейнер для скругленного фона изображения маскота (как в therapy skills) */
.image-background-shape {
    width: 230px; /* Размер фона */
    background-color: rgb(243, 234, 253); /* Цвет фона как в therapy skills */
    border-radius: 300px; /* Значение для скругленного квадрата/прямоугольника - УВЕЛИЧЕНО */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px auto; /* Изменяем отступ снизу на 18px как gap между плашками */
    overflow: visible; /* Позволяем изображению выходить за пределы */
    position: relative; /* Для корректного отображения выступающего изображения */
}

/* Изображение маскота внутри подложки должно быть больше контейнера */
.image-background-shape .character-image {
    width: 253px; /* Ширина изображения (230px + ~10%) */
    height: auto; /* Сохраняем пропорции, изображение будет выступать */
    max-width: none; /* Снимаем ограничение max-width, чтобы изображение могло быть больше родителя */
    margin-bottom: 0; /* Убираем отступ, так как он уже есть у контейнера */
}

/* Анимации для подложки */
.animate-fade-in {
    opacity: 0;
    animation-fill-mode: forwards;
    animation-name: fadeIn;
    animation-duration: 0.5s;
    animation-timing-function: ease-out;
}

.delay-100 { animation-delay: 0.1s; }

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

body {
    padding-bottom: 85px !important;
}

/* Переопределение для iPhone 16 Pro Max и подобных устройств */
@media (min-width: 430px) and (max-width: 500px) {
    body {
        padding-bottom: calc(125px + env(safe-area-inset-bottom, 0px)) !important;
    }
    
    /* КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ: Переопределяем calc() из footer-style.css */
    html body {
        padding-bottom: calc(125px + env(safe-area-inset-bottom, 0px)) !important;
    }
    
    /* Дополнительная специфичность */
    body.has-footer {
        padding-bottom: calc(125px + env(safe-area-inset-bottom, 0px)) !important;
    }
    
    .profile-container {
        max-width: 405px !important;
        padding-bottom: 125px !important;
    }
}