/* Анимации для dashboard.php */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
    }
    to {
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        height: 0;
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        height: auto;
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        height: auto;
        opacity: 1;
        transform: translateY(0);
    }
    to {
        height: 0;
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes underlineExpand {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Карточки: появление с подъёмом */
.card {
    animation: fadeInUp 0.5s ease-out forwards;
    will-change: opacity, transform;
}

/* Заголовки: появление с лёгким смещением */
h2, h3, h4 {
    animation: fadeInUp 0.6s ease-out forwards;
    will-change: opacity, transform;
}

/* Кнопки: появление, ховер, клик */
.button, .button-success, .button-danger, .button-primary {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    will-change: transform, box-shadow;
    animation: scaleIn 0.4s ease-out forwards;
}

.button:hover, .button-success:hover, .button-danger:hover, .button-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.button:active, .button-success:active, .button-danger:active, .button-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Форма создания вишлиста: инпуты и кнопка */
.form-group input, .form-group button {
    transition: border-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    animation: fadeIn 0.5s ease-out forwards;
    will-change: border-color, transform, opacity;
}

.form-group input:focus {
    transform: scale(1.01);
    border-color: var(--accent-hover, #005BB5);
}

/* Форма редактирования: плавное открытие/закрытие */
.edit-wishlist-form {
    overflow: hidden;
    transition: all 0.3s ease;
}

.edit-wishlist-form[style*="display: block"] {
    animation: slideIn 0.3s ease-out forwards;
    will-change: height, opacity, transform;
}

.edit-wishlist-form[style*="display: none"] {
    animation: slideOut 0.3s ease-out forwards;
}

/* Ссылки: анимированное подчёркивание */
a {
    position: relative;
    transition: color 0.3s ease;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent, #007AFF);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
    animation: underlineExpand 0.3s ease forwards;
}

/* Контейнер: плавное появление */
.container {
    animation: fadeIn 0.6s ease-out forwards;
    will-change: opacity;
}

/* Медиа-запросы для мобильных */
@media (max-width: 768px) {
    .card {
        animation-duration: 0.4s;
    }
    .button, .button-success, .button-danger, .button-primary {
        animation-duration: 0.3s;
    }
    .edit-wishlist-form[style*="display: block"] {
        animation-duration: 0.3s;
    }
}