/* ChefTalk Marketing Website - Components */
/* Buttons, forms, navigation, modal */

/* ======================
   BUTTON STYLES
   ====================== */

.btn-primary {
  background: var(--primary-orange);
  color: var(--primary-light);
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-medium);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.btn-primary:hover {
  background: #E55A2B;
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-orange);
  border: 2px solid var(--primary-orange);
  padding: 4px 8px;
  border-radius: var(--radius-medium);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-right: 6px;
  display: inline-block;
  text-decoration: none;
  text-align: center;
  line-height: 1;
  box-sizing: border-box;
}

.btn-secondary:hover {
  background: var(--primary-orange);
  color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

/* Button Responsive Styles */
@media (min-width: 768px) {
  .btn-primary {
    padding: 12px 24px;
    font-size: 16px;
  }

  .btn-secondary {
    padding: 10px 20px;
    font-size: 16px;
    margin-right: 8px;
  }
}

/* ======================
   NAVIGATION
   ====================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 247, 237, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 107, 53, 0.1);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.25s ease, box-shadow 0.25s ease;
}

/* Once the page has moved: a touch more solid, with a soft shadow instead of the hairline */
.nav.scrolled {
  background: rgba(255, 250, 245, 0.92);
  border-bottom-color: transparent;
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.04), 0 8px 24px rgba(26, 26, 26, 0.06);
}

/* Slides away while reading down, back on the first scroll up */
.nav.nav-hidden {
  transform: translateY(-100%);
}

