@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Inter:wght@400;500;600&display=swap');

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

@layer base {
  :root {
    /* Soft neutrals with subtle warmth */
    --docs-neutral-50: #fafaf8;
    --docs-neutral-100: #f5f5f3;
    --docs-neutral-200: #e8e7e4;
    --docs-neutral-300: #d6d4cf;
    --docs-neutral-600: #5a5854;
    --docs-neutral-900: #1f1e1b;

    /* Primary accent - Blue (connects to brand purple-blue gradient) */
    --docs-accent-500: #3b82f6;
    --docs-accent-600: #2563eb;
    --docs-accent-700: #1d4ed8;
    --docs-accent-50: #eff6ff;
    --docs-accent-100: #dbeafe;

    /* Secondary - Muted Teal */
    --docs-teal-500: #5c8a8a;
    --docs-teal-50: #f3f8f8;

    /* Code blocks - subtle warm tint */
    --code-bg: #fafaf8;
    --code-border: #e8e7e4;
    --code-text: #374151;
  }

  .font-display {
    font-family: 'Fraunces', serif;
  }
}

@layer utilities {
  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }
}

@layer components {
  /* Responsive key name truncation */
  .key-name {
    max-width: 20rem; /* ~320px, ~45 chars on mobile */
    min-width: 0; /* Allow shrinking in flex container */
  }
  
  @media (min-width: 640px) {
    .key-name {
      max-width: 25rem; /* ~400px, ~60 chars on small tablets */
    }
  }
  
  @media (min-width: 768px) {
    .key-name {
      max-width: 30rem; /* ~480px, ~70 chars on tablets */
    }
  }
  
  @media (min-width: 1024px) {
    .key-name {
      max-width: 40rem; /* ~640px, ~90 chars on desktop */
    }
  }
  
  @media (min-width: 1280px) {
    .key-name {
      max-width: 50rem; /* ~800px, ~115 chars on large desktop */
    }
  }

  /* Responsive metadata truncation */
  .metadata-text {
    max-width: 6rem; /* ~96px, ~12 chars on mobile */
    min-width: 0; /* Allow shrinking in flex container */
  }
  
  @media (min-width: 640px) {
    .metadata-text {
      max-width: 8rem; /* ~128px, ~16 chars on small tablets */
    }
  }
  
  @media (min-width: 768px) {
    .metadata-text {
      max-width: 12rem; /* ~192px, ~24 chars on tablets */
    }
  }
  
  @media (min-width: 1024px) {
    .metadata-text {
      max-width: 16rem; /* ~256px, ~32 chars on desktop */
    }
  }
  
  @media (min-width: 1280px) {
    .metadata-text {
      max-width: 20rem; /* ~320px, ~40 chars on large desktop */
    }
  }

  /* Ensure truncate class works properly in flex containers */
  .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Editorial Docs Styling */
  .docs-code-block {
    position: relative;
    background: var(--code-bg);
    border: 2px solid var(--code-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    font-family: ui-monospace, monospace;
    font-size: 0.875rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.03);
  }

  .docs-code-block::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--docs-accent-50);
    opacity: 0.5;
    border-radius: 0.875rem;
    z-index: -1;
    filter: blur(6px);
  }

  .docs-callout {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: var(--docs-accent-50);
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
  }

  .docs-callout::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 16rem;
    height: 16rem;
    background: var(--docs-accent-500);
    opacity: 0.04;
    border-radius: 100%;
    filter: blur(60px);
    pointer-events: none;
  }

  .docs-step-number {
    font-family: 'Fraunces', serif;
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--docs-accent-500);
    opacity: 0.15;
  }

  .docs-command-card {
    background: white;
    border: 2px solid var(--docs-neutral-200);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all 200ms ease;
  }

  .docs-command-card:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    border-color: var(--docs-neutral-300);
  }

  .docs-section-header {
    font-family: 'Fraunces', serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--docs-neutral-900);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--docs-neutral-200);
  }
}
.flash-message {
  @apply mb-4 p-4 text-sm rounded-lg;
}

.flash-message.notice {
  @apply bg-blue-100 text-blue-700;
}

.flash-message.alert {
  @apply bg-red-100 text-red-700;
}

.flash-message.warning {
  @apply bg-yellow-100 text-yellow-700;
}

.flash-message.success {
  @apply bg-green-100 text-green-700;
}