/* Animações Modernas para Opanel */
/* Arquivo: css/modern-animations.css */

/* Animações de Entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes slideInDown {
  from {
    transform: translate3d(0, -100%, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  50% {
    opacity: 1;
  }
}

/* Animações de Carregamento */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}

/* Animações para Elementos Específicos */
.card {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

.info-box {
  animation: fadeInLeft 0.6s ease-out;
  animation-fill-mode: both;
}

.info-box:nth-child(1) { animation-delay: 0.1s; }
.info-box:nth-child(2) { animation-delay: 0.2s; }
.info-box:nth-child(3) { animation-delay: 0.3s; }
.info-box:nth-child(4) { animation-delay: 0.4s; }

/* Animações para Sidebar */
.nav-sidebar .nav-item {
  animation: fadeInLeft 0.4s ease-out;
  animation-fill-mode: both;
}

.nav-sidebar .nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-sidebar .nav-item:nth-child(2) { animation-delay: 0.15s; }
.nav-sidebar .nav-item:nth-child(3) { animation-delay: 0.2s; }
.nav-sidebar .nav-item:nth-child(4) { animation-delay: 0.25s; }
.nav-sidebar .nav-item:nth-child(5) { animation-delay: 0.3s; }
.nav-sidebar .nav-item:nth-child(6) { animation-delay: 0.35s; }
.nav-sidebar .nav-item:nth-child(7) { animation-delay: 0.4s; }
.nav-sidebar .nav-item:nth-child(8) { animation-delay: 0.45s; }
.nav-sidebar .nav-item:nth-child(9) { animation-delay: 0.5s; }
.nav-sidebar .nav-item:nth-child(10) { animation-delay: 0.55s; }

/* Animações Hover para Cards */
.card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Animações Hover para Botões */
.btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
  border: 2px solid var(--border-color);
  background: transparent;
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--accent-gold);
  transition: width 0.3s ease;
  z-index: -1;
}

.btn-secondary:hover::before {
  width: 100%;
}

.btn-secondary:hover {
  color: #000 !important;
  border-color: var(--accent-gold);
}

/* Animações para Tabelas */
.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Animações para Formulários */
.form-control {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus {
  transform: scale(1.02);
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
}

/* Animações para Sidebar Menu */
.nav-sidebar .nav-link {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-sidebar .nav-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gold);
  transition: width 0.3s ease;
  transform: translateY(-50%);
}

.nav-sidebar .nav-link:hover::before,
.nav-sidebar .nav-link.active::before {
  width: 100%;
}

/* Animações para Page Loading */
.content-wrapper {
  animation: fadeInUp 0.6s ease-out;
}

/* Animações para Alerts */
.alert {
  animation: slideInDown 0.5s ease-out;
  border: none !important;
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

/* Animações para Dropdown */
.dropdown-menu {
  animation: fadeInUp 0.2s ease-out;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.dropdown-item {
  transition: all 0.2s ease;
  padding: 12px 20px;
}

.dropdown-item:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
  color: var(--accent-gold);
  transform: translateX(5px);
}

/* Animações para Modal */
.modal-content {
  animation: zoomIn 0.3s ease-out;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  overflow: hidden;
}

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* Animações para Pagination */
.page-link {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-item.active .page-link {
  animation: pulse 0.6s ease-out;
}

/* Animações para Navbar */
.main-header.navbar {
  transition: all 0.3s ease;
}

.main-header.navbar:hover {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Loading Spinner */
.spinner-border {
  animation: spin 0.8s linear infinite;
}

/* Custom Loading Animation */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.loading-bounce {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient-gold);
  animation: bounce 1.4s ease-in-out infinite both;
}

.loading-bounce:nth-child(1) { animation-delay: -0.32s; }
.loading-bounce:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Floating Animation */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* Glow Animation */
@keyframes glow {
  0% { box-shadow: 0 0 5px rgba(212, 175, 55, 0.3); }
  50% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.6); }
  100% { box-shadow: 0 0 5px rgba(212, 175, 55, 0.3); }
}

.glow {
  animation: glow 2s ease-in-out infinite alternate;
}

/* Slide Animation for Sidebar Toggle */
.sidebar-collapse .main-sidebar {
  animation: slideInLeft 0.3s ease-out;
}

.sidebar-open .main-sidebar {
  animation: slideInRight 0.3s ease-out;
}

/* Stagger Animation for Lists */
.stagger-item {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }

/* Text Animation */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--accent-gold); }
}

.typing {
  overflow: hidden;
  border-right: 2px solid;
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Focus Animation */
.btn:focus,
.form-control:focus {
  animation: pulse 0.6s ease-out;
}

/* Hover Effects for Interactive Elements */
.nav-link,
.dropdown-item,
.card,
.info-box,
.table tbody tr {
  cursor: pointer;
}

/* Responsive Animations */
@media (max-width: 768px) {
  .card {
    animation-duration: 0.4s;
  }

  .info-box {
    animation-duration: 0.4s;
  }

  .nav-sidebar .nav-item {
    animation-duration: 0.3s;
  }
}

/* Dark Mode Animation Adjustments */
.dark-mode .card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.dark-mode .btn-primary {
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.dark-mode .btn-primary:hover {
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.dark-mode .dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.dark-mode .modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}
