/*
 * FlowKit Enhanced Styles
 * Atomic Design System with Modern UI/UX Improvements
 * Based on Reddit research and 2025 design trends
 */

/* ============================================
   DESIGN TOKENS - Atomic Design Foundation
   ============================================ */

:root {
  /* Typography Scale (Perfect Fourth - 1.333 ratio) */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.333rem;     /* 21px */
  --text-2xl: 1.777rem;    /* 28px */
  --text-3xl: 2.369rem;    /* 38px */
  --text-4xl: 3.157rem;    /* 50px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Spacing Scale (8px base - consistent rhythm) */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* Shadow Scale (layered depth) */
  --shadow-xs: 0 1px 2px rgba(249, 115, 22, 0.04);
  --shadow-sm: 0 2px 4px rgba(249, 115, 22, 0.06);
  --shadow-md: 0 4px 8px rgba(249, 115, 22, 0.08);
  --shadow-lg: 0 8px 16px rgba(249, 115, 22, 0.10);
  --shadow-xl: 0 12px 24px rgba(249, 115, 22, 0.12);
  --shadow-2xl: 0 20px 40px rgba(249, 115, 22, 0.15);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);

  /* Focus Ring */
  --focus-ring: 0 0 0 3px rgba(249, 115, 22, 0.2);
  --focus-ring-offset: 0 0 0 2px var(--bg-primary), 0 0 0 5px rgba(249, 115, 22, 0.2);

  /* Animation Durations */
  --duration-instant: 100ms;
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 350ms;
  --duration-slower: 500ms;

  /* Animation Easings */
  --ease-linear: linear;
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 50;
  --z-fixed: 100;
  --z-modal-backdrop: 500;
  --z-modal: 1000;
  --z-popover: 1500;
  --z-tooltip: 2000;
  --z-toast: 3000;

  /* Border Widths */
  --border-width-thin: 1px;
  --border-width-base: 2px;
  --border-width-thick: 4px;

  /* HTTP Method Colors */
  --http-get: #10B981;
  --http-post: #3B82F6;
  --http-put: #F59E0B;
  --http-patch: #8B5CF6;
  --http-delete: #EF4444;
  --http-head: #6B7280;
  --http-options: #14B8A6;
}

[data-theme="dark"] {
  /* Adjust shadows for dark mode */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.7);
  --shadow-2xl: 0 20px 40px rgba(0, 0, 0, 0.8);
}

/* ============================================
   GLASS-MORPHISM EFFECTS
   ============================================ */

/* Top Banner */
.top-banner {
  background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
  color: white;
  padding: 0.5rem 2rem;
  text-align: center;
  font-size: 0.8125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.top-banner a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--duration-base);
}

.top-banner a:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.top-banner .separator {
  margin: 0 0.75rem;
  opacity: 0.6;
}

.glass-header {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(249, 115, 22, 0.1);
  box-shadow: 0 8px 32px rgba(249, 115, 22, 0.04);
}

