/* ARTATE - Components CSS
 * ========================
 * Reusable UI components
 */

/* ==================
   BUTTONS
   ================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

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

/* Primary Button */
.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

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

/* Outline Button */
.btn-outline {
  background-color: transparent;
  color: hsl(var(--foreground));
  border-color: var(--button-outline);
}

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

/* Ghost Button */
.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
  border-color: transparent;
}

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

/* Secondary Button */
.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--secondary));
}

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

/* Button Sizes */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.125rem;
}

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

/* Rounded Button */
.btn-rounded {
  border-radius: 9999px;
}

/* ==================
   CARDS
   ================== */
.card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card-glass {
  background-color: hsl(var(--card) / 0.5);
  backdrop-filter: blur(8px);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
}

.card-content {
  padding: 1.5rem;
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid hsl(var(--border) / 0.5);
}

.card-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

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

/* Card Hover Effects */
.card-hover:hover {
  border-color: hsl(var(--primary) / 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Card with Icon */
.card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  background-color: hsl(var(--primary) / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: background-color 0.3s ease;
}

.card:hover .card-icon {
  background-color: hsl(var(--primary) / 0.2);
}

.card-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  color: hsl(var(--primary));
}

/* ==================
   BADGES
   ================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius);
  white-space: nowrap;
}

.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-outline {
  background-color: hsl(var(--primary) / 0.05);
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--primary) / 0.3);
}

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

/* ==================
   INPUTS
   ================== */
.input {
  display: flex;
  width: 100%;
  height: 2.75rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

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

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

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

/* Textarea */
.textarea {
  min-height: 6rem;
  resize: vertical;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* Select */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

/* Form Group */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.form-error {
  font-size: 0.75rem;
  color: hsl(var(--destructive));
  margin-top: 0.25rem;
}

/* ==================
   ACCORDION
   ================== */
.accordion {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid hsl(var(--border));
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.accordion-trigger:hover {
  background-color: hsl(var(--muted) / 0.5);
}

.accordion-trigger svg {
  width: 1.25rem;
  height: 1.25rem;
  color: hsl(var(--muted-foreground));
  transition: transform 0.2s ease;
}

.accordion-item.open .accordion-trigger svg {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-content-inner {
  padding: 0 1.25rem 1rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.7;
}

/* ==================
   TABS
   ================== */
.tabs {
  display: flex;
  flex-direction: column;
}

.tabs-list {
  display: flex;
  background-color: hsl(var(--muted));
  border-radius: var(--radius);
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.tab-trigger {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: all 0.2s ease;
  color: hsl(var(--muted-foreground));
}

.tab-trigger:hover {
  color: hsl(var(--foreground));
}

.tab-trigger.active {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fade-in 0.3s ease;
}

/* ==================
   TOGGLE SWITCH
   ================== */
.switch-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.switch-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
}

.switch-label.active {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.switch {
  position: relative;
  width: 3rem;
  height: 1.625rem;
  background-color: hsl(var(--muted));
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.switch.active {
  background-color: hsl(var(--primary));
}

.switch-thumb {
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.375rem;
  height: 1.375rem;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.switch.active .switch-thumb {
  transform: translateX(1.375rem);
}

/* Hidden checkbox for switch */
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* ==================
   MODAL
   ================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: hsl(var(--card));
  border-radius: var(--radius-xl);
  max-width: 32rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  transition: all 0.2s ease;
}

.modal-close:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
}

/* ==================
   TOAST
   ================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slide-in-right 0.3s ease;
  min-width: 300px;
}

.toast-success {
  border-left: 4px solid #22c55e;
}

.toast-error {
  border-left: 4px solid hsl(var(--destructive));
}

.toast-info {
  border-left: 4px solid #3b82f6;
}

.toast-message {
  flex: 1;
  font-size: 0.875rem;
}

.toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  padding: 0.25rem;
}

/* ==================
   SPINNER
   ================== */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid hsl(var(--muted));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 1rem;
  height: 1rem;
}

.spinner-lg {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}
