/* ============================================
   MODERNE ANIMATIONEN FÜR FORDJONLY
   Seitenwechsel, Modals, Sidebars
   ============================================ */

/* ============================================
   SEITENWECHSEL ANIMATIONEN
   ============================================ */

/* Section Transition Classes - HÖCHSTE PRIORITÄT */
.section {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important, 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.section.section-exit {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
    pointer-events: none !important;
}

.section.section-enter {
    opacity: 0 !important;
    transform: translateY(20px) !important;
}

.section.section-enter-active {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Fade Animation für Sections */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Slide Animation für Sections */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* ============================================
   MODAL ANIMATIONEN
   ============================================ */

/* Modal Backdrop Animation - HÖCHSTE PRIORITÄT */
.modal-backdrop {
    opacity: 0 !important;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background-color: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.modal-backdrop.show,
.modal-backdrop.fade.show,
body .modal-backdrop.show,
body .modal-backdrop.fade.show {
    opacity: 1 !important;
    background-color: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* Modal Dialog Animation - Bootstrap kompatibel mit höherer Spezifität */
.modal {
    display: none;
}

.modal.show,
.modal.fade.show {
    display: flex !important;
}

/* Modal Dialog - Initial State */
.modal.fade .modal-dialog {
    transform: scale(0.9) translateY(-30px) !important;
    opacity: 0 !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important,
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Modal Dialog - Show State */
.modal.fade.show .modal-dialog,
.modal.show .modal-dialog {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
}

/* Modal Content Animation */
.modal-content {
    animation: modalContentSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

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

/* Spezielle Animation für Login/Register Modals */
#login-modal .modal-dialog,
#register-modal .modal-dialog,
#loginModal .modal-dialog,
#registerModal .modal-dialog {
    transform: scale(0.85) translateY(-40px) !important;
}

#login-modal.fade.show .modal-dialog,
#register-modal.fade.show .modal-dialog,
#loginModal.fade.show .modal-dialog,
#registerModal.fade.show .modal-dialog {
    transform: scale(1) translateY(0) !important;
}

/* ============================================
   LOUNGE SIDEBAR ANIMATIONEN
   ============================================ */

/* Left Sidebar Animation - HÖCHSTE PRIORITÄT */
.lounge-sidebar {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important,
                width 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important,
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.lounge-sidebar.collapsed {
    transform: translateX(0) !important;
    opacity: 1 !important;
    width: 60px !important;
}

.lounge-sidebar:not(.collapsed) {
    transform: translateX(0) !important;
    opacity: 1 !important;
    width: 280px !important;
}

/* Sidebar Toggle Button Animation */
.lounge-sidebar-toggle-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lounge-sidebar-toggle-btn i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lounge-sidebar:not(.collapsed) ~ .lounge-sidebar-toggle-btn i,
body:not(:has(.lounge-sidebar.collapsed)) .lounge-sidebar-toggle-btn i {
    transform: rotate(180deg);
}

/* Sidebar Nav Items Animation */
.lounge-sidebar:not(.collapsed) .lounge-nav-item {
    animation: sidebarItemFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.lounge-sidebar:not(.collapsed) .lounge-nav-item:nth-child(1) { animation-delay: 0.05s; }
.lounge-sidebar:not(.collapsed) .lounge-nav-item:nth-child(2) { animation-delay: 0.1s; }
.lounge-sidebar:not(.collapsed) .lounge-nav-item:nth-child(3) { animation-delay: 0.15s; }
.lounge-sidebar:not(.collapsed) .lounge-nav-item:nth-child(4) { animation-delay: 0.2s; }
.lounge-sidebar:not(.collapsed) .lounge-nav-item:nth-child(5) { animation-delay: 0.25s; }
.lounge-sidebar:not(.collapsed) .lounge-nav-item:nth-child(6) { animation-delay: 0.3s; }
.lounge-sidebar:not(.collapsed) .lounge-nav-item:nth-child(7) { animation-delay: 0.35s; }
.lounge-sidebar:not(.collapsed) .lounge-nav-item:nth-child(8) { animation-delay: 0.4s; }

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

/* Right Sidebar Animation - HÖCHSTE PRIORITÄT */
.lounge-right-sidebar {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important,
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.lounge-right-sidebar:not(.open) {
    transform: translateX(100%) !important;
    opacity: 0 !important;
}

.lounge-right-sidebar.open {
    transform: translateX(0) !important;
    opacity: 1 !important;
}

/* Right Sidebar Toggle Button Animation */
.lounge-right-sidebar-toggle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lounge-right-sidebar.open ~ .lounge-right-sidebar-toggle,
body:has(.lounge-right-sidebar.open) .lounge-right-sidebar-toggle {
    transform: translateY(-50%) scale(1.05);
    background: var(--primary-color);
    color: white;
}

/* Right Sidebar Content Animation */
.lounge-right-sidebar.open .lounge-right-track-item {
    animation: rightSidebarItemFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.lounge-right-sidebar.open .lounge-right-track-item:nth-child(1) { animation-delay: 0.05s; }
.lounge-right-sidebar.open .lounge-right-track-item:nth-child(2) { animation-delay: 0.1s; }
.lounge-right-sidebar.open .lounge-right-track-item:nth-child(3) { animation-delay: 0.15s; }
.lounge-right-sidebar.open .lounge-right-track-item:nth-child(4) { animation-delay: 0.2s; }
.lounge-right-sidebar.open .lounge-right-track-item:nth-child(5) { animation-delay: 0.25s; }

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

/* ============================================
   ALLGEMEINE ANIMATIONEN
   ============================================ */

/* Smooth Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Smooth Fade Out */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scale Out Animation */
@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Slide In From Bottom */
@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Out To Bottom */
@keyframes slideOutBottom {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(30px);
    }
}

/* ============================================
   PERFORMANCE OPTIMIERUNGEN
   ============================================ */

/* GPU-Beschleunigung für Animationen */
.section,
.modal-dialog,
.lounge-sidebar,
.lounge-right-sidebar,
.modal-backdrop {
    will-change: transform, opacity;
}

/* Reduziere Animationen für reduzierte Bewegung */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