[data-theme="dark"] .glass-header {
  background: rgba(15, 23, 42, 0.85) !important;
  border-bottom: 1px solid rgba(249, 115, 22, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-modal-backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.glass-modal-content {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(249, 115, 22, 0.1);
}

[data-theme="dark"] .glass-modal-content {
  background: rgba(15, 23, 42, 0.98) !important;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.glass-search-section {
  background: rgba(255, 251, 245, 0.9) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
}

[data-theme="dark"] .glass-search-section {
  background: rgba(30, 41, 59, 0.9) !important;
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus Visible (modern focus states) */
*:focus-visible {
  outline: 3px solid var(--flow-orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove outline for mouse users */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--flow-orange);
  color: white;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: var(--font-semibold);
  text-decoration: none;
  z-index: var(--z-tooltip);
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-to-content:focus {
  top: var(--space-4);
}

/* Keyboard navigation helpers */
.keyboard-nav *:focus {
  outline: 2px solid var(--flow-orange);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: #000;
  }

  [data-theme="dark"] {
    --border: #fff;
  }
}

/* ============================================
   MICRO-INTERACTIONS & ANIMATIONS
   ============================================ */

/* 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 var(--duration-slow) var(--ease-out),
              height var(--duration-slow) var(--ease-out);
}

.btn-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Bounce Animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.05);
  }
}

.animate-bounce-subtle {
  animation: bounce var(--duration-slow) var(--ease-bounce);
}

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

.fade-in {
  animation: fadeIn var(--duration-base) var(--ease-out);
}

/* Slide In From Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight var(--duration-base) var(--ease-out);
}

/* Pulse */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.animate-pulse {
  animation: pulse 2s var(--ease-in-out) infinite;
}

/* Scale on Hover */
.hover-scale {
  transition: transform var(--duration-base) var(--ease-out);
}

.hover-scale:hover {
  transform: scale(1.02);
}

/* Lift on Hover */
.hover-lift {
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Icon Bounce on Card Hover */
.node-card:hover .node-icon {
  animation: iconBounce 0.5s var(--ease-bounce);
}

@keyframes iconBounce {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-8deg) scale(1.1);
  }
  75% {
    transform: rotate(8deg) scale(1.1);
  }
}

/* Shimmer Loading Effect */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

/* ============================================
   SIMPLE GRID SYSTEM
   ============================================ */

/* Simple Grid Layout - Consistent Card Sizing */
.nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

/* Card styling */
.nodes-grid .node-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
  min-height: 280px;
}

.nodes-grid .node-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2xl);
}

/* Better content handling for cards */
.nodes-grid .node-card > * {
  flex-shrink: 0;
}

.nodes-grid .node-card p {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-height: 1.5;
  max-height: 4.5em;
}

/* Responsive Grid */
@media (max-width: 1024px) {
  .nodes-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .nodes-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
}

/* ============================================
   VISUAL NODE PREVIEW COMPONENTS
   ============================================ */

/* HTTP Method Badges */
.http-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}

.http-badge-get {
  background: var(--http-get);
  color: white;
}

.http-badge-post {
  background: var(--http-post);
  color: white;
}

.http-badge-put {
  background: var(--http-put);
  color: white;
}

.http-badge-patch {
  background: var(--http-patch);
  color: white;
}

.http-badge-delete {
  background: var(--http-delete);
  color: white;
}

.http-badge-head {
  background: var(--http-head);
  color: white;
}

.http-badge-options {
  background: var(--http-options);
  color: white;
}

/* Node Quick Info */
.node-quick-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
  margin-bottom: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.endpoint-preview {
  font-size: var(--text-sm);
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
  background: var(--code-bg);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

.auth-indicator {
  font-size: var(--text-sm);
  opacity: 0.7;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.auth-indicator:hover {
  opacity: 1;
}

.node-stats {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

.node-stats > span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: 12px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: 1;
}

.badge-trending {
  background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
  color: white;
  animation: pulse 2s var(--ease-in-out) infinite;
}

.badge-new {
  background: var(--success-green);
  color: white;
}

.badge-featured {
  background: var(--info-blue);
  color: white;
}

/* Tags (for blog and guide pages) */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: 16px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  line-height: 1.2;
  background: rgba(249, 115, 22, 0.1);
  color: var(--flow-orange);
  border: 1px solid rgba(249, 115, 22, 0.2);
  transition: all var(--duration-fast) var(--ease-out);
}

.tag:hover {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.3);
  transform: translateY(-1px);
}

[data-theme="dark"] .tag {
  background: rgba(249, 115, 22, 0.15);
  color: #FB923C;
  border-color: rgba(249, 115, 22, 0.25);
}

[data-theme="dark"] .tag:hover {
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.35);
}

/* ============================================
   ENHANCED NODE CARDS
   ============================================ */

.node-card-enhanced {
  background: var(--surface-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--duration-base) var(--ease-out);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: visible;
}

