/* Blackwell Hub Premium Monochrome Design System */

:root {
  /* Font Families */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Monaco, Consolas, monospace;

  /* Spring Animations Custom Curve (Apple/Stripe Style Ease Out Expo) */
  --transition-speed-normal: 400ms;
  --transition-speed-fast: 200ms;
  --transition-curve-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --premium-transition: all var(--transition-speed-normal) var(--transition-curve-expo);
  --fast-transition: all var(--transition-speed-fast) var(--transition-curve-expo);

  /* Light Theme Palette */
  --color-canvas-bg: #f4f4f7;
  --color-surface: #ffffff;
  --color-surface-hover: #fafafc;
  --color-text-primary: #000000;
  --color-text-secondary: #515156;
  --color-text-tertiary: #86868b;
  --color-accent: #000000;
  --color-accent-inverse: #ffffff;
  --color-border-fine: rgba(0, 0, 0, 0.08);
  --color-border-medium: rgba(0, 0, 0, 0.16);
  --color-success-star: #eab308;
  --color-error-alert: #e11d48;
  --color-focus-glow: rgba(0, 0, 0, 0.04);
}

/* Dark Theme overrides */
html.dark {
  --color-canvas-bg: #07070a;
  --color-surface: #101014;
  --color-surface-hover: #16161c;
  --color-text-primary: #f5f5f7;
  --color-text-secondary: #9a9a9f;
  --color-text-tertiary: #6c6c72;
  --color-accent: #ffffff;
  --color-accent-inverse: #000000;
  --color-border-fine: rgba(255, 255, 255, 0.08);
  --color-border-medium: rgba(255, 255, 255, 0.20);
  --color-success-star: #f59e0b;
  --color-error-alert: #f43f5e;
  --color-focus-glow: rgba(255, 255, 255, 0.06);
}

/* Global resets & smoothness */
body {
  font-family: var(--font-sans);
  background-color: var(--color-canvas-bg);
  color: var(--color-text-primary);
  letter-spacing: -0.011em;
  transition: background-color var(--transition-speed-normal) var(--transition-curve-expo),
              color var(--transition-speed-normal) var(--transition-curve-expo);
  overflow-y: scroll;
}

/* Monospace text layout helpers */
.font-mono-numbers {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

/* Custom premium border structures */
.fine-border {
  border: 1px solid var(--color-border-fine);
}
.border-medium-focus {
  border: 1px solid var(--color-border-fine);
  transition: var(--fast-transition);
}
.border-medium-focus:focus, .border-medium-focus:focus-within {
  border-color: var(--color-text-primary);
  box-shadow: 0 0 0 3px var(--color-focus-glow);
}

/* Glassmorphic header panels */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border-fine);
  transition: var(--premium-transition);
}
html.dark .glass-header {
  background-color: rgba(16, 16, 20, 0.75);
}

/* Mascot idle floating anim */
@keyframes mascotFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}
.mascot-float {
  animation: mascotFloat 4s ease-in-out infinite;
}

/* Cheering mascot minor scale bounce */
@keyframes mascotWiggle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.03) rotate(-2deg); }
  75% { transform: scale(1.03) rotate(2deg); }
}
.mascot-wiggle:hover {
  animation: mascotWiggle 0.6s ease-in-out infinite;
}

/* Skeleton loader shimmer animation */
@keyframes skeletonShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-canvas-bg) 25%,
    var(--color-border-fine) 37%,
    var(--color-canvas-bg) 63%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite linear;
}

/* Pulsing Status indicators */
@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
}
.pulse-dot {
  position: relative;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: inherit;
  animation: statusPulse 1.8s infinite ease-in-out;
}

/* Transition classes */
.transition-premium {
  transition: var(--premium-transition);
}
.transition-fast {
  transition: var(--fast-transition);
}

/* Scales and Hovers */
.hover-scale {
  transition: var(--premium-transition);
}
.hover-scale:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}
html.dark .hover-scale:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.click-scale {
  transition: transform 150ms var(--transition-curve-expo);
}
.click-scale:active {
  transform: scale(0.97);
}

/* Dropzone files dragging states */
.dropzone-dragover {
  border-color: var(--color-text-primary) !important;
  background-color: var(--color-surface-hover) !important;
  transform: scale(0.995);
}

/* Entrance fade-in-up classes for newly added items */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fade-in-up {
  animation: fadeInUp 0.4s var(--transition-curve-expo) forwards;
}

/* Custom Checkbox toggle structures */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--color-border-fine);
  transition: .3s;
  border-radius: 20px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--color-surface);
  transition: .3s var(--transition-curve-expo);
  border-radius: 50%;
}
input:checked + .toggle-slider {
  background-color: var(--color-text-primary);
}
input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

/* Floating labels effect */
.floating-input-group {
  position: relative;
}
.floating-input-group input {
  width: 100%;
  padding: 14px 12px 6px 12px;
  background-color: transparent !important;
  border: 1px solid var(--color-border-fine);
  border-radius: 4px;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: var(--fast-transition);
}
.floating-input-group label {
  position: absolute;
  left: 12px;
  top: 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  pointer-events: none;
  transition: var(--fast-transition);
}
.floating-input-group input:focus + label,
.floating-input-group input:not(:placeholder-shown) + label {
  top: 3px;
  font-size: 9px;
  color: var(--color-text-secondary);
}

/* Toast container positioning */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: calc(100% - 48px);
}

/* Premium Toast */
.toast-premium {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-fine);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  transform: translateY(20px);
  opacity: 0;
  animation: toastSlideIn 0.35s var(--transition-curve-expo) forwards;
}

@keyframes toastSlideIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.toast-premium.error {
  border-left: 3px solid var(--color-error-alert);
}
.toast-premium.success {
  border-left: 3px solid var(--color-accent);
}
.toast-premium.hide {
  animation: toastSlideOut 0.3s var(--transition-curve-expo) forwards;
}

@keyframes toastSlideOut {
  to {
    transform: translateY(15px);
    opacity: 0;
  }
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--color-border-fine);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-medium);
}

.lightbox-open {
  overflow: hidden !important;
}
