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

@layer components {
  /* Buttons */
  .button, .btn {
    @apply inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition-colors cursor-pointer;
    @apply bg-gray-100 text-gray-700 border border-gray-300;
    @apply hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500;
  }

  .button.primary, .btn-primary {
    @apply bg-indigo-600 text-white border-transparent;
    @apply hover:bg-indigo-700;
  }

  .button.secondary, .btn-secondary {
    @apply bg-white text-gray-700 border-gray-300;
    @apply hover:bg-gray-50;
  }

  .button.danger, .btn-danger {
    @apply bg-red-600 text-white border-transparent;
    @apply hover:bg-red-700;
  }

  /* Form inputs */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="url"],
  textarea,
  select,
  .code-input {
    @apply block w-full px-3 py-2 text-sm rounded-md border border-gray-300 shadow-sm;
    @apply placeholder-gray-400;
    @apply focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500;
  }

  .code-input {
    @apply font-mono text-lg tracking-widest uppercase;
    @apply max-w-xs;
  }

  /* Alerts and notices */
  .alert {
    @apply p-4 mb-4 rounded-md bg-red-50 text-red-700 border border-red-200;
  }

  .notice {
    @apply p-4 mb-4 rounded-md bg-green-50 text-green-700 border border-green-200;
  }

  /* Cards and containers */
  .card {
    @apply bg-white rounded-lg shadow-sm border border-gray-200 p-6;
  }

  .device-verify-container {
    @apply max-w-md mx-auto mt-8 p-6 bg-white rounded-lg shadow-sm border border-gray-200;
  }

  .device-verify-container h1 {
    @apply text-xl font-semibold text-gray-900 mb-4;
  }

  .device-verify-container p {
    @apply text-gray-600 mb-3;
  }

  .device-verify-container form {
    @apply mt-4 flex flex-col sm:flex-row gap-3 items-start sm:items-center;
  }

  .button-group {
    @apply flex gap-3 mt-4;
  }

  /* Tables */
  table {
    @apply w-full text-sm;
  }

  th {
    @apply text-left font-medium text-gray-500 uppercase tracking-wider py-3 px-4 bg-gray-50 border-b;
  }

  td {
    @apply py-3 px-4 border-b border-gray-100;
  }

  tr:hover td {
    @apply bg-gray-50;
  }

  /* Links */
  a:not(.button):not(.btn) {
    @apply text-indigo-600 hover:text-indigo-800 hover:underline;
  }

  /* Page headers */
  h1 {
    @apply text-2xl font-bold text-gray-900;
  }

  h2 {
    @apply text-xl font-semibold text-gray-800;
  }

  h3 {
    @apply text-lg font-medium text-gray-700;
  }

  /* Empty states */
  .empty-state {
    @apply text-center py-12 text-gray-500;
  }

  .empty-state p {
    @apply mb-2;
  }

  .empty-state code {
    @apply bg-gray-100 px-2 py-1 rounded text-sm font-mono text-gray-600;
  }
}