.node-card-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  transition: border-color var(--duration-base) var(--ease-out);
  pointer-events: none;
}

.node-card-enhanced:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

.node-card-enhanced:hover::before {
  border-color: var(--flow-orange);
}

.node-card-enhanced:focus-visible {
  outline: none;
}

.node-card-enhanced:focus-visible::before {
  border-color: var(--flow-orange);
  box-shadow: var(--focus-ring);
}

/* Featured Node Card */
.node-card-featured {
  background: linear-gradient(135deg,
    rgba(249, 115, 22, 0.05) 0%,
    rgba(251, 146, 60, 0.02) 100%);
  border: 2px solid var(--flow-orange);
}

.node-card-featured::after {
  content: '⭐ Featured';
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
  color: white;
  padding: var(--space-1) var(--space-3);
  border-radius: 12px;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
}

/* ============================================
   ENHANCED BUTTONS
   ============================================ */

.btn-enhanced {
  position: relative;
  padding: var(--space-3) var(--space-6);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  transition: all var(--duration-base) var(--ease-out);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

.btn-enhanced::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width var(--duration-slow) var(--ease-out),
              height var(--duration-slow) var(--ease-out);
}

.btn-enhanced:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary-enhanced {
  background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary-enhanced:hover {
  filter: brightness(110%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-primary-enhanced:active {
  transform: scale(0.98);
}

/* Node Actions Layout */
.node-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin-top: auto;
}

/* Test button takes full width on first row */
.node-actions .btn-test {
  grid-column: 1 / -1;
}

/* Improved Button Readability */
.node-actions .btn {
  font-size: 0.875rem;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  min-height: 42px;
  white-space: nowrap;
}

/* Test Button */
.btn-test {
  background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
  flex: 1;
}

.btn-test:hover {
  filter: brightness(110%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-test:active {
  transform: scale(0.98);
}

/* ============================================
   PLAYGROUND STYLES
   ============================================ */

.playground-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.playground-header h2 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.playground-section {
  margin-bottom: var(--space-6);
}

.playground-section:last-child {
  margin-bottom: 0;
}

.playground-section h3 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

/* Form Styles */
.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.form-input:focus {
  outline: none;
  border-color: var(--flow-orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* Auth Grid */
.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

/* Request Info */
.request-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.info-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.info-row strong {
  min-width: 80px;
}

/* Variables Grid */
.variables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
}

.variable-input-group {
  display: flex;
  flex-direction: column;
}

/* Response Styles */
.response-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.response-status.success {
  background: #DCFCE7;
  border: 1px solid #86EFAC;
}

.response-status.error {
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
}

.status-code {
  font-weight: 600;
  font-size: 1rem;
}

.response-time {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.response-body {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.response-body pre {
  margin: 0;
  padding: var(--space-4);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  font-family: 'Courier New', monospace;
}

/* Responsive playground */
@media (max-width: 768px) {
  .playground-header {
    flex-direction: column;
    gap: var(--space-4);
  }

  .variables-grid,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .info-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Spacing Utilities */
.mt-0 { margin-top: var(--space-0); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: var(--space-0); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-0 { padding: var(--space-0); }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Text Utilities */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* Display Utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flexbox Utilities */
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Shadow Utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }

/* Radius Utilities */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 9999px; }

/* ============================================
   MOBILE ENHANCEMENTS
   ============================================ */

/* Mobile Touch Improvements */
@media (max-width: 768px) {
  /* Ensure body doesn't overflow */
  body {
    overflow-x: hidden;
    width: 100%;
  }

  /* Larger touch targets (min 44x44px) */
  .btn,
  .filter-btn,
  .platform-btn,
  .theme-toggle,
  .view-btn {
    min-height: 44px;
    min-width: 44px;
    padding: var(--space-3) var(--space-4);
  }

  /* Main container fix */
  main {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Improved mobile spacing */
  .nodes-grid {
    gap: var(--space-4);
    padding: 0;
    width: 100%;
    grid-template-columns: 1fr !important;
  }

  /* Full-width search on mobile */
  .search-input {
    min-width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .search-box {
    width: 100%;
  }

  /* Better mobile modal */
  .glass-modal-content {
    margin: var(--space-4);
    max-height: calc(100vh - var(--space-8));
    width: calc(100% - var(--space-8));
  }

  /* Sticky mobile header with reduced height */
  .glass-header {
    padding: var(--space-3) var(--space-4);
  }

  /* Mobile-optimized node cards */
  .node-card {
    padding: var(--space-4);
    width: 100%;
    box-sizing: border-box;
  }

  .node-card-enhanced {
    padding: var(--space-4);
    width: 100%;
    box-sizing: border-box;
  }

  /* Easier tap targets for node actions */
  .node-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  .node-actions .btn {
    width: 100%;
  }

  /* Mobile list items */
  .node-list-item {
    padding: var(--space-4);
    flex-direction: column;
    align-items: flex-start;
  }

  .node-list-actions {
    width: 100%;
    margin-top: var(--space-3);
    display: flex;
    gap: var(--space-2);
  }

  .node-list-actions .btn {
    flex: 1;
  }

  /* Stats on mobile */
  .stats {
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }

  .stat-card {
    flex: 1;
    min-width: 120px;
  }

  /* Filter groups */
  .filter-group {
    width: 100%;
  }

  /* Reduce animation intensity on mobile */
  .hover-lift:hover {
    transform: translateY(-2px);
  }

  .hover-scale:hover {
    transform: scale(1.01);
  }

  /* Newsletter section mobile */
  .newsletter-section {
    padding: var(--space-6) var(--space-4);
  }

  .newsletter-container {
    padding: var(--space-5);
  }

  /* View toggle */
  .view-toggle {
    margin-right: var(--space-4);
    margin-left: var(--space-4);
  }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  .nodes-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .node-card-enhanced,
  .node-card {
    padding: var(--space-5);
  }
}

/* Large Screen Optimizations */
@media (min-width: 1440px) {
  .nodes-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: var(--space-8);
  }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .glass-modal-content {
    max-height: calc(100vh - var(--space-4));
    overflow-y: auto;
  }

  .modal-header,
  .modal-body {
    padding: var(--space-4);
  }
}

/* ============================================
   PWA ENHANCEMENTS
   ============================================ */

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .glass-header {
    padding-left: max(var(--space-4), env(safe-area-inset-left));
    padding-right: max(var(--space-4), env(safe-area-inset-right));
  }

  .glass-modal-content {
    margin-left: max(var(--space-4), env(safe-area-inset-left));
    margin-right: max(var(--space-4), env(safe-area-inset-right));
  }
}

/* Standalone PWA Mode */
@media (display-mode: standalone) {
  .top-banner {
    padding-top: max(var(--space-2), env(safe-area-inset-top));
  }

  .glass-header {
    position: sticky;
    top: 0;
  }
}

/* Dark Mode PWA Splash Screen Compatible */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  /* Hide non-essential elements */
  .top-banner,
  .glass-header,
  .theme-toggle,
  .platform-switcher,
  .view-toggle,
  .newsletter-section,
  footer {
    display: none;
  }

  /* Optimize for print */
  body {
    background: white;
    color: black;
  }

  .node-card,
  .node-list-item {
    page-break-inside: avoid;
    border: 1px solid #000;
  }

  /* Remove shadows and effects */
  * {
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU Acceleration for smooth animations */
.hover-lift,
.hover-scale,
.node-card,
.btn-enhanced {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Optimize font rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Lazy load optimization for animations */
@media (prefers-reduced-motion: no-preference) {
  .fade-in {
    opacity: 0;
    animation: fadeIn var(--duration-base) var(--ease-out) forwards;
  }
}

/* ============================================
   COLLECTIONS SYSTEM
   ============================================ */

.collections-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-4);
}

.collections-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.collections-header h1 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.collections-header p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.collection-card {
  background: var(--surface-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.collection-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--flow-orange) 0%, var(--sunset-orange) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-base) var(--ease-out);
}

.collection-card:hover::before {
  transform: scaleX(1);
}

.collection-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--flow-orange);
}

.collection-card.premade {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(251, 146, 60, 0.02) 100%);
  border-color: var(--flow-orange);
}

.collection-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.collection-icon {
  font-size: var(--text-3xl);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--orange-100);
  border-radius: var(--radius-lg);
}

.collection-info h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.collection-info p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.collection-stats {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.collection-stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.collection-stat strong {
  color: var(--flow-orange);
  font-weight: var(--font-semibold);
}

.collection-actions {
  display: flex;
  gap: var(--space-2);
}

.collection-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--flow-orange);
  color: white;
  padding: var(--space-1) var(--space-3);
  border-radius: 12px;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
}

/* Collection Modal */
.collection-modal-content {
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
}

.collection-nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.collection-node-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: all var(--duration-fast) var(--ease-out);
}

