@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    /* Modern Light Theme */
    --background: 220 20% 97%;
    --foreground: 224 71% 4%;
    --card: 0 0% 100%;
    --card-foreground: 224 71% 4%;
    --popover: 0 0% 100%;
    --popover-foreground: 224 71% 4%;
    --primary: 238 83% 62%;
    --primary-foreground: 0 0% 100%;
    --secondary: 220 14% 92%;
    --secondary-foreground: 224 71% 4%;
    --muted: 220 14% 92%;
    --muted-foreground: 220 8% 46%;
    --accent: 262 83% 58%;
    --accent-foreground: 0 0% 100%;
    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;
    --border: 220 13% 88%;
    --input: 220 13% 88%;
    --ring: 238 83% 62%;
    --radius: 0.625rem;

    /* Success/Warning colors */
    --success: 142 76% 36%;
    --success-foreground: 0 0% 100%;
    --warning: 38 92% 50%;
    --warning-foreground: 0 0% 100%;
  }

  .dark {
    /* Modern Dark Theme with layered surfaces */
    --background: 224 71% 4%;
    --foreground: 213 31% 91%;
    --card: 224 47% 8%;
    --card-foreground: 213 31% 91%;
    --popover: 224 47% 10%;
    --popover-foreground: 213 31% 91%;
    --primary: 238 83% 67%;
    --primary-foreground: 0 0% 100%;
    --secondary: 224 47% 12%;
    --secondary-foreground: 213 31% 91%;
    --muted: 224 47% 12%;
    --muted-foreground: 215 20% 55%;
    --accent: 262 83% 68%;
    --accent-foreground: 0 0% 100%;
    --destructive: 0 62% 50%;
    --destructive-foreground: 0 0% 100%;
    --border: 224 47% 14%;
    --input: 224 47% 14%;
    --ring: 238 83% 67%;

    /* Success/Warning colors */
    --success: 142 69% 45%;
    --success-foreground: 0 0% 100%;
    --warning: 38 92% 55%;
    --warning-foreground: 0 0% 100%;
  }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground antialiased;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    margin: 0;
    padding: 0;
    min-height: 100%;
  }

  /* Root container */
  #root {
    min-height: 100%;
  }

  html {
    height: 100%;
  }

  /* iOS-specific: Prevent content from scrolling under status bar */
  @supports (padding-top: env(safe-area-inset-top)) {
    /* Fixed elements should account for safe area */
    .fixed-safe-top {
      top: env(safe-area-inset-top);
    }

    /* Sticky elements with safe area */
    .sticky-safe-top {
      top: env(safe-area-inset-top);
    }
  }
}

