/* shadcn/ui Component Styles */

/* Base Layer */
@layer base {
  * {
    border-color: hsl(var(--border));
  }

  body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
  }
}

/* CSS Variables for shadcn/ui */
:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 196.8 84.3% 17.5%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96%;
  --secondary-foreground: 222.2 84% 4.9%;
  --muted: 210 40% 96%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96%;
  --accent-foreground: 222.2 84% 4.9%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 196.8 84.3% 17.5%;
  --radius: 0.5rem;
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 196.8 84.3% 17.5%;
  --primary-foreground: 222.2 84% 4.9%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 224.3 76.3% 94.1%;
}

/* Component Styles */

/* Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  transition: colors 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn-default {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-default:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.btn-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover {
  background-color: hsl(var(--destructive) / 0.9);
}

.btn-outline {
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
}

.btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.8);
}

.btn-ghost {
  background-color: transparent;
}

.btn-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-link {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 4px;
  background-color: transparent;
}

.btn-link:hover {
  text-decoration: none;
}

/* Button Sizes */
.btn-sm {
  height: 2.25rem;
  border-radius: calc(var(--radius) - 4px);
  padding: 0 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  height: 2.75rem;
  border-radius: calc(var(--radius) - 2px);
  padding: 0 2rem;
}

.btn-icon {
  height: 2.5rem;
  width: 2.5rem;
  padding: 0;
}

/* Card Component */
.card {
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.card-header {
  display: flex;
  flex-direction: column;
  space-y: 0.375rem;
  padding: 1.5rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
}

.card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.card-content {
  padding: 1.5rem;
  padding-top: 0;
}

.card-footer {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  padding-top: 0;
}

/* Input Component */
.input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: colors 0.2s;
}

.input:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

/* Label Component */
.label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  color: hsl(var(--foreground));
}

.label:has(+ .input:disabled) {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Textarea Component */
.textarea {
  display: flex;
  min-height: 5rem;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: colors 0.2s;
  resize: none;
}

.textarea:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.textarea:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.textarea::placeholder {
  color: hsl(var(--muted-foreground));
}

/* Select Component */
.select-trigger {
  display: flex;
  height: 2.5rem;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.select-trigger:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.select-trigger[data-placeholder] {
  color: hsl(var(--muted-foreground));
}

/* Checkbox Component */
.checkbox {
  height: 1rem;
  width: 1rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid hsl(var(--primary));
  background-color: transparent;
  cursor: pointer;
}

.checkbox:checked {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.checkbox:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Radio Component */
.radio {
  height: 1rem;
  width: 1rem;
  border-radius: 50%;
  border: 1px solid hsl(var(--primary));
  background-color: transparent;
  cursor: pointer;
}

.radio:checked {
  background-color: hsl(var(--primary));
}

.radio:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.radio:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Badge Component */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  transition: colors 0.2s;
  border: 1px solid transparent;
}

.badge-default {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.badge-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.badge-outline {
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}

/* Alert Component */
.alert {
  position: relative;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  padding: 1rem;
  background-color: hsl(var(--background));
}

.alert-destructive {
  border-color: hsl(var(--destructive) / 0.5);
  color: hsl(var(--destructive));
  background-color: hsl(var(--destructive) / 0.1);
}

.alert-title {
  margin-bottom: 0.25rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
}

.alert-description {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Progress Component */
.progress {
  position: relative;
  height: 1rem;
  width: 100%;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--secondary));
}

.progress-indicator {
  height: 100%;
  width: 100%;
  flex: 1;
  background-color: hsl(var(--primary));
  transition: all 0.2s;
}

/* Separator Component */
.separator {
  flex-shrink: 0;
  background-color: hsl(var(--border));
}

.separator[data-orientation="horizontal"] {
  height: 1px;
  width: 100%;
}

.separator[data-orientation="vertical"] {
  height: 100%;
  width: 1px;
}

/* Avatar Component */
.avatar {
  position: relative;
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
}

.avatar-image {
  aspect-ratio: 1;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.avatar-fallback {
  display: flex;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  font-weight: 500;
}

/* Skeleton Component */
.skeleton {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--muted));
}

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Ring Utility */
.focus-ring {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* Text Utilities */
.text-muted {
  color: hsl(var(--muted-foreground));
}

.text-destructive {
  color: hsl(var(--destructive));
}

/* Background Utilities */
.bg-muted {
  background-color: hsl(var(--muted));
}

.bg-accent {
  background-color: hsl(var(--accent));
}

/* Border Utilities */
.border {
  border: 1px solid hsl(var(--border));
}

.border-destructive {
  border-color: hsl(var(--destructive));
}

/* Responsive Design */
@media (max-width: 768px) {
  .card-header,
  .card-content,
  .card-footer {
    padding: 1rem;
  }
  
  .btn-lg {
    height: 2.5rem;
    padding: 0 1.5rem;
  }
  
  .input,
  .select-trigger {
    height: 2.25rem;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .btn-outline {
    border-width: 2px;
  }
  
  .input,
  .textarea,
  .select-trigger {
    border-width: 2px;
  }
  
  .card {
    border-width: 2px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .input,
  .textarea,
  .select-trigger,
  .progress-indicator {
    transition: none;
  }
  
  .skeleton {
    animation: none;
  }
}