/* ==============================
   ENHANCED DASHBOARD ANIMATIONS
   ============================== */

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide Down Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide Up Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-slide-down {
  animation: slideDown 0.6s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.6s ease-out;
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

/* ==============================
   SKELETON LOADING
   ============================== */

.skeleton-card {
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 50%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 16px;
  width: 80%;
  margin: 8px auto;
}

.skeleton-title {
  height: 32px;
  width: 60%;
}

/* ==============================
   ENHANCED CARD STYLES
   ============================== */

.card-fade-in {
  animation: fadeInUp 0.6s ease-out both;
}

.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card-hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.card-hover:hover::before {
  left: 100%;
}

.card-hover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.card-hover .card-header {
  transition: all 0.3s ease;
}

.card-hover:hover .card-header {
  background: linear-gradient(135deg, var(--bs-primary), var(--bs-success)) !important;
}

/* Card body animations */
.card-body h2, .card-body h5 {
  transition: all 0.3s ease;
}

.card-hover:hover .card-body h2 {
  transform: scale(1.1);
}

/* ==============================
   HOVER LIFT EFFECT
   ============================== */

.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ==============================
   GRADIENT BACKGROUNDS
   ============================== */

.bg-gradient {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-success) 100%);
}

.bg-gradient-success {
  background: linear-gradient(135deg, #2F6B3F 0%, #1e7e34 100%);
}

/* ==============================
   BUTTON ENHANCEMENTS
   ============================== */

.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:active {
  transform: scale(0.95);
}

/* ==============================
   BADGE STYLES
   ============================== */

.badge {
  font-weight: 600;
  padding: 0.4em 0.8em;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.badge:hover {
  transform: scale(1.1);
}

/* ==============================
   FORM ENHANCEMENTS
   ============================== */

.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(230, 169, 60, 0.25);
  transform: translateY(-2px);
}

.form-control,
.form-select {
  transition: all 0.3s ease;
}

.input-group-text {
  transition: all 0.3s ease;
}

.input-group:focus-within .input-group-text {
  background-color: var(--bs-primary);
  color: white;
}

/* ==============================
   LOADING SPINNER
   ============================== */

.mdi-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ==============================
   CARD SECTION COLLAPSE
   ============================== */

#cards-section {
  transition: all 0.4s ease;
  max-height: 5000px;
  overflow: hidden;
}

#cards-section.collapsed {
  max-height: 80px;
  overflow: hidden;
}

/* ==============================
   STATISTICS PANEL
   ============================== */

#cards-stats .p-3 {
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

#cards-stats .p-3:hover {
  transform: scale(1.05);
  border-color: var(--bs-primary);
}

#cards-stats h4 {
  font-family: var(--bs-heading-font-family);
  transition: all 0.3s ease;
}

#cards-stats .p-3:hover h4 {
  transform: scale(1.1);
}

/* ==============================
   NO RESULTS STATE
   ============================== */

#no-results {
  animation: fadeIn 0.5s ease;
}

#no-results i {
  animation: pulse 2s ease-in-out infinite;
}

/* ==============================
   RESPONSIVE ADJUSTMENTS
   ============================== */

@media (max-width: 768px) {
  .card-hover:hover {
    transform: translateY(-4px) scale(1.01);
  }

  #cards-stats .col-md-3 {
    margin-bottom: 1rem;
  }

  .animate-slide-down,
  .animate-slide-up {
    animation-duration: 0.4s;
  }
}

/* ==============================
   SCROLL BEHAVIOR
   ============================== */

html {
  scroll-behavior: smooth;
}

/* ==============================
   CUSTOM SCROLLBAR
   ============================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bs-light);
}

::-webkit-scrollbar-thumb {
  background: var(--bs-primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bs-success);
}

/* ==============================
   TOOLTIP CUSTOMIZATION
   ============================== */

.tooltip-inner {
  background-color: var(--bs-dark);
  color: white;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: var(--bs-dark);
}

/* ==============================
   FOCUS VISIBLE
   ============================== */

*:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==============================
   PRINT STYLES
   ============================== */

@media print {
  .card-hover::before,
  .btn::before {
    display: none;
  }

  .card-hover {
    box-shadow: none !important;
    transform: none !important;
  }

  .animate-fade-in,
  .animate-slide-down,
  .animate-slide-up {
    animation: none !important;
  }
}