/* Anchor jumps land below the bar, not under it */
html {
  scroll-padding-top: 80px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Text links with an orange underline that slides in on hover and marks the section you're in */
.nav-link {
  position: relative;
  padding: 6px 0;
  background: none;
  border: 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: rgba(26, 26, 26, 0.8);
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--primary-orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

/* Blog leaves the site: a small arrow says so */
.nav-ext {
  margin-left: 3px;
  vertical-align: 1px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.nav-link-external:hover .nav-ext {
  transform: translate(1px, -1px);
}

.nav-link-external::after {
  right: 12px;
}

.nav-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-orange);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-link:focus-visible,
.nav-download:focus-visible {
  outline: 2px solid var(--primary-orange);
  outline-offset: 4px;
  border-radius: 4px;
}

/* The one button in the bar */
.nav-download {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--primary-orange);
  color: var(--primary-light);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.nav-download:hover {
  background: #F25F2A;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.32);
}

.nav-download-more {
  display: none;
}

@media (min-width: 768px) {
  .nav-right {
    gap: 28px;
  }

  .nav-links {
    gap: 28px;
  }

  .nav-download {
    height: 38px;
    padding: 0 18px;
  }

  .nav-download-more {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav,
  .nav-link::after,
  .nav-download {
    transition: none;
  }
}

.nav-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  box-sizing: border-box;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-image {
  height: 32px;
  width: 32px;
  object-fit: contain;
  /* iOS app-icon corners (about 22% of the side), so it reads as the app icon */
  border-radius: 7px;
}

.logo-text {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 20px;
  color: var(--primary-orange);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Navigation Button Visibility Control */
.nav-get-access {
  display: none; /* Hidden on mobile */
}

/* Navigation Responsive Styles */
@media (min-width: 768px) {
  .nav-container {
    height: 64px;
    padding: 0 var(--container-padding);
  }

  .logo-text {
    font-size: 22px;
  }

  .nav-cta {
    gap: 8px;
  }

  .nav-get-access {
    display: block; /* Visible on desktop */
  }
}

@media (min-width: 1024px) {
  .logo-text {
    font-size: 24px;
  }
}

/* ======================
   FORMS
   ====================== */

.early-access-form {
  width: 100%;
  max-width: 400px;
}

.email-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.email-input {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid #E5E7EB;
  border-radius: var(--radius-medium);
  font-size: 16px;
  font-family: var(--font-body);
  background: var(--primary-light);
  transition: all 0.3s ease;
}

.email-input:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.submit-button {
  padding: 16px 24px;
  background: var(--primary-orange);
  color: var(--primary-light);
  border: none;
  border-radius: var(--radius-medium);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  white-space: nowrap;
  width: 100%;
}

.submit-button:hover {
  background: #E55A2B;
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.submit-button.loading {
  background: #9CA3AF;
  cursor: not-allowed;
}

.error-message {
  display: none;
  color: #EF4444;
  font-size: 14px;
  margin-top: 8px;
  text-align: left;
}

.success-message {
  display: none;
  text-align: center;
  padding: 24px;
  background: #F0FDF4;
  border-radius: var(--radius-medium);
  border: 1px solid #BBF7D0;
}

.success-message h3 {
  color: #166534;
  margin-bottom: 8px;
}

.success-message p {
  color: #15803D;
  font-size: 14px;
}

/* Form Responsive Styles */
@media (min-width: 768px) {
  .email-group {
    flex-direction: row;
    gap: 12px;
  }

  .submit-button {
    width: auto;
  }
}

/* ======================
   CTA FORM VARIATIONS
   ====================== */

.cta-form {
  max-width: 400px;
  margin: 0 auto;
}

.cta-email-group {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-medium);
  padding: 8px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-direction: row;
  gap: 12px;
}

.cta-email-input {
  background: transparent;
  border: none;
  color: var(--primary-light);
  padding: 12px 16px;
}

.cta-email-input::placeholder {
  color: #9CA3AF;
}

.cta-email-input:focus {
  border: none;
  box-shadow: none;
}

.cta-submit-button {
  background: var(--primary-orange);
  border: none;
  margin: 0;
  width: auto;
}

.cta-submit-button:hover {
  background: #E55A2B;
}

.cta-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.cta-success h3 {
  color: #10B981;
}

.cta-success p {
  color: #6EE7B7;
}

/* CTA Form Responsive Styles */
@media (max-width: 767px) {
  .cta-email-group {
    flex-direction: column !important;
    gap: 16px;
    padding: 16px;
  }
  
  .cta-submit-button {
    width: 100%;
    text-align: center;
  }
}

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

.contact-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: var(--radius-large);
  width: 95%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin: 20px;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #E5E7EB;
}

.modal-title {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 24px;
  color: var(--primary-dark);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-gray);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #F3F4F6;
  color: var(--primary-dark);
}

.modal-body {
  padding: 20px;
}

.contact-form {
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
  padding: 12px 16px;
  border: 2px solid #E5E7EB;
  border-radius: var(--radius-small);
  font-family: var(--font-body);
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.field-error {
  color: #EF4444;
  font-size: 12px;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
  flex-direction: column-reverse;
}

.contact-error-message {
  display: none;
  color: #EF4444;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-small);
  padding: 12px;
  margin-top: 16px;
  font-size: 14px;
}

.contact-success-message {
  display: none;
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.contact-success-message h3 {
  color: var(--primary-dark);
  margin-bottom: 8px;
  font-size: 20px;
}

.contact-success-message p {
  color: var(--text-gray);
  font-size: 16px;
}

/* Modal Responsive Styles */
@media (min-width: 768px) {
  .form-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
  }

  .modal-content {
    width: 90%;
    margin: 0;
  }

  .modal-header,
  .modal-body {
    padding: 32px;
  }

  .form-actions {
    flex-direction: row;
  }

  .btn-secondary {
    margin-right: 12px;
    margin-top: 0;
  }
}

/* ======================
   ANIMATIONS
   ====================== */

/* Shake animation for modal */
.contact-modal.shake .modal-content {
  animation: modalShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes modalShake {
  10%, 90% {
    transform: scale(1) translate3d(-1px, 0, 0);
  }
  20%, 80% {
    transform: scale(1) translate3d(2px, 0, 0);
  }
  30%, 50%, 70% {
    transform: scale(1) translate3d(-4px, 0, 0);
  }
  40%, 60% {
    transform: scale(1) translate3d(4px, 0, 0);
  }
}

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-blog {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 16px;
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-blog:hover {
  color: var(--primary-orange);
}

.nav-bluesky {
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

.nav-bluesky:hover {
  background-color: rgba(255, 107, 53, 0.1);
}

.bluesky-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}

.desktop-only {
  display: none;
}

@media (min-width: 768px) {
  .desktop-only {
    display: flex;
  }
}

/* Bluesky logo white filter fix */
.social-link.bluesky .social-icon img {
  filter: brightness(0) invert(1);
}

/* Bluesky logo white filter fix */
.social-link.bluesky .social-icon img {
  filter: brightness(0) invert(1);
  width: 30px;
  height: 30px;
  object-fit: contain;
}

/* Pinterest logo white filter */
.social-link.pinterest .social-icon img {
  filter: brightness(0) invert(1);
  width: 30px;
  height: 30px;
}

/* Round corners for blog icon */
.social-link.blog .social-icon img {
  border-radius: 8px;
}