/**
 * ====================================================================
 * Pavo Admin Dashboard - Smooth & Slow Animations
 * Copyright © 2024 RefineThemes.com
 * Author: Saleem Raza
 * Founder: RefineThemes.com
 * License: MIT
 * ====================================================================
 */

/* ============================================
   GLOBAL SMOOTH TRANSITIONS
   ============================================ */

/* Apply smooth transitions to all elements */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Smooth transitions for common properties */
a, button, .btn, .nav-link, .dropdown-item {
  transition: all 0.4s ease-in-out !important;
}

/* ============================================
   NAVIGATION ANIMATIONS
   ============================================ */

/* Sidebar menu items */
.sidebar .nav-link {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar .nav-link:hover {
  transition: all 0.3s ease-out !important;
}

/* Menu expand/collapse */
.nav .has-sub {
  transition: max-height 0.6s ease-in-out !important;
}

/* ============================================
   ICON ANIMATIONS (SLOWER)
   ============================================ */

/* Shake animation - slower */
.shake {
  -webkit-animation: shake 2.5s ease-in-out infinite !important;
  animation: shake 2.5s ease-in-out infinite !important;
}

/* Spin animation - slower */
.spin {
  -webkit-animation: spin 4s linear infinite !important;
  animation: spin 4s linear infinite !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Ringing animation - slower and smoother */
.ringing {
  animation: ring 1s ease-in-out infinite alternate !important;
}

@keyframes ring {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(10deg); }
}

/* ============================================
   BUTTON & CARD ANIMATIONS
   ============================================ */

/* Button hover effects */
.btn {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn:hover {
  transition: all 0.3s ease-out !important;
  transform: translateY(-2px);
}

/* Card hover effects */
.card {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.card:hover {
  transition: all 0.4s ease-out !important;
}

/* ============================================
   DROPDOWN ANIMATIONS
   ============================================ */

.dropdown-menu {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  animation: slideDown 0.5s ease-out !important;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   MODAL ANIMATIONS
   ============================================ */

.modal.fade .modal-dialog {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.modal.show .modal-dialog {
  animation: modalSlideIn 0.5s ease-out !important;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   SEARCH BAR ANIMATIONS
   ============================================ */

.navbar .search-bar .search-input {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.navbar .search-bar .search-input:focus {
  transition: width 0.5s ease-out !important;
}

/* ============================================
   USER PANEL ANIMATIONS
   ============================================ */

.user-panel {
  transition: max-height 1.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.hide-profile .user-panel {
  transition: max-height 1s ease-in-out !important;
}

.sidebar .user-panel .user-image {
  transition: opacity 1.5s ease-in-out !important;
}

/* ============================================
   SETTINGS PANEL ANIMATIONS
   ============================================ */

.settings-menu {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
  animation: slideInRight 0.6s ease-out !important;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.settings-btn {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.settings-btn .settings-icon {
  transition: transform 0.5s ease-in-out !important;
}

/* ============================================
   FORM ELEMENTS ANIMATIONS
   ============================================ */

.form-control {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.form-control:focus {
  transition: all 0.3s ease-out !important;
}

.form-check-input {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.form-switch .form-check-input {
  transition: background-position 0.4s ease-in-out !important;
}

/* ============================================
   GLOW ANIMATIONS (SLOWER)
   ============================================ */

.advanced-glow {
  animation: advanced-glow 4s ease-in-out infinite alternate !important;
}

@keyframes advanced-glow {
  0% {
    filter: brightness(1) drop-shadow(0 0 10px #383838);
  }
  100% {
    filter: brightness(1.2) drop-shadow(0 0 20px #666);
  }
}

.filter-glow {
  animation: filter-glow 3s ease-in-out infinite alternate !important;
}

@keyframes filter-glow {
  0% {
    filter: brightness(1) drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
  }
  100% {
    filter: brightness(1.3) drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
  }
}

.rainbow-glow {
  animation: rainbow-glow 5s linear infinite !important;
}

@keyframes rainbow-glow {
  0% { filter: drop-shadow(0 0 10px #ff0000); }
  16.67% { filter: drop-shadow(0 0 10px #ff7f00); }
  33.33% { filter: drop-shadow(0 0 10px #ffff00); }
  50% { filter: drop-shadow(0 0 10px #00ff00); }
  66.67% { filter: drop-shadow(0 0 10px #0000ff); }
  83.33% { filter: drop-shadow(0 0 10px #8b00ff); }
  100% { filter: drop-shadow(0 0 10px #ff0000); }
}

.glow-image {
  animation: glow 3s ease-in-out infinite alternate !important;
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #e60073, 0 0 20px #e60073;
  }
  to {
    box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #e60073, 0 0 40px #e60073;
  }
}

.neon-border {
  animation: neon-border 2.5s ease-in-out infinite alternate !important;
}

@keyframes neon-border {
  from {
    box-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #08f, 0 0 20px #08f;
  }
  to {
    box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #08f, 0 0 40px #08f;
  }
}

/* ============================================
   HOVER EFFECTS (SMOOTHER)
   ============================================ */

.hover-glow {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.hover-glow:hover {
  transition: all 0.4s ease-out !important;
}

/* ============================================
   SIDEBAR ANIMATIONS
   ============================================ */

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes push-in {
  from {
    margin-left: 0rem;
  }
  to {
    margin-left: 14rem;
  }
}

@keyframes push-sidebar-out {
  from {
    margin-left: 14rem;
  }
  to {
    margin-left: 0rem;
  }
}

@keyframes sidebar-push-in {
  from {
    width: 0px;
  }
  to {
    width: 250px;
  }
}

/* Apply slower timing to sidebar animations */
.sidebar {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.push-sidebar .main-content {
  transition: margin-left 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ============================================
   TYPEWRITER ANIMATIONS (SLOWER)
   ============================================ */

.typewriter {
  animation: typing 5s alternate-reverse infinite !important;
}

.typewriter-2 {
  animation: typing 9s alternate infinite !important;
}

.typewriter-3 {
  animation: typing 6s alternate infinite !important;
}

.typewriter-4 {
  animation: typing 10s alternate infinite !important;
}

@keyframes typing {
  from { 
    width: 0%; 
    margin-left: -10.7px; 
  }
  to { 
    width: 100%; 
    margin-left: 0px; 
  }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #00d4ff; }
}

/* ============================================
   PROGRESS BAR ANIMATIONS
   ============================================ */

.progress-bar {
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ============================================
   TOOLTIP & POPOVER ANIMATIONS
   ============================================ */

.tooltip {
  transition: opacity 0.4s ease-in-out !important;
}

.popover {
  transition: opacity 0.4s ease-in-out !important;
  animation: popoverFadeIn 0.5s ease-out !important;
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   ALERT ANIMATIONS
   ============================================ */

.alert {
  animation: alertSlideIn 0.6s ease-out !important;
}

@keyframes alertSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   BADGE ANIMATIONS
   ============================================ */

.badge {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.badge:hover {
  transition: all 0.2s ease-out !important;
  transform: scale(1.05);
}

/* ============================================
   ACCORDION ANIMATIONS
   ============================================ */

.accordion-collapse {
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.accordion-button {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ============================================
   TAB ANIMATIONS
   ============================================ */

.nav-tabs .nav-link {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.tab-content {
  animation: tabFadeIn 0.5s ease-out !important;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

html {
  scroll-behavior: smooth !important;
}

.scroll-up-btn {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.scroll-up-btn:hover {
  transition: all 0.3s ease-out !important;
  transform: translateY(-5px);
}

/* ============================================
   MEGA MENU ANIMATIONS
   ============================================ */

.mega-menu {
  animation: megaMenuSlideDown 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes megaMenuSlideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

.spinner-border {
  animation: spinner-border 1.2s linear infinite !important;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

.spinner-grow {
  animation: spinner-grow 1.2s linear infinite !important;
}

@keyframes spinner-grow {
  0% {
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: none;
  }
}

/* ============================================
   REDUCE MOTION FOR ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
