/* ============================================
   Дополнительные стили для JavaScript-компонентов
   ============================================ */

/* Кнопка "Наверх" */
#scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    display: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    border: none;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

#scroll-top-btn:hover {
    background-color: #0b5ed7;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

#scroll-top-btn.show {
    display: block !important;
    animation: fadeInUp 0.3s ease;
}

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

/* Контейнер для тостов */
.toast-container {
    z-index: 9999;
}

.toast-container .toast {
    min-width: 250px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Анимация для кнопок избранного */
.favorite-btn {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.favorite-btn:hover {
    transform: scale(1.1);
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.favorite-btn .fa-heart {
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.favorite-btn .fa-heart.text-danger {
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Стили для слайдеров цен */
.price-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.price-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    border: 2px solid white;
}

.price-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0d6efd;
}

/* Ленивая загрузка изображений */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[data-src].loaded {
    opacity: 1;
}

/* Стили для темной темы */
[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --text-color: #eee;
    --card-bg: #2d2d44;
    --border-color: #444;
}

[data-theme="dark"] body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

[data-theme="dark"] .card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .navbar {
    background-color: #16213e !important;
}

[data-theme="dark"] .bg-light {
    background-color: #2d2d44 !important;
}

[data-theme="dark"] .text-muted {
    color: #aaa !important;
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    #scroll-top-btn {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
        font-size: 1rem;
    }
    
    .favorite-btn {
        width: 30px;
        height: 30px;
    }
    
    .toast-container {
        padding: 10px;
    }
}

/* ============================================
   Стили для кнопки "В избранное" (сердечко)
   ============================================ */

/* Кнопка избранного */
.favorite-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.favorite-btn:hover {
    transform: scale(1.15);
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.favorite-btn i {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.favorite-btn i.fa-heart.text-danger {
    color: #dc3545 !important;
    animation: heartPulse 0.3s ease;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Анимация для сердечка при добавлении */
.favorite-btn .fa-beat-fade {
    animation: fa-beat-fade 1s ease infinite;
}

@keyframes fa-beat-fade {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .favorite-btn {
        width: 32px;
        height: 32px;
    }
    
    .favorite-btn i {
        font-size: 1rem;
    }
}

/* Счетчик избранного */
.favorite-count {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 1px 6px;
    border-radius: 10px;
    color: #333;
    font-weight: 600;
    margin-left: 2px;
}

/* ============================================
   Стили для сердечка на детальной странице
   ============================================ */

/* Кнопка избранного на детальной странице */
.favorite-btn-lg {
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.favorite-btn-lg:hover {
    transform: scale(1.1);
    border-color: #dc3545;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.15);
}

.favorite-btn-lg i {
    transition: all 0.3s ease;
}

.favorite-btn-lg i.fa-heart.text-danger {
    color: #dc3545 !important;
}

.favorite-btn-lg i.fa-heart.text-danger {
    animation: heartPulse 0.4s ease;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .favorite-btn-lg {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Стили для формы редактирования фотографий */
#existing-images .card {
    transition: all 0.3s ease;
}

#existing-images .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#existing-images .card .form-check-input:checked + .form-check-label {
    color: #0d6efd;
    font-weight: 600;
}

.new-image-form {
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.new-image-form:hover {
    background: #f1f3f5;
    border-color: #0d6efd !important;
}

.remove-image-btn {
    width: 100%;
}

#add-image-btn {
    margin-top: 5px;
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .new-image-form .col-md-2 {
        margin-top: 10px;
    }
    
    #existing-images .col-md-4 {
        margin-bottom: 15px;
    }
}

/* Стили для чекбокса удаления */
.image-form .form-check.text-danger .form-check-label {
    color: #dc3545;
}

.image-form .form-check.text-danger .form-check-label:hover {
    text-decoration: underline;
}

/* Превью изображений в форме */
.image-form img {
    border-radius: 8px;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.image-form img:hover {
    border-color: #0d6efd;
    transform: scale(1.02);
}