.collection-node-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--flow-orange);
}

.collection-node-icon {
  font-size: var(--text-2xl);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--flow-orange);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.collection-node-info {
  flex: 1;
  min-width: 0;
}

.collection-node-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-node-type {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

/* Create Collection Form */
.create-collection-form {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.form-group {
  margin-bottom: var(--space-4);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  background: var(--surface-white);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--flow-orange);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ============================================
   INTERACTIVE PLAYGROUND
   ============================================ */

#playgroundModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

#playgroundModal.active {
  display: flex;
}

.playground-container {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
}

.playground-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 2px solid var(--border);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(251, 146, 60, 0.02) 100%);
}

.playground-title {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.playground-icon {
  font-size: var(--text-3xl);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--flow-orange) 0%, var(--sunset-orange) 100%);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.playground-title h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.playground-title p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.playground-body {
  padding: var(--space-6);
}

.playground-section {
  margin-bottom: var(--space-6);
}

.playground-section h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.playground-hint {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  font-style: italic;
}

.playground-request-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-secondary);
  padding: var(--space-4);
  border-radius: var(--radius-md);
}

.playground-method {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  font-family: 'Courier New', monospace;
  color: white;
}

.playground-method.get { background: var(--http-get); }
.playground-method.post { background: var(--http-post); }
.playground-method.put { background: var(--http-put); }
.playground-method.patch { background: var(--http-patch); }
.playground-method.delete { background: var(--http-delete); }