/* Modern component styles */
@layer components {
  /* Form input styling with dark mode support */
  .input {
    @apply w-full px-3 py-2 bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground;
    @apply focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary;
    @apply disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-muted;
    @apply transition-colors duration-200;
  }

  /* Select dropdown styling */
  select.input {
    @apply appearance-none bg-no-repeat cursor-pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
  }

  .dark select.input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  }

  /* Button base styles */
  .btn {
    @apply inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-lg;
    @apply transition-all duration-200 ease-out;
    @apply focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-background;
    @apply disabled:opacity-50 disabled:cursor-not-allowed;
  }

  .btn-primary {
    @apply btn bg-primary text-primary-foreground hover:bg-primary/90;
    @apply focus:ring-primary;
  }

  .btn-secondary {
    @apply btn bg-secondary text-secondary-foreground hover:bg-secondary/80;
    @apply focus:ring-secondary;
  }

  .btn-danger {
    @apply btn bg-destructive text-destructive-foreground hover:bg-destructive/90;
    @apply focus:ring-destructive;
  }

  .btn-ghost {
    @apply btn bg-transparent hover:bg-secondary text-foreground;
    @apply focus:ring-primary;
  }

  .btn-sm {
    @apply px-3 py-1.5 text-xs;
  }

  .btn-lg {
    @apply px-6 py-3 text-base;
  }

  /* Card elevation and hover effects */
  .card {
    @apply transition-all duration-200 ease-out;
  }

  /* Interactive card with hover effects */
  .card-interactive {
    @apply transition-all duration-300 ease-out;
  }

  .card-interactive:hover {
    @apply shadow-soft-md;
    transform: translateY(-2px);
  }

  /* Card with zoom effect */
  .card-zoom {
    @apply transition-all duration-300 ease-out;
  }

  .card-zoom:hover {
    transform: scale(1.02);
    @apply shadow-soft-md;
  }

  /* Glass card effect */
  .card-glass {
    @apply bg-card/70 backdrop-blur-lg border border-white/10;
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .dark .card-glass {
    @apply bg-card/50 backdrop-blur-lg border border-white/5;
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  /* Glass card with hover */
  .card-glass-hover {
    @apply bg-card/70 backdrop-blur-lg border border-white/10 transition-all duration-300 ease-out;
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .card-glass-hover:hover {
    @apply bg-card/80 border-white/20;
    transform: translateY(-2px) scale(1.01);
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }

  .dark .card-glass-hover {
    @apply bg-card/50 backdrop-blur-lg border border-white/5;
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .dark .card-glass-hover:hover {
    @apply bg-card/60 border-white/10;
    transform: translateY(-2px) scale(1.01);
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  /* Glass card WITHOUT lift/scale on hover - for thumbnails/grids */
  .card-glass-flat {
    @apply bg-card/70 backdrop-blur-lg border border-white/10 transition-all duration-200 ease-out;
    box-shadow:
      0 2px 12px rgba(0, 0, 0, 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .card-glass-flat:hover {
    @apply bg-card/80 border-white/20;
    box-shadow:
      0 4px 16px rgba(0, 0, 0, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }

  .dark .card-glass-flat {
    @apply bg-card/50 backdrop-blur-lg border border-white/5;
    box-shadow:
      0 2px 12px rgba(0, 0, 0, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .dark .card-glass-flat:hover {
    @apply bg-card/60 border-white/10;
    box-shadow:
      0 4px 16px rgba(0, 0, 0, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  /* Modern button styles */
  .btn-modern {
    @apply transition-all duration-200 ease-out active:scale-[0.98];
  }

  /* Button hover animations */
  .btn-hover-lift {
    @apply transition-all duration-200 ease-out;
  }

  .btn-hover-lift:hover {
    transform: translateY(-2px);
    @apply shadow-lg;
  }

  .btn-hover-lift:active {
    transform: translateY(0);
    @apply shadow-md;
  }

  /* Primary button with glow */
  .btn-primary-glow {
    @apply bg-primary text-primary-foreground transition-all duration-200;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  }

  .btn-primary-glow:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
  }

  /* Pill badge styles */
  .badge-pill {
    @apply px-3 py-1 text-xs font-medium rounded-full inline-flex items-center gap-1;
  }

  .badge-pill-success {
    @apply bg-emerald-100 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-400;
  }

  .badge-pill-warning {
    @apply bg-amber-100 text-amber-700 dark:bg-amber-500/20 dark:text-amber-400;
  }

  .badge-pill-error {
    @apply bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-400;
  }

  .badge-pill-info {
    @apply bg-blue-100 text-blue-700 dark:bg-blue-500/20 dark:text-blue-400;
  }

  .badge-pill-neutral {
    @apply bg-slate-100 text-slate-700 dark:bg-slate-500/20 dark:text-slate-400;
  }

  /* Subtle gradient backgrounds */
  .gradient-subtle {
    @apply bg-gradient-to-br from-background to-muted/50;
  }
}

/* Modern utility classes */
@layer utilities {
  /* Modern shadows */
  .shadow-soft {
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.04),
      0 4px 12px rgba(0, 0, 0, 0.05);
  }

  .shadow-soft-md {
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.04),
      0 8px 24px rgba(0, 0, 0, 0.08);
  }

  .shadow-soft-lg {
    box-shadow:
      0 4px 6px rgba(0, 0, 0, 0.04),
      0 16px 40px rgba(0, 0, 0, 0.1);
  }

  /* Dark mode shadow adjustments */
  .dark .shadow-soft {
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.2),
      0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .dark .shadow-soft-md {
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.2),
      0 8px 24px rgba(0, 0, 0, 0.25);
  }

  .dark .shadow-soft-lg {
    box-shadow:
      0 4px 6px rgba(0, 0, 0, 0.2),
      0 16px 40px rgba(0, 0, 0, 0.3);
  }

  /* Glow effect for focus states */
  .ring-glow {
    @apply ring-2 ring-primary/30;
  }

  /* Text gradient utility */
  .text-gradient {
    @apply bg-clip-text text-transparent bg-gradient-to-r from-primary to-accent;
  }

  /* Glass effect for modals/overlays */
  .glass {
    @apply bg-background/80 backdrop-blur-xl;
  }

  .dark .glass {
    @apply bg-background/70 backdrop-blur-xl;
  }

  /* Subtle border glow */
  .border-glow {
    @apply border border-border/50;
    box-shadow: 0 0 0 1px hsl(var(--border) / 0.5);
  }

  /* Animated underline for links */
  .link-underline {
    @apply relative;
  }

  .link-underline::after {
    @apply absolute bottom-0 left-0 w-0 h-[2px] bg-primary transition-all duration-200;
    content: '';
  }

  .link-underline:hover::after {
    @apply w-full;
  }
}

/* Notification animations */
@keyframes slideInFromRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Pulse animation for status indicators */
@keyframes pulse-soft {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.animate-pulse-soft {
  animation: pulse-soft 2s ease-in-out infinite;
}

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

.skeleton {
  @apply bg-muted rounded;
  background: linear-gradient(
    90deg,
    hsl(var(--muted)) 0%,
    hsl(var(--muted) / 0.5) 50%,
    hsl(var(--muted)) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Animated progress bar with shimmer */
@keyframes progress-shimmer {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.progress-animated {
  position: relative;
  overflow: hidden;
}

.progress-animated::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: progress-shimmer 2s ease-in-out infinite;
}

/* Gradient stat cards */
.stat-card-blue {
  @apply bg-gradient-to-br from-blue-500/10 via-blue-500/5 to-indigo-500/10 border-blue-500/20;
}

.stat-card-green {
  @apply bg-gradient-to-br from-emerald-500/10 via-emerald-500/5 to-teal-500/10 border-emerald-500/20;
}

.stat-card-purple {
  @apply bg-gradient-to-br from-violet-500/10 via-violet-500/5 to-purple-500/10 border-violet-500/20;
}

.stat-card-orange {
  @apply bg-gradient-to-br from-amber-500/10 via-amber-500/5 to-orange-500/10 border-amber-500/20;
}

.stat-card-red {
  @apply bg-gradient-to-br from-red-500/10 via-red-500/5 to-rose-500/10 border-red-500/20;
}

.stat-card-cyan {
  @apply bg-gradient-to-br from-cyan-500/10 via-cyan-500/5 to-sky-500/10 border-cyan-500/20;
}

.stat-card-pink {
  @apply bg-gradient-to-br from-pink-500/10 via-pink-500/5 to-rose-500/10 border-pink-500/20;
}

/* Colored shadows for cards */
.shadow-blue-glow {
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

.shadow-green-glow {
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.shadow-purple-glow {
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.shadow-orange-glow {
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.shadow-red-glow {
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

/* Dark mode colored shadows */
.dark .shadow-blue-glow {
  box-shadow: 0 4px 25px rgba(59, 130, 246, 0.25);
}

.dark .shadow-green-glow {
  box-shadow: 0 4px 25px rgba(16, 185, 129, 0.25);
}

.dark .shadow-purple-glow {
  box-shadow: 0 4px 25px rgba(139, 92, 246, 0.25);
}

.dark .shadow-orange-glow {
  box-shadow: 0 4px 25px rgba(245, 158, 11, 0.25);
}

.dark .shadow-red-glow {
  box-shadow: 0 4px 25px rgba(239, 68, 68, 0.25);
}

/* ============================================
   MODERN STYLING ENHANCEMENTS
   ============================================ */

/* 1. Gradient Text for Headings */
.text-gradient-blue {
  @apply bg-gradient-to-r from-blue-600 via-indigo-500 to-purple-600 bg-clip-text text-transparent;
}

.text-gradient-green {
  @apply bg-gradient-to-r from-emerald-500 via-teal-500 to-cyan-500 bg-clip-text text-transparent;
}

.text-gradient-purple {
  @apply bg-gradient-to-r from-purple-500 via-pink-500 to-rose-500 bg-clip-text text-transparent;
}

.text-gradient-orange {
  @apply bg-gradient-to-r from-amber-500 via-orange-500 to-red-500 bg-clip-text text-transparent;
}

.text-gradient-rainbow {
  @apply bg-gradient-to-r from-red-500 via-yellow-500 to-green-500 bg-clip-text text-transparent;
}

/* 2. Pulsing Live Indicators */
@keyframes pulse-live {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.1);
  }
}

.live-indicator {
  @apply relative inline-flex;
}

.live-indicator::before {
  content: '';
  @apply absolute inline-flex h-full w-full rounded-full bg-current opacity-75;
  animation: pulse-live 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.live-dot {
  @apply w-2 h-2 rounded-full bg-green-500;
  animation: pulse-live 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.live-dot-red {
  @apply w-2 h-2 rounded-full bg-red-500;
  animation: pulse-live 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.live-dot-blue {
  @apply w-2 h-2 rounded-full bg-blue-500;
  animation: pulse-live 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 3. Modern Focus Rings */
.focus-ring {
  @apply focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2 focus:ring-offset-background transition-shadow;
}

.focus-ring-blue {
  @apply focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:ring-offset-2 focus:ring-offset-background transition-shadow;
}

.focus-ring-green {
  @apply focus:outline-none focus:ring-2 focus:ring-emerald-500/50 focus:ring-offset-2 focus:ring-offset-background transition-shadow;
}

/* 4. Input Focus Glow */
.input-glow {
  @apply transition-all duration-200;
}

.input-glow:focus {
  @apply border-primary;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-glow-blue:focus {
  @apply border-blue-500;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-glow-green:focus {
  @apply border-emerald-500;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* 5. Table Row Hover Highlights */
.table-row-hover {
  @apply transition-colors duration-150;
}

.table-row-hover:hover {
  @apply bg-primary/5;
}

.table-row-hover-blue:hover {
  @apply bg-blue-500/10;
}

.table-row-hover-stripe:nth-child(even) {
  @apply bg-secondary/30;
}

.table-row-hover-stripe:hover {
  @apply bg-primary/10;
}

/* 6. Card Entrance Animations */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-scale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.3s ease-out forwards;
}

.animate-fade-in-scale {
  animation: fade-in-scale 0.2s ease-out forwards;
}

/* Staggered entrance for grid items */
.stagger-animation > * {
  opacity: 0;
  animation: fade-in-up 0.3s ease-out forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.4s; }

/* 7. Status Dot Animations */
@keyframes status-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    box-shadow: 0 0 0 4px transparent;
  }
}

.status-dot {
  @apply w-2.5 h-2.5 rounded-full;
}

.status-dot-active {
  @apply bg-green-500;
  animation: status-pulse 2s ease-in-out infinite;
  color: rgba(34, 197, 94, 0.4);
}

.status-dot-warning {
  @apply bg-amber-500;
  animation: status-pulse 2s ease-in-out infinite;
  color: rgba(245, 158, 11, 0.4);
}

.status-dot-error {
  @apply bg-red-500;
  animation: status-pulse 2s ease-in-out infinite;
  color: rgba(239, 68, 68, 0.4);
}

.status-dot-idle {
  @apply bg-slate-400;
}

/* 8. Floating Action Button */
.fab {
  @apply fixed bottom-6 right-6 w-14 h-14 rounded-full bg-primary text-primary-foreground
         flex items-center justify-center shadow-lg transition-all duration-200 z-50;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.fab:active {
  transform: translateY(0) scale(0.98);
}

/* 9. Number Counter Animation */
@keyframes count-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.number-animate {
  animation: count-up 0.5s ease-out forwards;
  display: inline-block;
}

/* 10. Enhanced Scrollbar (already exists, adding more options) */
.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scrollbar-hidden::-webkit-scrollbar {
  display: none;
}

.scrollbar-hidden {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 11. Tooltip Styling */
.tooltip {
  @apply absolute z-50 px-2 py-1 text-xs font-medium text-white bg-slate-900 rounded-md shadow-lg;
  @apply opacity-0 invisible transition-all duration-150;
  @apply dark:bg-slate-700;
}

.tooltip::after {
  content: '';
  @apply absolute w-2 h-2 bg-slate-900 dark:bg-slate-700 rotate-45;
}

.tooltip-bottom::after {
  @apply -top-1 left-1/2 -translate-x-1/2;
}

.tooltip-top::after {
  @apply -bottom-1 left-1/2 -translate-x-1/2;
}

.has-tooltip:hover .tooltip {
  @apply opacity-100 visible;
}

/* 12. Ripple Effect */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple {
  @apply absolute rounded-full bg-white/30 pointer-events-none;
  transform: scale(0);
  animation: ripple 0.6s linear;
}

/* 13. Glow Border Animation */
@keyframes glow-border {
  0%, 100% {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.2);
  }
  50% {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  }
}

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

/* 14. Slide In Animations */
@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in-right {
  animation: slide-in-right 0.3s ease-out forwards;
}

.animate-slide-in-left {
  animation: slide-in-left 0.3s ease-out forwards;
}

/* 15. Hover Card Lift with Reflection */
.card-lift {
  @apply transition-all duration-300;
}

.card-lift:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.08);
}

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

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  @apply bg-transparent;
}

::-webkit-scrollbar-thumb {
  @apply bg-border rounded-full;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-muted-foreground/30;
}

.dark ::-webkit-scrollbar-thumb {
  @apply bg-muted;
}

.dark ::-webkit-scrollbar-thumb:hover {
  @apply bg-muted-foreground/40;
}

/* Focus visible styles */
:focus-visible {
  @apply outline-none ring-2 ring-primary ring-offset-2 ring-offset-background;
}

/* Selection styling */
::selection {
  @apply bg-primary/20 text-foreground;
}

/* Smooth transitions for interactive elements */
button, a, input, select, textarea {
  @apply transition-colors duration-150;
}

/* Modern input styling enhancement */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  @apply transition-all duration-200;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  @apply ring-2 ring-primary/20 border-primary;
}

/* ========================================
   ADDITIONAL MODERN EFFECTS
   ======================================== */

/* 1. Custom Scrollbars - Enhanced */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--muted-foreground) / 0.3) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  @apply bg-transparent rounded-full;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  @apply bg-muted-foreground/30 rounded-full border-2 border-transparent;
  background-clip: padding-box;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  @apply bg-muted-foreground/50;
}

/* 2. Animated Number Counter */
@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-count-up {
  animation: count-up 0.5s ease-out forwards;
}

.counter-value {
  display: inline-block;
  transition: transform 0.3s ease-out;
}

/* 3. Image Skeleton Shimmer */
.image-skeleton {
  @apply bg-gradient-to-r from-secondary via-secondary/50 to-secondary bg-[length:200%_100%];
  animation: shimmer 1.5s infinite;
}

/* 4. Backdrop Blur Modal */
.modal-backdrop {
  @apply fixed inset-0 bg-black/60 backdrop-blur-sm;
  animation: fade-in 0.2s ease-out;
}

.modal-content {
  @apply bg-card/95 backdrop-blur-xl border border-white/10 shadow-2xl;
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* 5. Gradient Text for Page Titles */
.title-gradient-blue {
  @apply bg-gradient-to-r from-blue-600 via-indigo-600 to-violet-600 bg-clip-text text-transparent;
}

.title-gradient-sunset {
  @apply bg-gradient-to-r from-orange-500 via-pink-500 to-purple-600 bg-clip-text text-transparent;
}

.title-gradient-ocean {
  @apply bg-gradient-to-r from-cyan-500 via-blue-500 to-indigo-600 bg-clip-text text-transparent;
}

.title-gradient-forest {
  @apply bg-gradient-to-r from-green-500 via-emerald-500 to-teal-600 bg-clip-text text-transparent;
}

/* 6. Pulsing Notification Badge */
.badge-pulse {
  @apply relative;
}

.badge-pulse::after {
  content: '';
  @apply absolute inset-0 rounded-full bg-inherit opacity-75;
  animation: badge-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes badge-ping {
  75%, 100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.notification-badge {
  @apply inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-bold text-white bg-red-500 rounded-full;
}

.notification-badge-animated {
  @apply notification-badge;
  animation: badge-bounce 0.5s ease-in-out;
}

@keyframes badge-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

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

/* 8. Hover Zoom on Thumbnails */
.thumbnail-zoom {
  @apply overflow-hidden;
}

.thumbnail-zoom img {
  @apply transition-transform duration-300 ease-out;
}

.thumbnail-zoom:hover img {
  transform: scale(1.08);
}

/* 9. Staggered Grid Animation */
.stagger-grid > * {
  opacity: 0;
  animation: stagger-fade-in 0.4s ease-out forwards;
}

.stagger-grid > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-grid > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-grid > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-grid > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-grid > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-grid > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-grid > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-grid > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-grid > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-grid > *:nth-child(10) { animation-delay: 0.5s; }
.stagger-grid > *:nth-child(11) { animation-delay: 0.55s; }
.stagger-grid > *:nth-child(12) { animation-delay: 0.6s; }

@keyframes stagger-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 10. Modern Tooltip */
.tooltip-modern {
  @apply relative inline-block;
}

.tooltip-modern::before {
  content: attr(data-tooltip);
  @apply absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-3 py-1.5 text-xs font-medium text-white bg-slate-900 dark:bg-slate-700 rounded-lg whitespace-nowrap opacity-0 invisible;
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  transform: translateX(-50%) translateY(5px);
}

.tooltip-modern::after {
  content: '';
  @apply absolute bottom-full left-1/2 -translate-x-1/2 mb-1 border-4 border-transparent border-t-slate-900 dark:border-t-slate-700 opacity-0 invisible;
  transition: opacity 0.2s, visibility 0.2s;
}

.tooltip-modern:hover::before,
.tooltip-modern:hover::after {
  @apply opacity-100 visible;
}

.tooltip-modern:hover::before {
  transform: translateX(-50%) translateY(0);
}

/* 11. Ripple Click Effect */
.ripple-effect {
  @apply relative overflow-hidden;
}

.ripple-effect::after {
  content: '';
  @apply absolute inset-0 bg-white/30 rounded-full scale-0 opacity-0;
  transition: transform 0.5s, opacity 0.3s;
}

.ripple-effect:active::after {
  @apply scale-[2] opacity-100;
  transition: transform 0s, opacity 0s;
}

/* 12. Animated Gradient Background */
.gradient-animated {
  background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-animated-slow {
  background: linear-gradient(-45deg,
    hsl(var(--primary) / 0.1),
    hsl(var(--accent) / 0.1),
    hsl(var(--primary) / 0.05),
    hsl(var(--accent) / 0.05)
  );
  background-size: 400% 400%;
  animation: gradient-shift 20s ease infinite;
}

/* 13. Floating Input Labels */
.floating-label {
  @apply relative;
}

.floating-label input,
.floating-label textarea {
  @apply pt-5 pb-2;
}

.floating-label label {
  @apply absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none transition-all duration-200;
}

.floating-label input:focus ~ label,
.floating-label input:not(:placeholder-shown) ~ label,
.floating-label textarea:focus ~ label,
.floating-label textarea:not(:placeholder-shown) ~ label {
  @apply top-2 text-xs text-primary font-medium;
  transform: translateY(0);
}

/* 14. Typewriter Effect */
.typewriter {
  overflow: hidden;
  border-right: 2px solid hsl(var(--primary));
  white-space: nowrap;
  animation:
    typing 3s steps(30, end),
    blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

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

/* 15. Morphing Blob Background */
.blob-bg {
  @apply absolute -z-10;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: blob-morph 8s ease-in-out infinite;
}

@keyframes blob-morph {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50% { border-radius: 50% 60% 30% 70% / 40% 40% 60% 50%; }
  75% { border-radius: 40% 50% 60% 30% / 60% 50% 40% 70%; }
}

.blob-gradient-1 {
  @apply bg-gradient-to-br from-primary/30 to-accent/30 blur-3xl;
}

.blob-gradient-2 {
  @apply bg-gradient-to-br from-accent/20 to-primary/20 blur-3xl;
  animation-delay: -4s;
}

/* Neon Glow Effect */
.neon-glow {
  text-shadow:
    0 0 5px hsl(var(--primary)),
    0 0 10px hsl(var(--primary)),
    0 0 20px hsl(var(--primary)),
    0 0 40px hsl(var(--primary) / 0.5);
}

.neon-box {
  box-shadow:
    0 0 5px hsl(var(--primary)),
    0 0 10px hsl(var(--primary)),
    0 0 20px hsl(var(--primary) / 0.5),
    inset 0 0 10px hsl(var(--primary) / 0.1);
}

/* Glass Card with Gradient Border */
.glass-gradient-border {
  @apply relative bg-card/80 backdrop-blur-xl rounded-xl overflow-hidden;
}

.glass-gradient-border::before {
  content: '';
  @apply absolute inset-0 rounded-xl p-[1px];
  background: linear-gradient(135deg,
    hsl(var(--primary) / 0.5),
    transparent 40%,
    transparent 60%,
    hsl(var(--accent) / 0.5)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Plyr Video Player Custom Styles */
.plyr-container {
  --plyr-color-main: hsl(var(--primary));
  --plyr-video-background: #000;
  --plyr-menu-background: hsl(var(--card));
  --plyr-menu-color: hsl(var(--foreground));
  --plyr-menu-border-color: hsl(var(--border));
  --plyr-control-spacing: 10px;
  --plyr-control-icon-size: 18px;
  --plyr-tooltip-background: hsl(var(--popover));
  --plyr-tooltip-color: hsl(var(--popover-foreground));
  --plyr-tooltip-radius: 4px;
}

.plyr-container .plyr {
  width: 100%;
  height: 100%;
}

.plyr-container .plyr__video-wrapper {
  background: #000;
}

.plyr-container .plyr--video {
  border-radius: 0.75rem;
  overflow: hidden;
}

.plyr-container .plyr__controls {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  padding: 10px 10px 8px;
}

.plyr-container .plyr--full-ui .plyr__controls {
  border-radius: 0 0 0.75rem 0.75rem;
}

.plyr-container .plyr__control {
  color: #fff;
}

.plyr-container .plyr__control:hover {
  background: hsl(var(--primary) / 0.3);
}

.plyr-container .plyr__progress__buffer {
  background: rgba(255, 255, 255, 0.25);
}

.plyr-container .plyr__menu__container {
  background: hsl(var(--card));
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Lightbox fullscreen style */
.plyr-container.plyr-fullscreen .plyr--video {
  border-radius: 0;
}

.plyr-container.plyr-fullscreen .plyr--full-ui .plyr__controls {
  border-radius: 0;
}

/* Plyr fullscreen container - fill available space */
.plyr-container.plyr-fullscreen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plyr-container.plyr-fullscreen .plyr {
  width: 100%;
  height: 100%;
  max-height: 100%;
}

.plyr-container.plyr-fullscreen .plyr__video-wrapper {
  height: 100%;
}

.plyr-container.plyr-fullscreen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

