/**
 * CTA Optimization System - Bay Area Golf
 *
 * Based on Booking.com/Expedia conversion best practices:
 * - Large touch targets (min 48px for mobile per Google Material Design)
 * - Clear visual hierarchy between primary, secondary, tertiary actions
 * - Comprehensive button states (hover, active, focus, disabled, loading)
 * - Subtle urgency without being pushy
 * - Trust signals and social proof integration
 *
 * Sources:
 * - https://ralabs.org/blog/booking-ux-best-practices/
 * - https://vwo.com/blog/increase-travel-website-bookings/
 * - https://www.designstudiouiux.com/blog/cta-button-design-best-practices/
 */

/* ===========================================
   PRIMARY CTA - BOOK NOW
   Maximum prominence for conversion
   =========================================== */

.btn-primary {
  /* Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  /* Sizing - Large touch target */
  padding: 18px 36px;
  min-height: 58px;
  min-width: 180px;

  /* Typography */
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-transform: none;
  color: #FFFFFF;

  /* Visual - 3-stop gradient for depth */
  background: linear-gradient(180deg, #10B981 0%, #059669 50%, #047857 100%);
  border: none;
  border-radius: 10px;

  /* Elevation - Multi-layer shadow */
  box-shadow:
    0 4px 14px rgba(16, 185, 129, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);

  /* Interaction */
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.15s ease-out;

  /* Touch optimization */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Shimmer effect on hover - Booking.com style */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

/* Hover - Brighten and elevate */
.btn-primary:hover {
  background: linear-gradient(180deg, #34D399 0%, #10B981 50%, #059669 100%);
  transform: translateY(-3px);
  box-shadow:
    0 8px 25px rgba(16, 185, 129, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Active/Pressed - Immediate feedback */
.btn-primary:active {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #059669 0%, #047857 50%, #065F46 100%);
  box-shadow:
    0 3px 12px rgba(16, 185, 129, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Focus - Accessibility */
.btn-primary:focus-visible {
  outline: none;
  box-shadow:
    0 4px 14px rgba(16, 185, 129, 0.35),
    0 0 0 4px rgba(16, 185, 129, 0.25);
}

/* Disabled - Clear unavailability */
.btn-primary:disabled,
.btn-primary.btn-disabled {
  background: linear-gradient(180deg, #9CA3AF 0%, #6B7280 100%);
  color: rgba(255, 255, 255, 0.7);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

.btn-primary:disabled::before {
  display: none;
}

/* Loading state */
.btn-primary.btn-loading {
  cursor: wait;
  pointer-events: none;
}

.btn-primary.btn-loading .btn-text {
  opacity: 0;
}

.btn-primary.btn-loading::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

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

/* ===========================================
   SECONDARY CTA - CALL TO BOOK
   Supporting action, clear but subdued
   =========================================== */

.btn-secondary {
  /* Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  /* Sizing */
  padding: 15px 28px;
  min-height: 54px;

  /* Typography */
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--primary);

  /* Visual - Ghost button style */
  background: #FFFFFF;
  border: 2px solid var(--primary);
  border-radius: 10px;

  /* Interaction */
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.15s ease-out;

  /* Touch optimization */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-secondary:hover {
  background: rgba(45, 90, 39, 0.08);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 90, 39, 0.12);
}

.btn-secondary:active {
  background: rgba(45, 90, 39, 0.15);
  transform: translateY(0);
  box-shadow: none;
}

.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.2);
}

.btn-secondary:disabled,
.btn-secondary.btn-disabled {
  color: #9CA3AF;
  border-color: #D1D5DB;
  background: #F9FAFB;
  cursor: not-allowed;
  transform: none;
}

/* ===========================================
   TERTIARY CTA - WEBSITE/INFO LINKS
   Lowest priority, link-style
   =========================================== */

.btn-tertiary {
  /* Layout */
  display: inline-flex;
  align-items: center;
  gap: 6px;

  /* Sizing */
  padding: 10px 16px;

  /* Typography */
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);

  /* Visual */
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;

  /* Interaction */
  cursor: pointer;
  transition: all 0.15s ease-out;
  user-select: none;
}

.btn-tertiary:hover {
  background: var(--bg-paper);
  border-color: var(--border-light);
  color: var(--text);
}

.btn-tertiary:active {
  background: var(--bg);
}

.btn-tertiary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(45, 90, 39, 0.15);
}

.btn-tertiary svg {
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.btn-tertiary:hover svg {
  opacity: 1;
}

/* ===========================================
   URGENCY INDICATORS
   Booking.com-style scarcity without being pushy
   =========================================== */

/* Availability indicator - subtle urgency */
.availability-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #059669;
  font-weight: 500;
}

.availability-indicator--limited {
  background: #FEF3C7;
  color: #D97706;
}

.availability-indicator--few {
  background: #FEE2E2;
  color: #DC2626;
}

.availability-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.availability-indicator--few .dot {
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* Recent booking activity - social proof */
.booking-activity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-paper);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.booking-activity svg {
  width: 16px;
  height: 16px;
  color: #059669;
}

.booking-activity strong {
  color: var(--text);
  font-weight: 600;
}

/* ===========================================
   TRUST BADGES - ENHANCED
   Booking confidence signals
   =========================================== */

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  justify-content: center;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #374151;
  transition: all 0.15s ease;
}

.trust-badge:hover {
  background: #F3F4F6;
  border-color: #D1D5DB;
}

.trust-badge svg {
  width: 16px;
  height: 16px;
  color: #059669;
  flex-shrink: 0;
}

.trust-badge--verified {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #059669;
}

.trust-badge--secure {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}

.trust-badge--secure svg {
  color: #3B82F6;
}

/* ===========================================
   STICKY CTA BAR - MOBILE OPTIMIZED
   Always visible booking option
   =========================================== */

.sticky-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #FFFFFF;
  border-top: 1px solid #E5E7EB;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  padding: 12px 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1);
}

.sticky-cta-bar--visible {
  transform: translateY(0);
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .sticky-cta-bar {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 768px) {
  .sticky-cta-bar {
    display: flex;
  }
}

.sticky-cta-price {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sticky-cta-price-label {
  font-size: 0.75rem;
  color: #6B7280;
}

.sticky-cta-price-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sticky-cta-price-current {
  font-family: 'DM Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
}

.sticky-cta-price-original {
  font-size: 0.9rem;
  color: #9CA3AF;
  text-decoration: line-through;
}

.sticky-cta-button {
  flex: 1;
  max-width: 180px;
  padding: 14px 24px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  background: linear-gradient(180deg, #10B981 0%, #059669 50%, #047857 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sticky-cta-button:hover {
  background: linear-gradient(180deg, #34D399 0%, #10B981 50%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.sticky-cta-button:active {
  transform: translateY(0);
}

/* ===========================================
   TEE TIME SLOT BOOK BUTTON
   Inline booking in time slots
   =========================================== */

.tee-time-book {
  padding: 10px 18px;
  background: linear-gradient(180deg, #10B981 0%, #059669 50%, #047857 100%);
  color: #fff;
  border-radius: 8px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: all 0.15s ease-out;
  -webkit-tap-highlight-color: transparent;
}

.tee-time-book:hover {
  background: linear-gradient(180deg, #34D399 0%, #10B981 50%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.tee-time-book:active {
  transform: translateY(0);
}

.tee-time-slot:hover .tee-time-book {
  background: linear-gradient(180deg, #34D399 0%, #10B981 50%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ===========================================
   CTA CONTAINER - ACTION HIERARCHY
   Proper visual grouping
   =========================================== */

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-buttons.action-buttons--centered {
  justify-content: center;
}

.action-buttons.action-buttons--stacked {
  flex-direction: column;
  align-items: stretch;
}

/* Ensure primary button always stands out */
.action-buttons .btn-primary {
  flex-shrink: 0;
}

/* Secondary actions group */
.secondary-actions {
  margin-top: 16px;
}

.secondary-actions .btn-tertiary {
  margin-right: 8px;
}

/* ===========================================
   RIPPLE EFFECT
   Material-inspired touch feedback
   =========================================== */

.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple--dark {
  background: rgba(0, 0, 0, 0.1);
}

/* ===========================================
   MOBILE OPTIMIZATIONS
   =========================================== */

@media (max-width: 600px) {
  .action-buttons {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .btn-primary {
    padding: 16px 24px;
    font-size: 1.1rem;
  }

  .btn-secondary {
    padding: 14px 20px;
  }
}

/* ===========================================
   REDUCED MOTION
   Accessibility preference
   =========================================== */

@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .btn-secondary,
  .btn-tertiary,
  .sticky-cta-button,
  .tee-time-book {
    transition: none;
  }

  .btn-primary::before {
    display: none;
  }

  .availability-indicator--few .dot {
    animation: none;
  }

  .btn-primary.btn-loading::after {
    animation: none;
  }
}