.playground-url {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--code-bg);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.playground-code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
}

.playground-code pre {
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--code-text);
}

.playground-output {
  border-left: 4px solid var(--success-green);
}

.playground-tips {
  background: var(--orange-50);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--orange-200);
}

[data-theme="dark"] .playground-tips {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.2);
}

.playground-tips h3 {
  color: var(--orange-700);
}

[data-theme="dark"] .playground-tips h3 {
  color: var(--orange-400);
}

.playground-tips ul {
  margin-left: var(--space-6);
  color: var(--text-secondary);
}

.playground-tips li {
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

.playground-tips code {
  background: rgba(249, 115, 22, 0.1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: var(--text-sm);
  color: var(--flow-orange);
}

.playground-actions {
  display: flex;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.playground-actions .btn {
  flex: 1;
}

/* Add to node card - Test button */
.node-test-btn {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: linear-gradient(135deg, var(--info-blue) 0%, #0EA5E9 100%);
  color: white;
  border: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: all var(--duration-fast) var(--ease-out);
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.node-test-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  filter: brightness(110%);
}

/* ============================================
   MICRO-INTERACTIONS - Delightful Polish
   ============================================ */

/* Node Card Base Styles - Consolidated */
.node-card {
  /* Glass-morphism */
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.3);

  /* 3D Effects */
  transform-style: preserve-3d;

  /* Clickable cursor */
  cursor: pointer;

  /* Transitions */
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              background var(--duration-base) var(--ease-out);

  /* Entrance Animation */
  animation: fadeInScale var(--duration-slow) var(--ease-out);
  animation-fill-mode: both;
}

[data-theme="dark"] .node-card {
  background: rgba(30, 30, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.node-card:hover {
  transform: translateY(-4px) perspective(1000px) rotateX(2deg);
}

/* Button Magnetic Effect */
@media (hover: hover) {
  .btn-magnetic {
    transition: transform var(--duration-fast) var(--ease-spring);
  }

  .btn-magnetic:hover {
    transform: scale(1.05);
  }

  .btn-magnetic:active {
    transform: scale(0.95);
  }
}

/* Shimmer Loading Effect */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Pulse Animation for Important Elements */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(249, 115, 22, 0);
  }
}

.pulse-glow {
  animation: pulse-glow 2s infinite;
}

/* Smooth Entry Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-slide-up {
  animation: slideInUp var(--duration-base) var(--ease-out);
}

.animate-slide-left {
  animation: slideInLeft var(--duration-base) var(--ease-out);
}

.animate-fade-scale {
  animation: fadeInScale var(--duration-base) var(--ease-out);
}

/* Stagger animation delays for grid items */
.node-card:nth-child(1) { animation-delay: 0ms; }
.node-card:nth-child(2) { animation-delay: 50ms; }
.node-card:nth-child(3) { animation-delay: 100ms; }
.node-card:nth-child(4) { animation-delay: 150ms; }
.node-card:nth-child(5) { animation-delay: 200ms; }
.node-card:nth-child(6) { animation-delay: 250ms; }
.node-card:nth-child(7) { animation-delay: 300ms; }
.node-card:nth-child(8) { animation-delay: 350ms; }
.node-card:nth-child(9) { animation-delay: 400ms; }

/* Hover Glow Effect */
.glow-on-hover {
  position: relative;
  transition: all var(--duration-base) var(--ease-out);
}

.glow-on-hover::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--flow-orange), var(--flow-orange-light));
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
  z-index: -1;
  filter: blur(8px);
}

