/* Reusable Components for All Systems Go Furniture Website */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--btn-padding-y) var(--btn-padding-x);
  font-size: var(--btn-font-size);
  font-weight: var(--font-semibold);
  line-height: var(--btn-line-height);
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

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

.btn-primary {
  background: var(--color-primary-600);
  color: white;
  border-color: var(--color-primary-600);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary-600);
  border-color: var(--color-primary-600);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  border-color: var(--color-primary-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--font-medium);
  color: var(--color-neutral-700);
}

.form-control {
  width: 100%;
  padding: var(--input-padding-y) var(--input-padding-x);
  font-size: var(--input-font-size);
  line-height: var(--input-line-height);
  color: var(--color-neutral-900);
  background: white;
  border: 2px solid var(--color-neutral-300);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
  color: var(--color-neutral-400);
}

.form-control.error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control:disabled {
  background: var(--color-neutral-100);
  color: var(--color-neutral-500);
  cursor: not-allowed;
}

/* Textarea */
textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Select */
select.form-control {
  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 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right var(--input-padding-x) center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: calc(var(--input-padding-x) + 2.5em);
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.checkbox-input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--color-primary-600);
  border-radius: var(--radius-sm);
}

.checkbox-label {
  font-weight: var(--font-normal);
  color: var(--color-neutral-600);
  line-height: var(--leading-relaxed);
  cursor: pointer;
}

/* Error Messages */
.error-message {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-error);
  font-weight: var(--font-medium);
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--space-8);
}

/* Cards */
.card {
  background: white;
  border-radius: var(--card-border-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding: var(--card-padding);
  border-bottom: 1px solid var(--color-neutral-200);
}

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

.card-footer {
  padding: var(--card-padding);
  border-top: 1px solid var(--color-neutral-200);
  background: var(--color-neutral-50);
}

/* Service Cards */
.service-detail-card {
  margin-bottom: var(--space-12);
}

.service-detail-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: start;
}

.service-detail-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.service-detail-image img {
  width: 100%;
  height: auto;
  display: block;
}

.service-detail-content h2 {
  color: var(--color-primary-700);
  margin-bottom: var(--space-4);
}

.service-detail-content .pricing {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-secondary-600);
  margin-bottom: var(--space-6);
}

.service-features {
  margin-bottom: var(--space-8);
}

.service-features h3 {
  margin-bottom: var(--space-4);
  color: var(--color-neutral-800);
}

.service-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}

.service-features li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.service-features li::before {
  content: '✓';
  color: var(--color-secondary-600);
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
}

.service-ideal-for {
  background: var(--color-primary-50);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-primary-500);
  margin-bottom: var(--space-8);
}

.service-ideal-for h3 {
  color: var(--color-primary-700);
  margin-bottom: var(--space-2);
}

/* Contact Form Card */
.contact-form-card {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form-card .card-body {
  padding: var(--space-8);
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--color-neutral-300);
  border-top: 2px solid var(--color-primary-600);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Success States */
.success-message {
  padding: var(--space-4);
  background: var(--color-secondary-50);
  border: 1px solid var(--color-secondary-200);
  border-radius: var(--radius-md);
  color: var(--color-secondary-800);
  margin-bottom: var(--space-4);
}

.success-message::before {
  content: '✓';
  color: var(--color-secondary-600);
  font-weight: var(--font-bold);
  margin-right: var(--space-2);
}

/* Modal (for future use) */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform var(--transition-base);
}

.modal.open .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-neutral-200);
}

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

.modal-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--color-neutral-200);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-primary { color: var(--color-primary-600); }
.text-secondary { color: var(--color-secondary-600); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }

.bg-primary { background: var(--color-primary-500); color: white; }
.bg-secondary { background: var(--color-secondary-500); color: white; }
.bg-light { background: var(--color-neutral-100); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.d-flex { display: flex; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-none { display: none; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }

.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.m-0 { margin: 0; }
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.mr-4 { margin-right: var(--space-4); }
.ml-4 { margin-left: var(--space-4); }

.p-4 { padding: var(--space-4); }
.pt-4 { padding-top: var(--space-4); }
.pb-4 { padding-bottom: var(--space-4); }
.pr-4 { padding-right: var(--space-4); }
.pl-4 { padding-left: var(--space-4); }

/* Responsive utilities */
@media (min-width: 48em) {
  .md\:d-flex { display: flex; }
  .md\:d-none { display: none; }
  .md\:flex-row { flex-direction: row; }
  .md\:justify-between { justify-content: space-between; }
}

@media (min-width: 64em) {
  .lg\:d-flex { display: flex; }
  .lg\:d-none { display: none; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}