/* Base resets & typography */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--color-surface);
  color: #475569;
  /* Slate-600 for body content / paragraphs */
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: 100px;
  /* Make more space for fixed nav */
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #0f172a;
  /* Slate-900 for headings */
}

/* Admin console pages use a sticky (not fixed) header, so they don't need this offset */
body.admin-body {
  padding-top: 0;
}

/* Hide scrollbars completely on EVERYTHING */
html,
body,
*,
*::before,
*::after {
  overflow: visible;
  scrollbar-width: none !important;
  /* Firefox */
  -ms-overflow-style: none !important;
  /* IE and Edge */
}

::-webkit-scrollbar {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb,
::-webkit-scrollbar-corner {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
  background: transparent !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* Fix background images */
[style*="background-image"] {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Responsive px-margin-desktop */
@media (max-width: 768px) {
  .px-margin-desktop {
    padding-left: var(--margin-mobile);
    padding-right: var(--margin-mobile);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .px-margin-desktop {
    padding-left: var(--margin-tablet);
    padding-right: var(--margin-tablet);
  }
}

/* Responsive section padding */
.py-section-padding {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

@media (max-width: 1024px) {
  .py-section-padding {
    padding-top: var(--section-padding-tablet);
    padding-bottom: var(--section-padding-mobile);
  }
}

@media (max-width: 768px) {
  .py-section-padding {
    padding-top: var(--section-padding-mobile);
    padding-bottom: var(--section-padding-mobile);
  }
}

/* Selection colors */
::selection {
  background-color: var(--color-error-container);
  color: var(--color-error);
}

/* Typography styles matching Stitch specs - fully responsive */
.text-headline-xl {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-headline-lg {
  font-size: var(--font-headline-lg);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.text-headline-md {
  font-size: var(--font-headline-md);
  font-weight: 600;
  line-height: 1.3;
}

.text-body-lg {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
}

.text-body-md {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

.text-label-md {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.text-label-sm {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-transform: uppercase;
}

/* Fix text-display-lg from tailwind-compiled to be responsive */
.text-display-lg {
  font-size: var(--font-display-lg);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.text-headline-xl-mobile {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 700;
  line-height: 1.15;
}

/* Basic utility container classes */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--margin-desktop);
  padding-right: var(--margin-desktop);
}

@media (max-width: 768px) {
  .container {
    padding-left: var(--margin-mobile);
    padding-right: var(--margin-mobile);
  }
}

/* Responsive margin desktop becomes margin mobile on small screens */
@media (max-width: 768px) {
  .px-margin-desktop {
    padding-left: var(--margin-mobile);
    padding-right: var(--margin-mobile);
  }
}

/* Responsive margin desktop becomes margin tablet on medium screens */
@media (min-width: 769px) and (max-width: 1024px) {
  .px-margin-desktop {
    padding-left: var(--margin-tablet);
    padding-right: var(--margin-tablet);
  }
}

/* Anchor links */
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

/* Grayscale overlays for images */
.image-grayscale {
  filter: grayscale(20%);
  transition: filter 0.5s ease-in-out;
}

.image-grayscale:hover {
  filter: grayscale(0%);
}

/* Active Navigation link underline indicator */
.nav-active {
  position: relative;
}

.nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-secondary-container, #a40213);
}

/* Typography Override for Poppins (Body & Labels) */
body,
.font-body-lg,
.font-body-md,
.font-label-bold,
.font-label-sm {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Typography Override for Avenir Next (Headings & Menu Labels) */
h1,
h2,
h3,
h4,
h5,
h6,
.font-display-lg,
.font-headline-lg,
.font-headline-md,
.text-headline-xl,
.text-headline-lg,
.text-headline-md,
.font-label-technical {
  font-family: 'Avenir Next', 'Avenir', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* Floating Action Bar Styles (Unified Speed Dial) */
.floating-action-bar {
  position: fixed;
  z-index: 1000;
  bottom: 24px;
  right: 24px;
  width: 50px;
  height: 50px;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.speed-dial-menu {
  position: absolute;
  bottom: 62px;
  right: 0;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  width: 50px;
  align-items: center;
}

.floating-action-bar.open .speed-dial-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Expansion direction adjustments for draggable widget in top viewport half */
.floating-action-bar.expand-down .speed-dial-menu {
  bottom: auto;
  top: 62px;
  flex-direction: column;
  transform: translateY(-20px) scale(0.8);
}

.floating-action-bar.open.expand-down .speed-dial-menu {
  transform: translateY(0) scale(1);
}

@media (max-width: 768px) {
  .floating-action-bar.expand-down .speed-dial-menu {
    top: 56px;
    bottom: auto;
  }
}

/* Floating Action Buttons */
.floating-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-decoration: none;
}

/* Specific colors */
.floating-btn-whatsapp {
  background-color: #25D366;
}

.floating-btn-whatsapp:hover {
  background-color: #20ba5a;
  transform: scale(1.05);
}

.floating-btn-call {
  background-color: #a40213;
}

.floating-btn-call:hover {
  background-color: #82010e;
  transform: scale(1.05);
}

.floating-btn-linkedin {
  background-color: #0A66C2;
}

.floating-btn-linkedin:hover {
  background-color: #004182;
  transform: scale(1.05);
}

.floating-btn-instagram {
  background-color: #E1306C;
}

.floating-btn-instagram:hover {
  background-color: #C13584;
  transform: scale(1.05);
}

.floating-btn-email {
  background-color: #555759;
}

.floating-btn-email:hover {
  background-color: #444546;
  transform: scale(1.05);
}

/* Trigger Button */
.floating-btn-trigger {
  display: flex;
  background-color: #b5111a;
  border: none;
  outline: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 10;
}

.floating-btn-trigger:hover {
  background-color: #8c0d13;
  transform: scale(1.05);
}

/* Scroll to Top button layout */
.floating-btn-scrollup {
  background-color: #131314;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: all 0.25s ease;
  position: absolute;
  bottom: 0;
  z-index: 5;
}

.floating-btn-scrollup.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.floating-btn-scrollup:hover {
  background-color: #2f3131;
  transform: scale(1.05);
}

/* Desktop positioning for scrollup (left of trigger) */
@media (min-width: 769px) {
  .floating-btn-scrollup {
    right: 62px;
  }
}

/* Mobile: hide scrollup and scale action buttons slightly */
@media (max-width: 768px) {
  .floating-btn-scrollup {
    display: none !important;
  }

  .floating-action-btn {
    width: 44px;
    height: 44px;
  }

  .floating-action-bar {
    width: 44px;
    height: 44px;
    bottom: 24px;
    right: 24px;
  }

  .floating-btn-trigger {
    width: 44px;
    height: 44px;
  }

  .speed-dial-menu {
    bottom: 56px;
    width: 44px;
  }

  .floating-action-btn::before {
    display: none !important;
  }
}

/* Labels on hover (Desktop only) */
@media (min-width: 769px) {
  .floating-action-btn::after {
    content: attr(data-label);
    position: absolute;
    right: 60px;
    background: #131314;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    pointer-events: none;
  }

  .floating-action-btn:hover::after {
    opacity: 1;
    visibility: visible;
    right: 62px;
  }
}

/* Modal Popup Styles */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(19, 19, 20, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 16px;
}

.custom-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.custom-modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-surface-container-highest);
  position: relative;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-overlay.active .custom-modal-content {
  transform: scale(1);
}

.custom-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-surface-container);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-on-surface);
  transition: all 0.2s ease;
  z-index: 10;
}

.custom-modal-close:hover {
  background: var(--color-primary);
  color: white;
}

/* Custom Header Styling overrides to make nav text bold */
nav a.font-label-technical,
nav .mobile-nav-link {
  font-weight: 700 !important;
}

/* Header logo responsive height helper */
.header-logo {
  height: 100px !important;
  max-height: 100% !important;
  width: auto !important;
}

@media (min-width: 1024px) {
  .header-logo {
    height: 110px !important;
  }
}

/* Footer logo responsive height helper */
.footer-logo {
  height: 80px !important;
  max-height: 100% !important;
  width: auto !important;
  margin-left: 0 !important;
}

/* Job card header grid alignment helper */
.job-card-header-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: center !important;
  gap: 1.5rem !important;
  width: 100% !important;
}

@media (min-width: 768px) {
  .job-card-header-grid {
    grid-template-columns: 2.2fr 1.6fr 1.6fr 1.6fr !important;
  }

  .job-card-header-grid>*:nth-child(4) {
    display: flex !important;
    justify-content: flex-end !important;
  }
}

/* Navigation bar padding removal to match logo height */
nav {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

nav>div {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}