/* ===== БАЗОВЫЕ АНИМАЦИИ ===== */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes pulse-logo {
    0%, 100% {
        text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 50px rgba(102, 126, 234, 0.8), 0 0 80px rgba(139, 92, 246, 0.4);
        transform: scale(1.02);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(102, 126, 234, 0.3),
            0 4px 6px rgba(0, 0, 0, 0.07);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(102, 126, 234, 0.6),
            0 8px 12px rgba(0, 0, 0, 0.15);
    }
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modal-disappear {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
}

@keyframes login-form-appear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

/* ===== DROPDOWN АНИМАЦИИ ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===== КНОПКИ И ИНТЕРАКТИВНЫЕ ЭЛЕМЕНТЫ ===== */
@keyframes button-click {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes button-hover-glow {
    0% {
        box-shadow: var(--shadow-md);
    }
    100% {
        box-shadow: var(--shadow-lg), 0 0 30px rgba(102, 126, 234, 0.4);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== ROADMAP АНИМАЦИИ ===== */
@keyframes database-appear {
    from {
        opacity: 0;
        transform: scale(0.3) rotate(180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes database-disappear {
    from {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    to {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg);
    }
}

@keyframes database-select {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.8);
    }
}

@keyframes connection-draw {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes package-flow {
    0% {
        offset-distance: 0%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        offset-distance: 100%;
        opacity: 0;
    }
}

/* ===== ZOOM И CONTROL АНИМАЦИИ ===== */
@keyframes zoom-in-animation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes zoom-out-animation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes control-hover {
    0% {
        transform: translateX(0) scale(1);
        box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: translateX(-4px) scale(1.08);
    }
    100% {
        transform: translateX(-8px) scale(1.15);
        box-shadow: var(--shadow-lg), 0 0 25px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

@keyframes control-panel-slide-in {
    0% {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes control-btn-cascade {
    0% {
        opacity: 0;
        transform: translateX(50px) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* ===== УВЕДОМЛЕНИЯ ===== */
@keyframes notification-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notification-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ===== МЕТРИКИ ===== */
@keyframes metric-update {
    0% {
        transform: scale(1);
        box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    30% {
        transform: scale(1.05);
        box-shadow: var(--shadow-md), 0 0 15px rgba(102, 126, 234, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

@keyframes metric-pulse {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    50% {
        opacity: 0.8;
        text-shadow: 0 0 15px rgba(102, 126, 234, 0.8);
    }
}

@keyframes metric-hover-glow {
    0% {
        box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.1);
        transform: translateY(0) scale(1);
    }
    100% {
        box-shadow: var(--shadow-lg), 0 0 20px rgba(102, 126, 234, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
        transform: translateY(-3px) scale(1.05);
    }
}

@keyframes metric-slide-in {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== МАГНИТНЫЕ ЭФФЕКТЫ ===== */
@keyframes magnetic-attraction {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes snap-animation {
    0% {
        filter: drop-shadow(0 0 0 rgba(102, 126, 234, 0));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.8));
    }
    100% {
        filter: drop-shadow(0 0 0 rgba(102, 126, 234, 0));
    }
}

/* ===== LOADING И STATES ===== */
@keyframes loading-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes loading-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== PASSWORD TOGGLE ===== */
@keyframes password-toggle-click {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(0.9) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes password-show {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== ПРИМЕНЕНИЕ АНИМАЦИЙ ===== */

/* Модальные окна */
.modal.active {
    animation: modal-fade-in 0.3s ease-out;
}

.modal.active .modal-content {
    animation: modal-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active#loginModal .modal-content {
    animation: login-form-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Логотип */
.logo {
    animation: pulse-logo 3s ease-in-out infinite;
}

/* Кнопки */
.btn:active {
    animation: button-click 0.2s ease-out;
}

.btn-primary:hover {
    animation: button-hover-glow 0.3s ease-out forwards;
}

/* Control кнопки */
.control-btn:hover {
    animation: control-hover 0.3s ease-out forwards;
}

/* Метрики */
.metric:hover {
    animation: metric-hover-glow 0.3s ease-out forwards;
}

/* Canvas анимации */
.roadmap-canvas.zoom-in-animation {
    animation: zoom-in-animation 0.3s ease-out;
}

.roadmap-canvas.zoom-out-animation {
    animation: zoom-out-animation 0.3s ease-out;
}

/* База данных */
.database-appear {
    animation: database-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.database-selected {
    animation: database-select 1.5s ease-in-out infinite;
}

.snap-animation {
    animation: snap-animation 0.3s ease-out;
}

/* Метрики */
.metric-update {
    animation: metric-update 0.4s ease-out;
}

.metric:hover {
    animation: metric-pulse 2s ease-in-out infinite;
}

/* Уведомления */
.notification.show {
    animation: notification-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notification.hide {
    animation: notification-slide-out 0.3s ease-in;
}

/* Password toggle */
.password-toggle:active {
    animation: password-toggle-click 0.2s ease-out;
}

.password-toggle.visible {
    animation: password-show 0.3s ease-out;
}

/* Loading состояния */
.loading {
    animation: loading-pulse 1.5s ease-in-out infinite;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
}

/* Dropdown */
.dropdown-content {
    animation: slideDown 0.3s ease-out;
}

.dropdown.closing .dropdown-content {
    animation: slideUp 0.3s ease-in;
}

/* Hover эффекты */
.btn:hover::before {
    animation: shimmer 0.6s ease-out;
}

/* Адаптивные анимации */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
} 

/* ===== АНИМАЦИЯ ПУЛЬСАЦИИ ОТКЛЮЧЕНА ДЛЯ УЛУЧШЕНИЯ МЕТРИК ===== */
/* .pulse-click {
    display: none;
} */

/* ===== KEYFRAMES ПУЛЬСАЦИИ ОТКЛЮЧЕНЫ ДЛЯ УЛУЧШЕНИЯ МЕТРИК ===== */
/* @keyframes roadmap-pulse {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
        transform: scale(0);
    }
    50% {
        width: 20px;
        height: 20px;
        opacity: 0.6;
        transform: scale(1);
    }
    100% {
        width: 40px;
        height: 40px;
        opacity: 0;
        transform: scale(1.2);
    }
} */

/* ===== СТИЛЬНЫЕ КУРСОРЫ ПЕРЕНЕСЕНЫ В main.css ДЛЯ ИЗБЕЖАНИЯ КОНФЛИКТОВ ===== */ 