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

@layer base {
  body { font-family: 'Inter', 'Inter var', sans-serif; }
  h1, h2, h3, h4, .font-display { font-family: 'Space Grotesk', sans-serif; }
}

@layer components {
  .bg-grid-pattern {
    background-color: #f8fafc;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
  }

  .tech-border {
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  }

  .repo-row {
    transition: all 0.15s ease;
  }
  .repo-row:hover {
    border-color: #a5b4fc;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.08), 0 1px 2px 0 rgba(0,0,0,0.04);
    transform: translateY(-1px);
  }

  .live-ring {
    animation: pulse-ring 2s ease-out infinite;
  }

  .build-row {
    transition: all 0.15s ease;
  }
  .build-row:hover {
    border-color: #a5b4fc;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.08), 0 1px 2px 0 rgba(0,0,0,0.04);
    transform: translateY(-1px);
  }

  .dur-bar {
    transition: height 0.3s ease, background-color 0.2s ease;
  }
  .dur-bar:hover {
    filter: brightness(1.1);
  }

  /* Kiosk cards */
  .kiosk-card {
    transition: all 0.2s ease;
  }
  .kiosk-card:hover {
    border-color: #a5b4fc;
    box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.1), 0 2px 4px 0 rgba(0,0,0,0.04);
    transform: translateY(-2px);
  }
  .kiosk-card:hover .kiosk-preview {
    border-color: #c7d2fe;
  }
  .kiosk-card:hover .kiosk-launch {
    opacity: 1;
    transform: translateY(0);
  }
  .kiosk-launch {
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.2s ease;
  }

  .mini-cell-pulse {
    animation: cellPulse 3s ease-in-out infinite alternate;
  }

  .create-card {
    transition: all 0.2s ease;
  }
  .create-card:hover {
    border-color: #818cf8;
    background: linear-gradient(135deg, rgba(238,242,255,0.6) 0%, rgba(224,231,255,0.4) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.1);
  }
  .create-card:hover .create-icon {
    background-color: #4f46e5;
    color: white;
    transform: scale(1.05);
  }
  .create-icon {
    transition: all 0.2s ease;
  }

  /* Repo select cards (new kiosk form) */
  .repo-select {
    transition: all 0.15s ease;
    cursor: pointer;
  }
  .repo-select:hover {
    border-color: #c7d2fe;
    background: #fafafe;
  }
  .repo-select.selected {
    border-color: #818cf8;
    background: linear-gradient(135deg, #eef2ff 0%, rgba(224, 231, 255, 0.25) 100%);
    box-shadow: 0 0 0 1px #818cf8, 0 2px 8px -2px rgba(99, 102, 241, 0.15);
  }
  .repo-select.selected .repo-check {
    background: #4f46e5;
    border-color: #4f46e5;
    color: white;
  }
  .repo-select .repo-check {
    transition: all 0.15s ease;
  }
  .repo-select.selected .repo-order {
    opacity: 1;
    transform: scale(1);
  }
  .repo-order {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
  }

  /* Theme/Layout picker cards */
  .theme-card {
    transition: all 0.15s ease;
    cursor: pointer;
  }
  .theme-card:hover {
    border-color: #c7d2fe;
  }
  .theme-card.selected {
    border-color: #818cf8;
    box-shadow: 0 0 0 1px #818cf8;
  }
  .theme-card.selected .theme-radio {
    background: #4f46e5;
    border-color: #4f46e5;
    box-shadow: inset 0 0 0 2px white;
  }

  /* Preview screen scanlines */
  .preview-screen {
    position: relative;
    overflow: hidden;
  }
  .preview-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 49%,
      rgba(0,0,0,0.015) 50%,
      transparent 51%,
      transparent 100%
    );
    background-size: 100% 4px;
    pointer-events: none;
    border-radius: inherit;
  }

  /* Sticky preview panel */
  .sticky-preview {
    position: sticky;
    top: 80px;
  }

  /* Step indicator line */
  .step-line {
    transition: background-color 0.3s ease;
  }

  /* Drag handle hint */
  .drag-hint {
    animation: dragHint 2s ease-in-out infinite;
  }

  .kiosk-preview {
    position: relative;
    overflow: hidden;
  }
  .kiosk-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 49%,
      rgba(0,0,0,0.015) 50%,
      transparent 51%,
      transparent 100%
    );
    background-size: 100% 4px;
    pointer-events: none;
    border-radius: inherit;
  }

  /* Pagy pagination */
  .pagy nav.pagy {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  .pagy nav.pagy a,
  .pagy nav.pagy span {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    border-radius: 0.25rem;
  }
  .pagy nav.pagy a {
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    background: white;
    color: #475569;
  }
  .pagy nav.pagy a:hover {
    background: #f8fafc;
  }
  .pagy nav.pagy a[aria-disabled="true"] {
    color: #94a3b8;
    cursor: not-allowed;
  }
  .pagy nav.pagy span.current {
    background: #0f172a;
    color: white;
  }
  .pagy nav.pagy span.gap {
    color: #cbd5e1;
    padding: 0.375rem 0.25rem;
  }
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes cellPulse {
  0%   { opacity: 0.85; }
  100% { opacity: 1; }
}

@keyframes dragHint {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.6; }
}

