/* ========================================
   SHARED PAGE COMPONENTS
   Reusable components across all pages
   ======================================== */

/* ========================================
   WARM PALETTE OVERRIDES
   Align dashboard pages with the index page
   earthy/warm design language
   ======================================== */
:root {
  /* ---- Brand: dark gold (matching index) ---- */
  --color-primary:       #B8860B;
  --color-primary-light:  #D4A849;
  --color-primary-dark:   #8B6914;
  --color-primary-50:     rgba(184, 134, 11, 0.10);
  --color-primary-100:    rgba(184, 134, 11, 0.20);

  /* ---- Warm neutrals (replacing cold Tailwind grays) ---- */
  --color-gray-50:   #FAF7F2;
  --color-gray-100:  #F5EFE6;
  --color-gray-200:  #E8DDD0;
  --color-gray-300:  #D4C8B8;
  --color-gray-400:  #B5A89A;
  --color-gray-500:  #8A7B6B;
  --color-gray-600:  #5C4A3A;
  --color-gray-700:  #4A3A2C;
  --color-gray-800:  #3D2B1F;
  --color-gray-900:  #2D2018;

  /* ---- Warm shadows ---- */
  --shadow-sm:  0 1px 3px rgba(61, 43, 31, 0.06);
  --shadow-md:  0 4px 12px rgba(61, 43, 31, 0.08);
  --shadow-lg:  0 12px 40px rgba(61, 43, 31, 0.10);
  --shadow-xl:  0 20px 50px rgba(61, 43, 31, 0.12);
  --shadow-glow: 0 0 24px rgba(184, 134, 11, 0.25);

  /* ---- Warm background surfaces ---- */
  --surface-elevated: #FFFFFF;

  /* Stripe-specific colors */
  --color-stripe-blue: #0570de;
  --color-stripe-blue-dark: #0452a8;
  --color-stripe-blue-light: #1a85ff;

  /* Checkout-specific colors */
  --checkout-bg: #f6f9fc;
  --checkout-summary-bg: linear-gradient(to bottom, #1a1f36, #0a2540);
  --checkout-summary-dark: #0a2540;
  --checkout-summary-light: #1a1f36;

  /* Extended semantic colors */
  --color-success-light: #4ade80;
  --color-warning-light: #fbbf24;
  --color-error-light: #f87171;
  --color-info-light: #60a5fa;
}

/* ---- Warm body background ---- */
body {
  background-color: #FAF7F2;
  color: #3D2B1F;
}

html {
  background-color: #FAF7F2;
}

/* ---- Header: warm tint ---- */
.header {
  background-color: #FAF7F2;
  border-bottom-color: #E8DDD0;
  box-shadow: 0 1px 8px rgba(61, 43, 31, 0.05);
}

.header.scrolled {
  background-color: rgba(250, 247, 242, 0.97);
  box-shadow: 0 2px 12px rgba(61, 43, 31, 0.08);
}

/* ---- Cards/tables: warmer borders ---- */
.product-card,
.dashboard-stat-card,
.stat-card,
.recent-orders-table-wrapper {
  border-color: #E8DDD0;
}

.product-card:hover {
  border-color: #D4C8B8;
}

/* ---- Table header row: warm tint ---- */
.orders-table th {
  background-color: #FAF7F2;
  border-bottom-color: #E8DDD0;
  color: #8A7B6B;
}

.orders-table td {
  border-bottom-color: #F5EFE6;
}

.orders-table tr:hover td {
  background-color: #FAF7F2;
}

/* ---- Primary button: dark gold ---- */
.btn-primary {
  background: #B8860B;
  border-color: #B8860B;
}

.btn-primary:hover:not(:disabled) {
  background: #8B6914;
  border-color: #8B6914;
  box-shadow: 0 3px 10px rgba(184, 134, 11, 0.3);
}

/* ---- Outline button: dark gold ---- */
.btn-outline {
  color: #B8860B;
  border-color: #B8860B;
}

.btn-outline:hover:not(:disabled) {
  background: rgba(184, 134, 11, 0.07);
}

/* ---- Secondary button: warm border ---- */
.btn-secondary {
  border-color: #E8DDD0;
  color: #4A3A2C;
}

.btn-secondary:hover:not(:disabled) {
  background: #FAF7F2;
  border-color: #D4C8B8;
}

/* ---- Empty state: warm background ---- */
.empty-state {
  background-color: #F5EFE6;
}

/* ---- Heading colors ---- */
h1, h2, h3, h4, h5, h6 {
  color: #3D2B1F;
}

/* ---- Form inputs: warm borders ---- */
.form-input,
.form-textarea,
.form-select {
  color: #3D2B1F;
  border-color: #E8DDD0;
}

.form-input:hover:not(:focus):not(:disabled),
.form-textarea:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
  border-color: #D4C8B8;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: #B8860B;
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #B5A89A;
}

