/*
 * shadcn/ui Component Patterns (Tailwind CSS)
 * Use these utility classes alongside Tailwind CSS CDN
 * 
 * Usage: Add these classes to HTML elements to get shadcn/ui-style components
 * Example: <button class="shadcn-btn shadcn-btn-primary">Click me</button>
 */

/* ─── Buttons ─────────────────────────────────────────────── */
.shadcn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  outline: none;
}
.shadcn-btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
.shadcn-btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}
.shadcn-btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.shadcn-btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}
.shadcn-btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}
.shadcn-btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.8);
}
.shadcn-btn-outline {
  background-color: transparent;
  border-color: hsl(var(--input));
  color: hsl(var(--foreground));
}
.shadcn-btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.shadcn-btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
}
.shadcn-btn-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.shadcn-btn-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}
.shadcn-btn-destructive:hover {
  background-color: hsl(var(--destructive) / 0.9);
}
.shadcn-btn-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  border-radius: calc(var(--radius) - 2px);
}
.shadcn-btn-lg {
  height: 2.75rem;
  padding: 0 2rem;
  font-size: 0.9375rem;
}
.shadcn-btn-icon {
  height: 2.5rem;
  width: 2.5rem;
  padding: 0;
}

/* ─── Cards ────────────────────────────────────────────────── */
.shadcn-card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.shadcn-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.5rem;
}
.shadcn-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
}
.shadcn-card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.shadcn-card-content {
  padding: 0 1.5rem 1.5rem;
}
.shadcn-card-footer {
  display: flex;
  align-items: center;
  padding: 0 1.5rem 1.5rem;
}

/* ─── Badges ───────────────────────────────────────────────── */
.shadcn-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: colors 0.15s;
  border: 1px solid transparent;
}
.shadcn-badge-default {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.shadcn-badge-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}
.shadcn-badge-outline {
  background-color: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}
.shadcn-badge-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

/* ─── Inputs ───────────────────────────────────────────────── */
.shadcn-input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: transparent;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  outline: none;
  transition: border-color 0.15s;
}
.shadcn-input::placeholder {
  color: hsl(var(--muted-foreground));
}
.shadcn-input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* ─── Select ───────────────────────────────────────────────── */
.shadcn-select {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: transparent;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
}

/* ─── Textarea ─────────────────────────────────────────────── */
.shadcn-textarea {
  display: flex;
  width: 100%;
  min-height: 5rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: transparent;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  outline: none;
  resize: vertical;
}

/* ─── Alert ────────────────────────────────────────────────── */
.shadcn-alert {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  padding: 1rem;
}
.shadcn-alert-default {
  background-color: hsl(var(--background));
}
.shadcn-alert-destructive {
  border-color: hsl(var(--destructive) / 0.5);
  background-color: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

/* ─── Separator ────────────────────────────────────────────── */
.shadcn-separator {
  height: 1px;
  width: 100%;
  background-color: hsl(var(--border));
}

/* ─── Avatar ───────────────────────────────────────────────── */
.shadcn-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  overflow: hidden;
  background-color: hsl(var(--muted));
}
.shadcn-avatar-sm {
  width: 2rem;
  height: 2rem;
}
.shadcn-avatar-lg {
  width: 3rem;
  height: 3rem;
}

/* ─── Tabs ─────────────────────────────────────────────────── */
.shadcn-tabs-list {
  display: inline-flex;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background-color: hsl(var(--muted));
  padding: 0.25rem;
  gap: 0;
}
.shadcn-tabs-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.shadcn-tabs-trigger:hover {
  color: hsl(var(--foreground));
}
.shadcn-tabs-trigger.active,
.shadcn-tabs-trigger[aria-selected="true"] {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* ─── Table ────────────────────────────────────────────────── */
.shadcn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.shadcn-table th {
  height: 3rem;
  padding: 0 1rem;
  text-align: left;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
}
.shadcn-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
}
.shadcn-table tbody tr:hover {
  background-color: hsl(var(--muted) / 0.5);
}

/* ─── Dropdown / Popover ───────────────────────────────────── */
.shadcn-dropdown {
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  padding: 0.25rem;
}

/* ─── Tooltip ──────────────────────────────────────────────── */
.shadcn-tooltip {
  position: relative;
}
.shadcn-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  background-color: hsl(var(--foreground));
  color: hsl(var(--background));
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  margin-bottom: 0.5rem;
}
.shadcn-tooltip:hover::after {
  opacity: 1;
}
