/* --- ГЛОБАЛЬНЫЕ СТИЛИ --- */
body {
    background-color: #f8f9fa; /* Светлый фон для всего сайта */
  
}

/* --- КАРТОЧКИ ПОЛЬЗОВАТЕЛЕЙ (Matches & Home) --- */
.match-card {
    border: none;
    border-radius: 15px; /* Скругленные углы */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    background: white;
}

.match-card:hover {
    transform: translateY(-5px); /* Всплытие */
    box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important;
}

.match-card-img-wrapper {
    height: 320px; /* Фиксированная высота фото */
    overflow: hidden;
    position: relative;
}

.match-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполнение без искажений */
    object-position: center top; /* Фокус на лице */
    transition: transform 0.5s ease;
}

.match-card:hover .match-card-img {
    transform: scale(1.05); /* Легкий зум фото */
}

/* Градиент внизу фото для читаемости текста, если он там будет */
.overlay-gradient {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
    pointer-events: none;
}

/* --- ПРОФИЛЬ (Profile View) --- */
/* Стильный контейнер для главного фото */
.profile-avatar-container {
    height: 500px;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    position: relative;
    background-color: white;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* --- СТАТУСЫ (Online/Offline) --- */
.status-indicator {
    font-size: 0.85rem;
}
.status-online {
    color: #198754; /* Green */
    font-weight: bold;
}
.status-offline {
    color: #6c757d; /* Gray */
}
/* --- Анимация аватара в чате --- */

.avatar-link {
    position: relative;
    display: inline-block;
    text-decoration: none;
}

/* Настраиваем картинку */
.avatar-link img {
    position: relative;
    z-index: 2; /* Картинка сверху */
    display: block; /* Убираем отступы снизу */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Создаем псевдо-элемент (кольцо) */
.avatar-link::before {
    content: '';
    position: absolute;
    /* Кольцо чуть больше картинки (отступ -5px) */
    top: -5px; 
    left: -5px; 
    right: -5px; 
    bottom: -5px;
    border-radius: 50%;
    /* Пунктирная граница (цвет можно поменять под дизайн) */
    border: 2px dashed #0d6efd; 
    opacity: 0; /* Скрыто по умолчанию */
    z-index: 1; /* Под картинкой */
    pointer-events: none; /* Чтобы клик проходил сквозь кольцо */
    transition: opacity 0.3s ease;
    
    /* Запускаем анимацию сразу, но невидимо */
    animation: spin-ring 10s linear infinite;
}

/* При наведении показываем кольцо */
.avatar-link:hover::before {
    opacity: 1;
}

/* При наведении чуть подсвечиваем аватар */
.avatar-link:hover img {
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
}

/* Сама анимация вращения */
@keyframes spin-ring {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Универсальный класс для анимации аватарок */
.avatar-hover-effect {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 1; /* Чтобы при увеличении аватарка была поверх других элементов */
}

.avatar-hover-effect:hover {
    transform: scale(1.2); /* Увеличиваем на 20% */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2); /* Добавляем красивую тень */
    z-index: 10;
}

    /* Базовый стиль для кнопок действий */
.btn-action {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 8px; /* Скругленные углы */
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px; /* Расстояние между иконкой и текстом */
}

    /* --- СТИЛЬ ДЛЯ UNMATCH (Красная) --- */
.btn-unmatch {
    color: #dc3545; /* Красный текст */
    background-color: transparent;
}

.btn-unmatch:hover {
    background-color: rgba(220, 53, 69, 0.1); /* Легкий красный фон */
    color: #b02a37; /* Темно-красный текст */
    transform: translateY(-2px); /* Чуть приподнимается */
    box-shadow: 0 4px 6px rgba(220, 53, 69, 0.15); /* Тень */
}

    /* --- СТИЛЬ ДЛЯ CANCEL (Серая) --- */
.btn-cancel {
    color: #6c757d;
    background-color: transparent;
}

.btn-cancel:hover {
    background-color: rgba(108, 117, 125, 0.1);
    color: #495057;
    transform: translateY(-2px);
}

    /* --- АНИМАЦИЯ ИКОНКИ (Тряска) --- */
@keyframes shake-icon {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

    /* При наведении на кнопку, иконка начинает трястись */
.btn-action:hover .action-icon {
    animation: shake-icon 0.4s ease-in-out;
    display: inline-block; /* Важно для трансформации */
}
    /* Дополнительный стиль для кнопки звезд */
.btn-stars {
    background: linear-gradient(45deg, #FFD700, #FFC107);
    border: none;
    color: #333;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.2s;
}
.btn-stars:active { /* Active вместо Hover для мобильных */
    transform: scale(0.95);
}
@media (min-width: 768px) {
    .bottom-nav { display: none; }
    .form_login {
        width: 50%;
    }
    }
@media (min-width: 1100px) {
    .photo_expand{
--bs-modal-width:100%;
    }
    
}
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
}
.nav-item-mobile {
    text-align: center;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.8rem;
}
.nav-item-mobile.active {
    color: #d63384; /* Розовый цвет */
    font-weight: bold;
}
.nav-icon {
    font-size: 1.5rem;
    display: block;
}

/* Базовый стиль для больших кнопок действий */
.action-btn-large {
    width: 70px;
    height: 70px;
    border-radius: 50%; /* Круг */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border: 2px solid;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Эффект пружины */
    background-color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Эффект нажатия (уменьшение) */
.action-btn-large:active {
    transform: scale(0.9);
}

/* Состояние "Активно" (расширенная кнопка) */
.action-btn-large.active-state {
    width: 160px; /* Растягиваем ширину */
    border-radius: 50px; /* Делаем овалом (пилюлей) */
    background-color: currentColor; /* Заливаем текущим цветом (зеленым/красным) */
    color: white !important; /* Текст белый */
    font-size: 1.2rem; /* Уменьшаем шрифт для текста */
    font-weight: bold;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    pointer-events: none; /* Блокируем повторные клики */
}

/* Иконка внутри кнопки */
.action-btn-large i {
    transition: opacity 0.2s;
}

/* Спан для текста (скрыт по умолчанию) */
.action-btn-large span {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

/* Показываем текст, когда кнопка активна */
.action-btn-large.active-state span {
    display: inline-block;
    opacity: 1;
}
.action-btn-large.active-state i {
    display: none; /* Скрываем иконку при расширении */
}
.text-success.active-state {
    background-color: #198754 !important; /* Зеленый фон Bootstrap */
    color: white !important;              /* Белый текст */
    border-color: #198754 !important;     /* Зеленая рамка */
}

/* 2. Для кнопки ПРОПУСТИТЬ (Красная) в активном состоянии */
.text-danger.active-state {
    background-color: #dc3545 !important; /* Красный фон Bootstrap */
    color: white !important;              /* Белый текст */
    border-color: #dc3545 !important;     /* Красная рамка */
}

/* Убираем эффект наведения (hover), когда кнопка уже нажата (активна), 
   чтобы она не меняла цвет обратно */
.active-state:hover {
    background-color: #198754 !important; 
    color: white !important;
    opacity: 1 !important;
}
.text-danger.active-state:hover {
    background-color: #dc3545 !important;
}
.action-btn-mini:active {
        transform: scale(0.9);
    }
    .action-btn-mini:hover {
        transform: scale(1.1);
    }

.gift-zoom-container {
        width: 120px; 
        height: 120px; 
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

.gift-zoom-effect {
        /* Изначально делаем картинку БОЛЬШОЙ (чтобы браузер загрузил HD качество) */
        width: 200px;
        height: 200px;
        max-width: none; /* Отключаем ограничения Bootstrap */
        object-fit: contain;
        position: absolute; /* Чтобы она могла свободно увеличиваться */
        
        /* Сжимаем её для обычного состояния (200px * 0.55 = 110px) */
        transform: scale(0.55); 
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        cursor: pointer;
        filter: drop-shadow(0px 20px 25px rgba(0,0,0,0.15));
    }
.gift-zoom-effect:hover {
        /* При наведении возвращаем в 100% масштаб (200px) — качество будет идеальным! */
        transform: scale(1.6) rotate(-5deg); 
        z-index: 10;
    }

/* Делаем аватарку отправителя круглой и красивой */
.sender-avatar {
        object-fit: cover;
        border: 2px solid #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Контейнер картинки подарка в модалке */
    .gift-modal-img-container {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 80px;
    }

    /* Сама картинка (грузим большую, сжимаем для четкости) */
    .gift-modal-zoom {
        width: 140px;
        height: 140px;
        object-fit: contain;
        position: absolute;
        transform: scale(0.8); /* Сжимаем до ~84px */
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        filter: drop-shadow(0px 8px 10px rgba(0,0,0,0.1));
    }

    /* 1. Эффект наведения ТОЛЬКО для компьютеров */
    @media (hover: hover) {
        .gift-item:hover .gift-modal-zoom {
            transform: scale(1.6) rotate(-5deg); /* Возвращаем 100% размер */
            z-index: 10;
        }
        .gift-item:hover {
            background-color: #f8f9fa !important;
        }
    }

    /* 2. Эффект ВЫБРАННОГО подарка (Для ПК и Телефонов) */
    .gift-item {
        border: 2px solid transparent !important; /* Невидимая рамка для плавности */
        transition: all 0.2s ease;
    }
    
    .gift-item.selected-gift {
        border: 2px solid #198754 !important; /* Яркая зеленая рамка */
        background-color: #f0fdf4 !important; /* Нежно-зеленый фон */
        box-shadow: 0 8px 20px rgba(25, 135, 84, 0.2) !important;
        transform: scale(1.05); /* Карточка чуть выпирает вперед */
    }
    
    /* При выборе на телефоне картинка остается увеличенной, чтобы ее рассмотреть */
    .gift-item.selected-gift .gift-modal-zoom {
        transform: scale(0.9);
        z-index: 5;
    }
    /* Пользовательская кнопка в стиле Alert */
.btn-soft-alert {
    /* Настройте эти 3 цвета по своему вкусу: */
    --soft-bg: #fff3cd;       /* Цвет фона (сейчас нежно-желтый/предупреждающий) */
    --soft-text: #664d03;     /* Цвет текста и иконки */
    --soft-border: #ffecb5;   /* Цвет тонкой рамки */
    --soft-hover: #ffecb5;    /* Цвет фона при наведении мышкой */

    background-color: var(--soft-bg);
    color: var(--soft-text);
    border: 1px solid var(--soft-border);
    border-radius: 0.5rem; /* Закругление краев */
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn-soft-alert:hover {
    background-color: var(--soft-hover);
    color: var(--soft-text);
    transform: translateY(-1px); /* Легкий эффект поднятия при клике/наведении */
}




/* --- АДАПТИВНЫЕ КАРТОЧКИ MATCHES --- */

/* 1. БАЗОВЫЕ НАСТРОЙКИ (Для ПК и планшетов шире 600px) */
.match-card-img-wrapper {
    width: 100%;
    aspect-ratio: 3 / 4; /* Вытянутый портретный формат для больших экранов */
    overflow: hidden;
    position: relative;
}

.match-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* Лицо всегда в кадре */
}
.cf {
    height: 300px;
}

.offcanvas {
        --bs-offcanvas-width: 300px;
    }
.row_block_photo {
    display: flex;
     flex-direction: column;
    }

.gallery_row{
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 15px;
}
.img_prof {
    height: 80px; 
    object-fit: cover;
}

 .prof_view_photo{
    width:100%; 
    object-fit: cover
 }

 .close_btn_photo{
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    z-index: 1050; 
    border: 2px solid white; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
 }
.btn_x{
    font-size: 1.2rem; 
    color: white; 
    -webkit-text-stroke: 1px;
}
.matches_cards_block {
    justify-content: center;
}
.span_index{
    font-size: 0.6rem;
}


@media (max-width: 1400px){
    .card_block_wr {
      width: 33%; 
    }
}   
@media(max-width: 1200px) {
    
    
   
     .img_prof {
    height: 100px; 
    
    
    }
}
@media(max-width: 1000px){
 .form_login {
        width: 60%;
    }
    
    .col-md-8{
            width: 100%;
        }
   .prof_row {
    width: 100%;
   }
     .row_block_photo {
    flex-direction: row;
    }
    .gallery_row{
        width: 33.33%;
    }
   
      .photo_expand{
    --bs-modal-width:90%;
    }
}
@media(max-width:991px) {
    .span_index {
        margin-left: 10px;
        
    }
    

}
@media(max-width: 900px) {
        .form_login {
        width: 70%;
    }
}
/* Делаем текст и кнопки чуть компактнее на смартфонах */
@media (max-width: 767.98px) {
    .match-card .card-body {
        padding: 0.75rem;
    }
    .offcanvas.offcanvas-end.show {
        width: 300px;
    }
    .gallery_row {
        width: 100%;
    }
    .row_block_photo {
    flex-direction: column;
   
    }
    .form_login {
        width: 100%;
    }
    .cf {
    height: auto;
    
    }
    .form_login {
        width: 70%;
    }
    .close_btn_photo{
        width: 25px;
        height: 25px;
    }
    .btn_x {
     font-size: 0.9rem;
       -webkit-text-stroke: 0px;
    }
    .action-btn-large {
    width: 45px;
    height: 45px;
    }
    .cb {
        width: 350px;
    }
    .profile_item_photo{
        width: 70%;
        margin: 5px auto;
    }
    .h5_photos{
        text-align: center;
        margin-bottom: 25px;
    }
    .match-card .card-title {
        font-size: 1.1rem !important;
    }
    .match-card .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }
    .action-icon {
        display: none; /* Прячем эмодзи "🚫" в кнопках на узких экранах для экономии места */
    }
    .header_center{
        text-align: center;
    }
    .block_center {
        margin: 0 auto;
    }
    .cart_matches{
        width: 320px;
    }
    .form_login {
        width: 80%;
    }
}
/* 2. ЭКРАНЫ ОТ 400px ДО 600px */
@media (max-width: 600px) {
    .match-card-img-wrapper {
        width: 320px !important;
        max-width: 100%; /* Защита от появления горизонтального скролла */
        height: 320px !important; /* Квадрат 320х320 */
        aspect-ratio: auto; /* Отключаем пропорцию */
        margin: 0 auto; /* Центрируем фото внутри белой карточки */
    }
    .w1b {
        width: 275px;
        margin: 0 auto;
    }
    .profile-avatar-container {
        height: 300px;
    }
   
}
@media (max-width: 460px) {
     
    .gallery_row {
        width: 100%;
        height: 100px;
        margin-bottom: 40px;
    }
    .img_prof {
    height: 120px; 
    
    }
     .form_login {
        width: 100%;
    }
}
/* 3. ЭКРАНЫ НИЖЕ 400px */
@media (max-width: 399.98px) {
    .match-card-img-wrapper {
        width: 320px !important;
        max-width: 100%;
      
        aspect-ratio: auto;
        margin: 0 auto;
    }
    .font1 {
        font-size: 13px;
    }
    .cb {
        width: 300px;
    }
}