/**
 * Enhanced Component Styles
 * Premium UI components with advanced visual effects
 */

/* ========================================
   Enhanced Buttons
   ======================================== */

/* Primary Button with Glow */
.btn-primary-enhanced {
  position: relative;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #6366f1 100%);
  background-size: 200% 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 
    0 4px 20px rgba(99, 102, 241, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  animation: btnGradientShift 3s ease infinite;
}

@keyframes btnGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-primary-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent,
    rgba(255, 255, 255, 0.4),
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.btn-primary-enhanced:hover::before {
  left: 100%;
}

.btn-primary-enhanced:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 10px 40px rgba(99, 102, 241, 0.4),
    0 0 60px rgba(168, 85, 247, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.btn-primary-enhanced:active {
  transform: translateY(-1px) scale(0.98);
}

/* Secondary Button */
.btn-secondary-enhanced {
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px 28px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
}

.btn-secondary-enhanced::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-secondary-enhanced:hover::before {
  opacity: 1;
}

.btn-secondary-enhanced:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(99, 102, 241, 0.1);
}

/* Ghost Button */
.btn-ghost-enhanced {
  position: relative;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-ghost-enhanced:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
  color: #e2e8f0;
  transform: translateY(-1px);
}

body.app-theme-light .btn-secondary-enhanced {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.03));
  border-color: rgba(15, 23, 42, 0.12);
  color: #334155;
}
body.app-theme-light .btn-secondary-enhanced:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06), 0 0 20px rgba(99, 102, 241, 0.08);
}

body.app-theme-light .btn-ghost-enhanced {
  border-color: rgba(15, 23, 42, 0.12);
  color: #64748b;
}
body.app-theme-light .btn-ghost-enhanced:hover {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(99, 102, 241, 0.35);
  color: #0f172a;
}

/* ========================================
   Enhanced Inputs
   ======================================== */

/* Premium Input Field */
.input-premium {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  color: #e2e8f0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.input-premium::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.input-premium:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.7));
}

.input-premium:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 
    0 0 0 3px rgba(99, 102, 241, 0.1),
    0 10px 30px rgba(99, 102, 241, 0.1);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
}

body.app-theme-light .input-premium {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}
body.app-theme-light .input-premium::placeholder {
  color: #94a3b8;
}
body.app-theme-light .input-premium:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.25);
}
body.app-theme-light .input-premium:focus {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Input with Icon */
.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(148, 163, 184, 0.6);
  transition: color 0.3s ease;
  pointer-events: none;
}

.input-with-icon .input-premium {
  padding-left: 48px;
}

.input-with-icon:focus-within .input-icon {
  color: #6366f1;
}

/* ========================================
   Enhanced Cards
   ======================================== */

/* Glass Card Premium */
.card-glass-premium {
  position: relative;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.03) 100%
  );
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.card-glass-premium::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.2) 0%, 
    transparent 50%,
    rgba(99, 102, 241, 0.2) 100%
  );
  -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;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-glass-premium:hover::before {
  opacity: 1;
}

.card-glass-premium:hover {
  transform: translateY(-6px) perspective(1000px) rotateX(2deg);
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.2),
    0 0 40px rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

/* Solid Card */
.card-solid {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.card-solid:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(-4px);
}

body.app-theme-light .card-glass-premium {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.85));
  border-color: rgba(15, 23, 42, 0.08);
}

body.app-theme-light .card-solid {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border-color: rgba(15, 23, 42, 0.1);
}

body.app-theme-light .card-solid:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* ========================================
   Enhanced Tags/Badges
   ======================================== */

/* Gradient Badge */
.badge-gradient {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #818cf8;
  transition: all 0.3s ease;
}

.badge-gradient:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.25));
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

/* Status Badge */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

.badge-status-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-status-success::before {
  background: #34d399;
}

.badge-status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge-status-warning::before {
  background: #fbbf24;
}

.badge-status-error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.badge-status-error::before {
  background: #f87171;
}

@keyframes statusPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* ========================================
   Enhanced Progress Indicators
   ======================================== */

/* Progress Ring */
.progress-ring {
  position: relative;
  width: 60px;
  height: 60px;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 4;
}

.progress-ring-fill {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  transition: stroke-dashoffset 0.5s ease;
}

/* Animated Progress Bar */
.progress-animated {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-animated-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  background-size: 200% 100%;
  border-radius: inherit;
  animation: progressFill 2s ease infinite;
  transition: width 0.3s ease;
}

@keyframes progressFill {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ========================================
   Enhanced Toggle/Switch
   ======================================== */

/* Premium Toggle */
.toggle-premium {
  position: relative;
  width: 52px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-premium::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle-premium.active {
  background: linear-gradient(135deg, #6366f1, #a855f7);
}

.toggle-premium.active::after {
  left: 28px;
}

/* ========================================
   Enhanced Slider
   ======================================== */

/* Range Slider */
.slider-premium {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  outline: none;
}

.slider-premium::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
  transition: all 0.2s ease;
}

.slider-premium::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.5);
}

/* ========================================
   Enhanced Tooltip
   ======================================== */

/* Premium Tooltip */
.tooltip-premium {
  position: relative;
}

.tooltip-premium::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.tooltip-premium:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ========================================
   Enhanced Divider
   ======================================== */

/* Gradient Divider */
.divider-gradient {
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(99, 102, 241, 0.5), 
    rgba(168, 85, 247, 0.5), 
    transparent
  );
  margin: 24px 0;
}

/* ========================================
   Enhanced Loading States
   ======================================== */

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.05) 25%, 
    rgba(255, 255, 255, 0.1) 50%, 
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeletonLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================================
   Reduced Motion Support
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .btn-primary-enhanced,
  .progress-animated-fill,
  .skeleton,
  .badge-status::before {
    animation: none !important;
  }
  
  .btn-primary-enhanced:hover,
  .btn-secondary-enhanced:hover,
  .card-glass-premium:hover,
  .card-solid:hover {
    transform: none;
  }
}
