/* Legis SSM - Custom Corporate B2B & Safety Styles */

/* Font smoothing & root settings */
html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Safety Pattern Accents */
.safety-stripe {
  background: repeating-linear-gradient(
    -45deg,
    #ea580c,
    #ea580c 10px,
    #0f172a 10px,
    #0f172a 20px
  );
}

.safety-stripe-subtle {
  background: repeating-linear-gradient(
    -45deg,
    rgba(234, 88, 12, 0.15),
    rgba(234, 88, 12, 0.15) 12px,
    transparent 12px,
    transparent 24px
  );
}

/* Pulse animation for safety shield badge */
@keyframes shield-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.4);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 12px rgba(234, 88, 12, 0);
  }
}

.animate-pulse-safety {
  animation: shield-pulse 3s infinite ease-in-out;
}

/* Glassmorphism Header */
.glass-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-header.scrolled {
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

/* Mega menu dropdown transitions */
.mega-menu-dropdown {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease-out;
}

.group:hover .mega-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Card hover elevations */
.service-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.07), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

/* Accordion transition */
.faq-answer {
  transition: max-height 0.35s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

/* Floating Action Button (FAB) hover */
.fab-btn {
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 14px 24px -2px rgba(0, 0, 0, 0.35);
}

/* Mobile performance & rendering optimizations */
@media (max-width: 768px) {
  body {
    -webkit-overflow-scrolling: touch;
  }
}

/* Defer rendering of off-screen sections for instant First Contentful Paint (FCP) & smooth 60fps scrolling */
#portofoliu, #faq, #contact {
  content-visibility: auto;
  contain-intrinsic-size: 1px 900px;
}

/* Optimize image rendering */
img {
  max-width: 100%;
  vertical-align: middle;
}

/* Mobile 4x7 Compact Portfolio Grid */
@media (max-width: 640px) {
  #portfolio-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.375rem !important;
  }

  .client-card {
    padding: 0.375rem !important;
    border-radius: 0.625rem !important;
  }

  .client-card .relative {
    height: 3.25rem !important;
    margin-bottom: 0.25rem !important;
    border-radius: 0.375rem !important;
  }

  .client-card .relative span {
    display: none !important;
  }

  .client-card h3 {
    font-size: 0.58rem !important;
    line-height: 1.15 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    min-height: 1.35rem !important;
  }

  .client-card p {
    display: none !important;
  }

  .client-card > div:last-child {
    margin-top: 0.2rem !important;
    padding-top: 0.2rem !important;
    font-size: 0.52rem !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