/* ---- Table wrapper: warm border ---- */
.table-wrapper {
  border-color: #E8DDD0;
}

/* ========================================
   INFO TOOLTIP
   ======================================== */
.info-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background-color: var(--color-gray-200);
  color: var(--color-gray-600);
  font-size: 12px;
  cursor: help;
  margin-left: var(--space-1);
}

.info-tooltip:hover {
  background-color: var(--color-gray-300);
  color: var(--color-gray-700);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   FADE-IN ANIMATION
   Scroll-triggered reveal (applied by main.js)
   ======================================== */
.fade-in-element {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-element.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   UTILITY CLASSES
   Common inline style replacements
   ======================================== */

/* Display utilities */
.d-none { display: none !important; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Flex utilities */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Grid layouts */
.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.grid-1-1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Spacing utilities */
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: 8px; }
.pt-6 { padding-top: 24px; }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* Border utilities */
.border-top { border-top: 1px solid var(--color-gray-200); }

/* Section divider */
.section-divider {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-gray-200);
}

.section-divider h3 {
  margin-bottom: 16px;
}

.section-divider .section-description {
  margin-bottom: 16px;
  font-size: var(--text-sm);
  color: var(--color-gray-600);
}

/* ========================================
   RECENT ORDERS (Dashboard)
   ======================================== */
.recent-orders {
  margin-bottom: var(--space-8);
}

.recent-orders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.recent-orders-header h2 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin: 0;
}

.recent-orders-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  background: var(--color-white);
}

/* Orders Table Styles (shared between dashboard and orders page) */
.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-gray-200);
  background-color: var(--color-gray-50);
}

.orders-table td {
  padding: 12px 16px;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-gray-100);
}

.orders-table tr:last-child td {
  border-bottom: none;
}

.orders-table tr:hover td {
  background-color: var(--color-gray-50);
}

/* Table cell modifiers */
.orders-table td strong {
  font-weight: var(--font-semibold);
}

/* No data message */
.table-empty-message {
  text-align: center;
  padding: 2rem;
  color: var(--color-gray-500);
}

.table-error-message {
  text-align: center;
  padding: 2rem;
  color: var(--color-error);
}

/* Info list */
.info-list {
  list-style: disc;
  padding-left: 1.25rem;
  line-height: 1.8;
}

/* Disc list (common marketing pages) */
.disc-list {
  list-style: disc;
  margin-left: 1.5rem;
  color: var(--color-gray-700);
  line-height: 1.8;
}

/* Image placeholder box */
.img-placeholder {
  background: var(--color-gray-100);
  border-radius: var(--radius-xl);
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-500);
}
.img-placeholder--sm {
  height: 300px;
}

/* Center a block element (replaces margin: 0 auto inline) */
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Badge spacing (use-case heroes) */
.badge-spaced {
  margin-bottom: var(--space-4);
}

/* Testimonial centered variant */
.testimonial--centered {
  padding: 56px 48px;
  text-align: center;
}

.testimonial--centered::before {
  left: 50%;
  transform: translateX(-50%);
  top: 20px;
  font-size: 80px;
  opacity: 0.2;
}

.testimonial--centered .testimonial-quote {
  font-size: 22px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.testimonial--centered .testimonial-author {
  justify-content: center;
  margin-top: 32px;
}

.testimonial--centered .testimonial-author-name {
  font-size: 17px;
}

.testimonial--centered .testimonial-author-title {
  font-size: 14px;
}

@media (max-width: 768px) {
  .testimonial--centered {
    padding: 40px 24px;
  }
  .testimonial--centered .testimonial-quote {
    font-size: 18px;
  }
}

/* Dark section stats (white text on dark bg) */
.stat-value--light {
  color: white;
}
.stat-label--light {
  color: var(--color-gray-200);
}

/* Inverted CTA button (white on dark bg) */
.btn--inverted {
  background: white;
  color: var(--color-primary);
}

/* Light outline button (on dark bg) */
.btn-outline--light {
  color: white;
  border-color: white;
}

/* Centered feature card icon */
.feature-card-icon--centered {
  margin: 0 auto 1rem;
}

/* Terms acknowledgment footer */
.terms-acknowledgment {
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-gray-200);
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
}

