/* === FLOATING SCHEDULE CTA === */
/* Aesthetic: Matches site's design language — stone neutrals, sharp corners, clean typography */
/* Uses Cal.com embed with custom CSS variables for native feel */

/* Inherit primary color from each section */
:root {
  --cta-accent: var(--emerald, #059669);
}

/* Section-specific accent overrides */
body.work-section { --cta-accent: var(--navy, #1e40af); }
body.work-email { --cta-accent: var(--signal-cyan, #22d3ee); }
body.work-sms { --cta-accent: var(--navy-light, #3b82f6); }
body.work-websites { --cta-accent: var(--gold, #ca8a04); }
body.work-nationbuilder { --cta-accent: var(--nb-primary, #60BAD5); }
body.work-political { --cta-accent: var(--navy, #1e40af); }
body.work-freelance { --cta-accent: var(--navy-light, #3b82f6); }
body.work-ai { --cta-accent: var(--violet, #7c3aed); }
body.connect-section { --cta-accent: var(--emerald, #059669); }
body.home-section { --cta-accent: var(--crimson, #dc2626); }

/* ========================================
   FLOATING BUTTON
   ======================================== */

.schedule-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(100px);
  transition: opacity 0.2s ease, transform 0.5s ease;
  --scroll-opacity: 1;
}

.schedule-cta[aria-hidden="false"] {
  opacity: calc(1 * var(--scroll-opacity, 1));
  transform: translateY(0);
  pointer-events: auto;
}

/* Card button - matches site's card aesthetic */
.schedule-cta__card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0; /* Sharp corners */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: left;
  min-width: 280px;
  max-width: 320px;
  font-family: var(--font-sans);
  transition: all 0.3s ease;
}

.schedule-cta__card:hover,
a.schedule-cta__card:hover {
  background: var(--bg-secondary);
  border-color: var(--text-tertiary);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  text-decoration: none !important;
}

/* Accent bar */
.schedule-cta__accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--cta-accent);
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Content wrapper */
.schedule-cta__content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  min-width: 0;
}

/* Status marker */
.schedule-cta__marker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 2px;
}

.schedule-cta__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.3);
  padding: 3px 8px;
  border-radius: 0; /* Sharp corners */
  transition: all 0.3s ease;
}

.schedule-cta__status-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.schedule-cta__card:hover .schedule-cta__label {
  background: rgba(5, 150, 105, 0.15);
  border-color: rgba(5, 150, 105, 0.4);
  color: #047857;
}

.schedule-cta__card:hover .schedule-cta__status-dot {
  opacity: 1;
}

/* Text content */
.schedule-cta__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.schedule-cta__headline {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.schedule-cta__subline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Arrow */
.schedule-cta__arrow {
  font-size: 1.25rem;
  color: var(--text-tertiary);
  align-self: center;
  flex-shrink: 0;
  transition: color 0.3s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
}

.schedule-cta__card:hover .schedule-cta__arrow {
  color: var(--cta-accent);
  transform: translateX(3px);
}

/* ========================================
   MODAL
   ======================================== */

.schedule-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: var(--spacing-lg);
}

.schedule-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

/* Overlay - subtle blur like site aesthetic */
.schedule-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(28, 25, 23, 0.72); /* Stone-900 based */
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  transition: background 0.4s ease;
}

.schedule-modal[aria-hidden="false"] .schedule-modal__overlay {
  background: rgba(28, 25, 23, 0.78);
}

/* Container - matches site's card/panel aesthetic */
.schedule-modal__container {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0; /* Sharp corners */
  width: 90vw;
  max-width: 900px;
  height: 85vh;
  max-height: 800px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.24),
              0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(20px);
  opacity: 0;
  transition: opacity 0.3s ease,
              transform 0.3s ease;
  overflow: hidden;
}

.schedule-modal[aria-hidden="false"] .schedule-modal__container {
  transform: translateY(0);
  opacity: 1;
}

/* Modal header - adds context like site's section headers */
.schedule-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.schedule-modal__title {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.schedule-modal__title-icon {
  width: 18px;
  height: 18px;
  color: var(--cta-accent);
}

/* Close button - matches site's button aesthetic */
.schedule-modal__close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 0; /* Sharp corners */
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  padding: 0;
  flex-shrink: 0;
}

.schedule-modal__close:hover {
  border-color: var(--cta-accent);
  background: var(--cta-accent);
  color: white;
}

.schedule-modal__close svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* Embed container */
.schedule-modal__embed {
  flex: 1;
  width: 100%;
  min-height: 0;
  position: relative;
  background: var(--bg-primary);
  overflow: hidden;
}

/* Loading state */
.schedule-modal__embed.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 2px solid var(--border-color);
  border-top-color: var(--cta-accent);
  border-radius: 50%;
  animation: schedule-spin 0.8s linear infinite;
}

.schedule-modal__embed.loading::after {
  content: 'Loading...';
  position: absolute;
  top: calc(50% + 36px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@keyframes schedule-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Error state */
.schedule-modal__error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: var(--spacing-xl);
}

.schedule-modal__error p {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
}

.schedule-modal__error .cta-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: 2px solid var(--text-primary);
  padding: 10px 20px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.schedule-modal__error .cta-link:hover {
  background: var(--cta-accent);
  border-color: var(--cta-accent);
  color: white;
}

/* Cal.com embed container - style the Cal iframe container */
.schedule-modal__embed > div,
.schedule-modal__embed > cal-inline {
  width: 100%;
  height: 100%;
}

.schedule-modal__embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ========================================
   CAL.COM EMBED STYLING OVERRIDES
   Force sharp corners, site fonts, and colors
   ======================================== */

/* Target Cal.com's root container */
.schedule-modal__embed [class*="cal-"],
.schedule-modal__embed [data-cal-wrapper],
.schedule-modal__embed cal-inline {
  font-family: var(--font-sans) !important;
}

/* Force sharp corners on all Cal.com elements */
.schedule-modal__embed *,
.schedule-modal__embed *::before,
.schedule-modal__embed *::after {
  border-radius: 0 !important;
}

/* Override Cal.com's default button/input styling */
.schedule-modal__embed button,
.schedule-modal__embed [role="button"],
.schedule-modal__embed input,
.schedule-modal__embed select {
  border-radius: 0 !important;
  font-family: var(--font-sans) !important;
}

/* Calendar grid - sharp corners */
.schedule-modal__embed [class*="calendar"],
.schedule-modal__embed [class*="Calendar"],
.schedule-modal__embed table {
  border-radius: 0 !important;
}

/* Time slot buttons - sharp corners, site colors */
.schedule-modal__embed [class*="time"],
.schedule-modal__embed [class*="Time"],
.schedule-modal__embed button[class*="time"] {
  border-radius: 0 !important;
  border: 1px solid var(--border-color) !important;
  font-family: var(--font-sans) !important;
}

/* Selected/hover states */
.schedule-modal__embed button:hover,
.schedule-modal__embed [role="button"]:hover {
  border-radius: 0 !important;
}

/* Modal content areas */
.schedule-modal__embed [class*="modal"],
.schedule-modal__embed [class*="Modal"],
.schedule-modal__embed [class*="booker"] {
  border-radius: 0 !important;
}

/* Text elements - use site fonts */
.schedule-modal__embed h1,
.schedule-modal__embed h2,
.schedule-modal__embed h3,
.schedule-modal__embed h4,
.schedule-modal__embed h5,
.schedule-modal__embed h6,
.schedule-modal__embed p,
.schedule-modal__embed span,
.schedule-modal__embed div {
  font-family: var(--font-sans) !important;
}

/* Code/mono elements */
.schedule-modal__embed code,
.schedule-modal__embed pre,
.schedule-modal__embed [class*="mono"] {
  font-family: var(--font-mono) !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .schedule-cta {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }

  .schedule-cta__card {
    min-width: auto;
    max-width: none;
    width: 100%;
    padding: var(--spacing-md);
    gap: var(--spacing-sm);
  }

  .schedule-cta__headline {
    font-size: 0.95rem;
  }

  .schedule-cta__subline {
    font-size: 0.75rem;
  }

  .schedule-cta__arrow {
    font-size: 1.1rem;
  }

  .schedule-modal {
    padding: 0;
    align-items: flex-end;
  }

  .schedule-modal__container {
    width: 100vw;
    max-width: 100vw;
    height: 95vh;
    max-height: 100vh;
    min-height: auto;
    border-left: none;
    border-right: none;
    border-bottom: none;
    transform: translateY(100%);
  }

  .schedule-modal[aria-hidden="false"] .schedule-modal__container {
    transform: translateY(0);
  }

  .schedule-modal__header {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .schedule-modal__title {
    font-size: 0.8rem;
  }

  .schedule-modal__close {
    width: 32px;
    height: 32px;
  }

  .schedule-modal__close svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .schedule-cta {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }

  .schedule-cta__card {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .schedule-cta__label {
    font-size: 0.6rem;
    padding: 2px 6px;
  }

  .schedule-cta__headline {
    font-size: 0.9rem;
  }

  .schedule-modal__container {
    height: 100vh;
    max-height: 100vh;
  }
}

/* ========================================
   DARK MODE
   ======================================== */

@media (prefers-color-scheme: dark) {
  .schedule-cta__card {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  }

  .schedule-cta__card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  }

  .schedule-modal__overlay {
    background: rgba(0, 0, 0, 0.85);
  }

  .schedule-modal[aria-hidden="false"] .schedule-modal__overlay {
    background: rgba(0, 0, 0, 0.88);
  }

  .schedule-modal__container {
    box-shadow: 0 32px 96px rgba(0, 0, 0, 0.6),
                0 8px 24px rgba(0, 0, 0, 0.4);
  }

  /* Dark mode status label */
  .schedule-cta__label {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
  }

  .schedule-cta__card:hover .schedule-cta__label {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
  }

  .schedule-cta__status-dot {
    background: #34d399;
  }
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}