.glow-on-hover:hover::before {
  opacity: 0.6;
}

/* Confetti Success Animation */
@keyframes confetti-fall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--flow-orange);
  top: -10px;
  z-index: var(--z-toast);
  animation: confetti-fall 3s linear forwards;
  pointer-events: none;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: slideInLeft var(--duration-base) var(--ease-spring);
  backdrop-filter: blur(10px);
  max-width: 400px;
}

.toast-notification.success {
  border-left: 4px solid #10B981;
}

.toast-notification.error {
  border-left: 4px solid #EF4444;
}

.toast-notification.info {
  border-left: 4px solid var(--info-blue);
}

@keyframes slideOut {
  to {
    transform: translateX(450px);
    opacity: 0;
  }
}

.toast-notification.hiding {
  animation: slideOut var(--duration-base) var(--ease-in) forwards;
}

/* ============================================
   ENHANCED GLASS-MORPHISM DESIGN
   ============================================ */

/* Glass Card Variant */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all var(--duration-base) var(--ease-out);
}

[data-theme="dark"] .glass-card {
  background: rgba(30, 30, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(249, 115, 22, 0.3);
  box-shadow: 0 12px 40px rgba(249, 115, 22, 0.15);
  transform: translateY(-2px);
}

[data-theme="dark"] .glass-card:hover {
  background: rgba(40, 40, 40, 0.85);
  border-color: rgba(249, 115, 22, 0.5);
}

/* Glass Panel Effect */
.glass-panel {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

[data-theme="dark"] .glass-panel {
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Enhanced Glass Header */
.glass-header {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="dark"] .glass-header {
  background: rgba(20, 20, 20, 0.8) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Header Content Layout */
.header-content {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.8;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #F97316 0%, #F59E0B 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Modern Navigation Styles */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(249, 115, 22, 0.08);
}

.nav-link.active {
  color: var(--flow-orange);
  background: rgba(249, 115, 22, 0.12);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--flow-orange);
  border-radius: 2px;
}

.nav-icon {
  font-size: 1.125rem;
  line-height: 1;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin-left: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(249, 115, 22, 0.08);
  border-color: var(--flow-orange);
  transform: rotate(15deg) scale(1.05);
}

.theme-icon {
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    align-items: stretch;
  }

  .header-actions,
  .header-nav {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .header-nav {
    flex-direction: row;
    justify-content: space-around;
  }

  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    flex: 1;
    justify-content: center;
    min-width: fit-content;
  }

  .nav-link span:not(.nav-icon) {
    display: none;
  }

  .nav-icon {
    font-size: 1.25rem;
  }

  .theme-toggle-btn {
    margin-left: 0;
  }

  .platform-switcher {
    width: 100%;
    justify-content: stretch;
  }

  .platform-btn {
    flex: 1;
  }
}

/* Glass Button Variant */
.btn-glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-primary);
  transition: all var(--duration-base) var(--ease-out);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--flow-orange);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.2);
}