/* ========================================
   HEADER USER NAV
   Right-side header actions on app pages
   ======================================== */
.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.header-user span {
  font-size: var(--text-sm);
  color: var(--color-gray-600);
}

/* ========================================
   EXTENDED UTILITY CLASSES
   ======================================== */

/* Layout */
.py-24 { padding-top: 96px; padding-bottom: 96px; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; min-width: 0; }
.w-full { width: 100%; }
.gap-2 { gap: 8px; }

/* Spacing */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-6 { margin-top: 24px; }
.mb-3 { margin-bottom: 12px; }

/* Typography */
.text-xs { font-size: var(--text-xs); }
.text-gray-500 { color: var(--color-gray-500); }
.text-gray-600 { color: var(--color-gray-600); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Backgrounds & surfaces */
.bg-gray-50 { background-color: var(--color-gray-50); }

/* Shapes */
.p-2 { padding: 8px; }
.rounded-lg { border-radius: var(--radius-lg); }

/* ========================================
   LOADING STATE
   Shared spinner + loading indicator
   ======================================== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
  color: var(--color-gray-500);
  gap: var(--space-4);
}

.loading-state .spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-gray-200);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========================================
   EMPTY STATE
   No-data placeholder for lists/tables
   ======================================== */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  background-color: var(--color-gray-50);
  border-radius: var(--radius-xl);
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--color-gray-900);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  color: var(--color-gray-500);
  margin-bottom: var(--space-6);
}

/* ========================================
   STATUS BADGES
   Reusable status indicator pills
   ======================================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: currentColor;
}

.status-active,
.status-completed,
.status-succeeded {
  background-color: var(--color-success-bg);
  color: var(--color-success-dark);
}

.status-draft,
.status-refunded {
  background-color: var(--color-gray-100);
  color: var(--color-gray-600);
}

.status-inactive {
  background-color: var(--color-warning-bg);
  color: var(--color-warning-dark);
}

.status-pending {
  background-color: var(--color-info-bg);
  color: var(--color-info-dark);
}

.status-cancelled,
.status-failed {
  background-color: var(--color-error-bg);
  color: var(--color-error-dark);
}

.status-processing {
  background-color: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
}

/* ========================================
   PAGE HERO
   Common hero styling for marketing pages
   ======================================== */
.contact-hero,
.category-hero,
.inspiration-hero,
.pricing-hero,
.resources-hero {
  padding: 140px 0 80px;
  text-align: center;
  background: var(--bg-warm);
}

.contact-hero h1,
.category-hero h1,
.inspiration-hero h1,
.pricing-hero h1,
.resources-hero h1 {
  font-size: 52px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.contact-hero p,
.category-hero p,
.inspiration-hero p,
.pricing-hero p,
.resources-hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 24px;
}

/* ========================================
   HERO ACTIONS
   Button row in hero sections
   ======================================== */
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   SECTION ALT
   Alternating section backgrounds
   ======================================== */
.section-alt,
.inspiration-section-alt,
.pricing-section-alt,
.resources-section-alt {
  background: var(--bg-white);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

/* ========================================
   CARD (warm theme)
   Common card for marketing pages
   ======================================== */
.dark-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 28px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.dark-card h4 {
  color: var(--text-dark);
  font-size: 18px;
  margin-bottom: 10px;
}

.dark-card p {
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.6;
}

/* ========================================
   FORM INPUT (warm theme)
   Form inputs on marketing pages
   ======================================== */
.dark-form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-cream);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-dark);
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dark-form-input::placeholder {
  color: #B5A89A;
}

.dark-form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

/* ========================================
   DIVIDER TEXT
   Horizontal divider with centered text
   ======================================== */
.divider-text,
.checkout-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--color-gray-500);
  font-size: var(--text-sm);
}

.divider-text::before,
.divider-text::after,
.checkout-divider::before,
.checkout-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--color-gray-200);
}
