/* ===================================
   Custom Styles for InvenTrack
   (Effects not possible with Tailwind)
   =================================== */

/* Glass Morphism Card Effect */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.dark .glass-card {
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Loading Ring Animation */
.loader-ring {
  display: inline-block;
  width: 64px;
  height: 64px;
}

.loader-ring:after {
  content: " ";
  display: block;
  width: 48px;
  height: 48px;
  margin: 8px;
  border-radius: 50%;
  border: 5px solid transparent;
  border-top-color: #fff;
  border-bottom-color: #fff;
  animation: loader-ring-spin 1s linear infinite;
}

@keyframes loader-ring-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.5);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.7);
}

.dark ::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.5);
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.7);
}

/* Gradient Text Animation */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.gradient-text-animated {
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
}

/* Floating Animation for 3D elements */
@keyframes float-slow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-10px) rotate(1deg);
  }
  66% {
    transform: translateY(-20px) rotate(-1deg);
  }
}

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

/* Modal Transitions */
.modal-enter {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
}

.modal-enter-active {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-exit {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.modal-exit-active {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  transition: all 0.2s ease-in;
}

/* Status Badge Styles */
.status-badge {
  @apply px-3 py-1 rounded-full text-xs font-semibold;
}

.status-in-stock {
  @apply bg-emerald-100 text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-400;
}

.status-low-stock {
  @apply bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-400;
}

.status-out-of-stock {
  @apply bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400;
}

/* Table Row Hover Effect */
.table-row-hover {
  transition: background-color 0.2s ease;
}

.table-row-hover:hover {
  @apply bg-gray-50 dark:bg-dark-800/50;
}

/* Button Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  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-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* RTL Support */
[dir="rtl"] {
  direction: rtl;
}

[dir="rtl"] .pl-12 {
  padding-left: 1rem;
  padding-right: 3rem;
}

[dir="rtl"] .left-4 {
  left: auto;
  right: 1rem;
}

[dir="rtl"] .left-3 {
  left: auto;
  right: 0.75rem;
}

[dir="rtl"] .right-3 {
  right: auto;
  left: 0.75rem;
}

[dir="rtl"] .text-left {
  text-align: right;
}

[dir="rtl"] .text-right {
  text-align: left;
}

/* Smooth Theme Transition */
.theme-transition {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Toast Notification Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-enter {
  animation: slideInRight 0.3s ease forwards;
}

.toast-exit {
  animation: slideOutRight 0.3s ease forwards;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.dark .skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
}

/* Focus Ring Custom */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.3);
}

/* Neon Glow Effect for Dark Mode */
.dark .neon-glow {
  text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

/* Card Hover Lift */
.card-hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.dark .card-hover-lift:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Print Styles */
@media print {
  #three-bg,
  #theme-toggle,
  #lang-toggle,
  #add-btn,
  #filter-dropdown {
    display: none !important;
  }
  
  .glass-card {
    background: white;
    box-shadow: none;
  }
}

/* Custom Dropdown Active State */
.filter-option {
  position: relative;
}

.filter-option.active {
  @apply bg-primary-50 dark:bg-primary-900/20;
}

.filter-option.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: linear-gradient(to bottom, #0ea5e9, #d946ef);
  border-radius: 0 2px 2px 0;
}

[dir="rtl"] .filter-option.active::before {
  left: auto;
  right: 0;
  border-radius: 2px 0 0 2px;
}