[data-theme="dark"] .btn-glass {
  background: rgba(40, 40, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-glass:hover {
  background: rgba(60, 60, 60, 0.8);
}

/* ============================================
   CURSOR EFFECTS - Interactive Polish
   ============================================ */

/* Custom Cursor with Glow */
@media (hover: hover) and (pointer: fine) {
  body.custom-cursor {
    cursor: none;
  }

  .cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--flow-orange);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: var(--z-toast);
    transition: transform var(--duration-instant) var(--ease-out);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.6);
  }

  .cursor-outline {
    width: 32px;
    height: 32px;
    border: 2px solid var(--flow-orange);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: var(--z-toast);
    transition: all var(--duration-fast) var(--ease-out);
    opacity: 0.5;
  }

  .cursor-dot.hovering {
    transform: scale(2);
    background: var(--flow-orange-light);
  }

  .cursor-outline.hovering {
    transform: scale(1.5);
    opacity: 1;
  }
}

/* Magnetic Button Effect (Enhanced) */
@media (hover: hover) {
  .btn-primary, .btn-secondary, .btn-test {
    position: relative;
    transition: transform var(--duration-fast) var(--ease-spring),
                box-shadow var(--duration-fast) var(--ease-out);
  }

  .btn-primary:hover, .btn-secondary:hover, .btn-test:hover {
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
  }
}

/* Sparkle Effect for Success Actions */
@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.sparkle {
  position: fixed;
  width: 4px;
  height: 4px;
  background: var(--flow-orange);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-toast);
  animation: sparkle 0.6s ease-out forwards;
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Focus Visible Enhancement */
*:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-offset);
}

/* Selection Style */
::selection {
  background: rgba(249, 115, 22, 0.3);
  color: var(--text-primary);
}

/* ============================================
   SPONSOR & FEATURED SLOTS - Revenue
   ============================================ */

/* Top Sponsor Banner */
.sponsor-banner {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-6);
}

.sponsor-content {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(251, 146, 60, 0.05) 100%);
  border: 2px solid rgba(249, 115, 22, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sponsor-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--flow-orange);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.sponsor-body {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.sponsor-logo {
  font-size: 3rem;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .sponsor-logo {
  background: rgba(255, 255, 255, 0.1);
}

.sponsor-text {
  flex: 1;
  min-width: 250px;
}

.sponsor-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.sponsor-description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin: 0;
}

.sponsor-cta {
  white-space: nowrap;
}

/* Sidebar Sponsors */
#main-content {
  display: flex;
  gap: var(--space-6);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.sponsor-sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  position: sticky;
  top: calc(var(--header-height, 80px) + var(--space-6));
  align-self: flex-start;
  max-height: calc(100vh - var(--header-height, 80px) - var(--space-8));
  overflow-y: auto;
}

