/* Loveable-inspired Component Styles */

/* Base Styles */
* {
  border-color: hsl(var(--border));
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Card Component - Loveable Style */
.card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.card:hover {
  /* box-shadow: var(--shadow-lg); */
}

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

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  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;
}

/* Button Component - Loveable Style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
  outline: none;
  border: none;
}

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

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

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.5rem 1rem;
  height: 2.5rem;
}

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

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  padding: 0.5rem 1rem;
  height: 2.5rem;
}

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

.btn-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  padding: 0.5rem 1rem;
  height: 2.5rem;
}

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

.btn-outline {
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 0.5rem 1rem;
  height: 2.5rem;
}

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

.btn-ghost {
  padding: 0.5rem 1rem;
  height: 2.5rem;
  background-color: transparent;
}

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

.btn-sm {
  height: 2.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
}

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

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

/* Badge Component - Loveable Style */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid transparent;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.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(0 84% 60% / 0.15);
  color: hsl(0 72% 50%);
}

.badge-success {
  background-color: hsl(142 76% 36% / 0.15);
  color: hsl(142 76% 36%);
}

.badge-warning {
  background-color: hsl(38 92% 50% / 0.15);
  color: hsl(38 92% 40%);
}

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

/* Input Component - Loveable Style */
.input {
  display: flex;
  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;
  color: hsl(var(--foreground));
  transition: var(--transition-fast);
}

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

.input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

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

/* Table Component - Loveable Style */
.table-container {
  position: relative;
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
}

.table {
  width: 100%;
  caption-side: bottom;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.table thead {
  background-color: hsl(var(--muted) / 0.5);
}

.table thead tr {
  border-bottom: 1px solid hsl(var(--border));
}

.table th {
  height: 3rem;
  padding: 0 1rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.table tbody tr {
  border-bottom: 1px solid hsl(var(--border));
  transition: var(--transition-fast);
}

.table tbody tr:hover {
  background-color: hsl(var(--muted) / 0.5);
}

.table tbody tr:last-child {
  border: 0;
}

.table td {
  padding: 1rem;
  vertical-align: middle;
}

/* Alert Component - Loveable Style */
.alert {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  padding: 1rem;
  font-size: 0.875rem;
}

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

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

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

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

/* Metric Card - Loveable Style */
.metric-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition-smooth);
}

.metric-card:hover {
  box-shadow: var(--shadow-lg);
}

.metric-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
}

.metric-card-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.metric-card-icon {
  padding: 0.75rem;
  border-radius: var(--radius);
  display: inline-flex;
}

.metric-card-icon.normal {
  background-color: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
}

.metric-card-icon.warning {
  background-color: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning));
}

.metric-card-icon.critical {
  background-color: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

/* Grid Layout */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* Animations */
@keyframes accordion-down {
  from {
    height: 0;
  }
  to {
    height: var(--radix-accordion-content-height, auto);
  }
}

@keyframes accordion-up {
  from {
    height: var(--radix-accordion-content-height, auto);
  }
  to {
    height: 0;
  }
}

.accordion-down {
  animation: accordion-down 0.2s ease-out;
}

.accordion-up {
  animation: accordion-up 0.2s ease-out;
}
