/**
 * SecondScent Base Components
 * Beautiful, reusable component styles
 */

/* ===================================
   BUTTONS
==================================== */

/* Base button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: var(--font-medium);
  text-align: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  user-select: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

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

/* Button sizes */
.btn-xs {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
  min-height: 32px;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  min-height: 36px;
}

.btn {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
  min-height: 44px;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
  min-height: 52px;
}

/* Primary button - Gradient with glow */
.btn-primary {
  background: #FFB44C;
  color: #000000;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: #e69a2e;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
}

.btn-primary:active {
  background: #FFB44C;
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Secondary button - Outline */
.btn-secondary {
  background: transparent;
  color: var(--primary-600);
  border: 2px solid var(--primary-600);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--primary-600);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--gray-700);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

/* Danger button */
.btn-danger {
  background: var(--error);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-danger:hover {
  background: var(--error-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Success button */
.btn-success {
  background: var(--success);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-success:hover {
  background: var(--success-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Icon button - Circular */
.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-circle);
}

.btn-icon.btn-sm {
  width: 36px;
  height: 36px;
}

.btn-icon.btn-lg {
  width: 52px;
  height: 52px;
}

/* Button with icon */
.btn .icon {
  margin-right: var(--space-2);
}

.btn .icon-right {
  margin-left: var(--space-2);
  margin-right: 0;
}

/* Pill button */
.btn-pill {
  border-radius: var(--radius-pill);
}

/* ===================================
   INPUTS & FORMS
==================================== */

/* Remove default browser outline for all form inputs */
input,
textarea,
select,
button {
  outline: none !important;
}

input:focus,
textarea:focus,
select:focus,
button:focus {
  outline: none !important;
}

/* Remove focus-visible outline */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: none !important;
}

/* Base input styles */
.input,
.textarea,
.select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--gray-900);
  background-color: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  outline: none !important;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(255, 180, 76, 0.1) !important;
  outline: none !important;
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  background-color: var(--gray-100);
  cursor: not-allowed;
  opacity: 0.6;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--gray-400);
}

/* Input sizes */
.input-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.input-lg {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

/* Textarea */
.textarea {
  resize: vertical;
  min-height: 100px;
}

/* Input with icon */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .input {
  padding-left: var(--space-12);
}

.input-group .input-icon {
  position: absolute;
  left: var(--space-4);
  color: var(--gray-400);
  pointer-events: none;
}

.input-group .input:focus ~ .input-icon {
  color: var(--primary-500);
}

/* Floating label */
.input-floating {
  position: relative;
  margin-top: var(--space-5);
}

.input-floating .input {
  padding-top: var(--space-5);
  padding-bottom: var(--space-2);
}

.input-floating .label-floating {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-base);
  color: var(--gray-400);
  pointer-events: none;
  transition: all var(--transition-base);
}

.input-floating .input:focus ~ .label-floating,
.input-floating .input:not(:placeholder-shown) ~ .label-floating {
  top: var(--space-2);
  transform: translateY(0);
  font-size: var(--text-xs);
  color: var(--primary-500);
}

/* Label */
.label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-700);
}

/* Error state */
.input-error,
.input-error:focus {
  border-color: var(--error);
  outline: none !important;
}

.input-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
  outline: none !important;
}

.error-message {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--error);
}

/* Success state */
.input-success,
.input-success:focus {
  border-color: var(--success);
  outline: none !important;
}

.input-success:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
  outline: none !important;
}

/* ===================================
   CHECKBOXES & RADIO BUTTONS
==================================== */

/* Custom checkbox */
.checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkbox .checkbox-mark {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: white;
  transition: all var(--transition-base);
  margin-right: var(--space-3);
}

.checkbox input[type="checkbox"]:checked ~ .checkbox-mark {
  background: var(--primary-600);
  border-color: var(--primary-600);
}

.checkbox input[type="checkbox"]:checked ~ .checkbox-mark::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox:hover .checkbox-mark {
  border-color: var(--primary-500);
}

/* Custom radio */
.radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.radio .radio-mark {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-circle);
  background: white;
  transition: all var(--transition-base);
  margin-right: var(--space-3);
}

.radio input[type="radio"]:checked ~ .radio-mark {
  border-color: var(--primary-600);
}

.radio input[type="radio"]:checked ~ .radio-mark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: var(--radius-circle);
  background: var(--primary-600);
}

/* ===================================
   CARDS
==================================== */

/* Base card */
.card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Card with glass-morphism */
.card-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  box-shadow: var(--glass-shadow);
}

/* Card variations */
.card-flat {
  box-shadow: none;
  border: 1px solid var(--gray-200);
}

.card-elevated {
  box-shadow: var(--shadow-xl);
}

/* Card sections */
.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-100);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* ===================================
   BADGES & TAGS
==================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge-primary {
  background: var(--primary-100);
  color: var(--primary-700);
}

.badge-success {
  background: var(--success-light);
  color: var(--success-dark);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning-dark);
}

.badge-error {
  background: var(--error-light);
  color: var(--error-dark);
}

.badge-info {
  background: var(--info-light);
  color: var(--info-dark);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* ===================================
   AVATARS
==================================== */

.avatar {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-circle);
  overflow: hidden;
  background: var(--gray-200);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-lg {
  width: 56px;
  height: 56px;
}

.avatar-xl {
  width: 72px;
  height: 72px;
}

/* Avatar with status indicator */
.avatar .status-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-circle);
  border: 2px solid white;
}

.avatar .status-online {
  background: var(--success);
}

.avatar .status-offline {
  background: var(--gray-400);
}

/* ===================================
   LOADING STATES
==================================== */

/* Spinner */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 180, 76, 0.2);
  border-top-color: var(--primary-600);
  border-radius: var(--radius-circle);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 4px;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-200) 0%,
    var(--gray-100) 50%,
    var(--gray-200) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 16px;
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 24px;
  margin-bottom: var(--space-3);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-circle);
}

.skeleton-card {
  height: 200px;
}

/* ===================================
   UTILITIES
==================================== */

/* Glass effect */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  box-shadow: var(--glass-shadow);
}

/* Gradient text */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Gradient background */
.bg-gradient-primary {
  background: var(--gradient-primary);
}

.bg-gradient-secondary {
  background: var(--gradient-secondary);
}

.bg-gradient-luxury {
  background: var(--gradient-luxury);
}

/* Hover lift effect */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Smooth transitions */
.transition-all {
  transition: all var(--transition-base);
}

.transition-fast {
  transition: all var(--transition-fast);
}

.transition-slow {
  transition: all var(--transition-slow);
}