.sponsor-card {
  padding: var(--space-5);
  border: 2px solid rgba(249, 115, 22, 0.2);
  transition: all var(--duration-base) var(--ease-out);
}

.sponsor-card:hover {
  border-color: rgba(249, 115, 22, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.2);
}

.sponsor-card-content {
  text-align: center;
}

.sponsor-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-3);
}

.sponsor-card-content h4 {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.sponsor-card-content p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.sponsor-card-content .btn {
  width: 100%;
}

/* Main Content Wrapper */
.main-content-wrapper {
  flex: 1;
  min-width: 0; /* Prevent flex item from overflowing */
  width: 100%;
  max-width: 100%;
}

@media (max-width: 768px) {
  .main-content-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
}

/* Featured Node Badge */
.node-card-featured {
  border: 2px solid var(--flow-orange);
  position: relative;
}

.node-card-featured::before {
  content: '⭐ Featured';
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--flow-orange);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sponsored Node Card (for in-feed ads) */
.node-card-sponsored {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(251, 146, 60, 0.02) 100%);
  border: 2px solid rgba(249, 115, 22, 0.3);
}

.node-card-sponsored::after {
  content: 'Sponsored';
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background: rgba(249, 115, 22, 0.9);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Footer Sponsors */
.footer-sponsors {
  max-width: 1440px;
  margin: var(--space-12) auto;
  padding: var(--space-8) var(--space-6);
  background: rgba(249, 115, 22, 0.03);
  border-top: 2px solid rgba(249, 115, 22, 0.1);
  border-bottom: 2px solid rgba(249, 115, 22, 0.1);
}

.sponsor-container {
  text-align: center;
}

.sponsor-section-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-8);
}

.sponsor-logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.sponsor-logo-card {
  padding: var(--space-6);
  text-align: center;
  transition: all var(--duration-base) var(--ease-out);
}

.sponsor-logo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.15);
}

.placeholder-logo {
  width: 120px;
  height: 80px;
  margin: 0 auto var(--space-3);
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: #64748b;
}

[data-theme="dark"] .placeholder-logo {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  color: rgba(255, 255, 255, 0.5);
}

.sponsor-logo-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

.sponsor-cta-section {
  padding: var(--space-6);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .sponsor-cta-section {
  background: rgba(0, 0, 0, 0.2);
}

.sponsor-cta-section p {
  font-size: var(--text-lg);
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-4);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .playground-container {
    margin: var(--space-2);
    max-height: calc(100vh - var(--space-4));
  }

  .playground-header {
    flex-direction: column;
    gap: var(--space-4);
  }

  .playground-title {
    flex-direction: column;
    text-align: center;
  }

  .playground-request-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .playground-actions {
    flex-direction: column;
  }

  .collections-grid {
    grid-template-columns: 1fr;
  }

  /* Disable animations on mobile for performance */
  .node-card {
    animation: none !important;
  }

  .toast-notification {
    bottom: var(--space-4);
    right: var(--space-4);
    left: var(--space-4);
    max-width: none;
  }

  /* Sponsor sections mobile */
  #main-content {
    flex-direction: column;
    padding: 0 var(--space-4);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sponsor-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    margin-bottom: var(--space-6);
  }

  .sponsor-banner {
    padding: var(--space-3) var(--space-4);
    width: 100%;
    box-sizing: border-box;
  }

  .sponsor-content {
    padding: var(--space-4);
    width: 100%;
    box-sizing: border-box;
  }

  .sponsor-body {
    flex-direction: column;
    text-align: center;
    gap: var(--space-4);
  }

  .sponsor-text {
    min-width: 100%;
  }

  .sponsor-title {
    font-size: var(--text-lg);
  }

  .sponsor-description {
    font-size: var(--text-sm);
  }

  .footer-sponsors {
    padding: var(--space-6) var(--space-4);
    width: 100%;
    box-sizing: border-box;
  }

  .sponsor-logos {
    grid-template-columns: 1fr;
  }
}
