/**
 * Schlund Networks Theme - Custom Styles
 *
 * All frontend styles ported from the Astro site.
 * Loaded after Tailwind CSS, before style.css.
 */

/* ═══════════════════════════════════════════════════════════════════════════
   CSS Custom Properties
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #60a5fa;
  --color-primary-dark: #3b82f6;
  --color-background-light: #f6f6f8;
  --color-background-dark: #1a1f2e;
  --color-surface-dark: #242937;
  --color-surface-darker: #1e2330;
  --color-text-light: #111318;
  --color-text-dark: #ffffff;
  --color-text-muted: #4b5563;
  --color-text-muted-dark: #9ca3af;
  --color-border-light: #f0f2f4;
  --color-border-dark: #2d3340;
  --color-surface-light: #f8fafc;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Base / Reset
   ═══════════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-system);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-system);
  background-color: var(--color-background-light);
  color: var(--color-text-light);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Dark mode body */
html.dark body {
  background-color: var(--color-background-dark);
  color: var(--color-text-dark);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Dark / Light Mode Visibility Toggle (prevent FOUC)
   ═══════════════════════════════════════════════════════════════════════════ */

html:not(.dark) .dark\:hidden {
  display: block !important;
}

html.dark .dark\:hidden {
  display: none !important;
}

html:not(.dark) .dark\:block {
  display: none !important;
}

html.dark .dark\:block {
  display: block !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Skip Link (Accessibility)
   ═══════════════════════════════════════════════════════════════════════════ */

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background-color: var(--color-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Nav Dot Effect
   ═══════════════════════════════════════════════════════════════════════════ */

#navDot {
  position: absolute;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: rgba(37, 99, 235, 0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease-out;
  z-index: 50;
  transform: translate(-50%, -50%);
  will-change: left, top, opacity;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Mega Menu Animations
   ═══════════════════════════════════════════════════════════════════════════ */

.mega-menu {
  transform: translateY(10px) translateX(-50%);
  transition: all 0.3s ease;
}

.group:hover .mega-menu {
  transform: translateY(0) translateX(-50%);
}

.mega-menu-item {
  opacity: 0;
  transform: translateY(-10px);
  animation: menuItemFadeIn 0.3s ease-out forwards;
}

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

@keyframes menuItemFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Mobile Menu Transitions
   ═══════════════════════════════════════════════════════════════════════════ */

#mobileMenu {
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

#mobileMenu.hidden {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

#mobileMenu:not(.hidden) {
  max-height: 70vh;
  opacity: 1;
}

/* Mobile accordion arrow rotation */
.mobile-accordion-trigger svg {
  transition: transform 0.3s ease;
}

.mobile-accordion-trigger svg.rotate-180 {
  transform: rotate(180deg);
}

/* Mobile accordion content transition */
.mobile-accordion-content {
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.mobile-accordion-content.hidden {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Fade In on Scroll Animation
   ═══════════════════════════════════════════════════════════════════════════ */

.fade-in-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Animate on Scroll (contact page + general)
   ═══════════════════════════════════════════════════════════════════════════ */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Keyframe Animations
   ═══════════════════════════════════════════════════════════════════════════ */

/* fadeInUp - used by blog cards, general content */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* fade-in-up - used by contact page, service pages */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* pulse-slow - used for animated elements */
@keyframes pulse-slow {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* wiggle - used for icon hover effects */
@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(10deg);
  }
}

/* slideDown - used for accordion reveals */
@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 500px;
    transform: translateY(0);
  }
}

/* Animation utility classes */
.animate-fade-in-up {
  animation: fade-in-up 0.8s ease-out forwards;
  opacity: 0;
}

.animate-pulse-slow {
  animation: pulse-slow 2s ease-in-out infinite;
}

.group:hover .group-hover\:animate-wiggle {
  animation: wiggle 0.5s ease-in-out;
}

/* Blog article card animation */
.article-card {
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Partners Track - Infinite Scrolling Animation
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes scrollPartners {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.partners-track {
  animation: scrollPartners 25s linear infinite;
}

#partnersContainer:hover .partners-track,
.partners-container:hover .partners-track {
  animation-play-state: paused;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Cookie Consent Banner
   ═══════════════════════════════════════════════════════════════════════════ */

.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

.cookie-consent.visible {
  transform: translateY(0);
}

.cookie-consent.hidden {
  display: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Global Modal (#globalModal)
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

#globalModal:not(.hidden) .modal-overlay {
  opacity: 1;
}

.modal-content {
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: all 0.3s ease-out;
}

#globalModal:not(.hidden) .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Closing animation */
#globalModal.closing .modal-content {
  transform: scale(0.9) translateY(20px);
  opacity: 0;
}

#globalModal.closing .modal-overlay {
  opacity: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Form Field Focus Styles
   ═══════════════════════════════════════════════════════════════════════════ */

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Dark mode focus ring */
html.dark input[type="text"]:focus,
html.dark input[type="email"]:focus,
html.dark input[type="tel"]:focus,
html.dark input[type="number"]:focus,
html.dark input[type="url"]:focus,
html.dark input[type="password"]:focus,
html.dark textarea:focus,
html.dark select:focus {
  border-color: var(--color-primary-dark);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}


/* ═══════════════════════════════════════════════════════════════════════════
   FAQ Accordion Transitions
   ═══════════════════════════════════════════════════════════════════════════ */

.faq-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
}

.faq-content.open {
  max-height: 500px;
  opacity: 1;
}

/* Remove default details marker */
details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::marker {
  display: none;
}

/* FAQ toggle icon rotation */
.faq-toggle-icon {
  transition: transform 0.3s ease;
}

.faq-item.open .faq-toggle-icon,
details[open] .faq-toggle-icon {
  transform: rotate(180deg);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Blog Card Hover Effects
   ═══════════════════════════════════════════════════════════════════════════ */

.blog-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.blog-card .blog-card-image {
  overflow: hidden;
}

.blog-card .blog-card-image img {
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.05);
}

/* Line clamp for blog excerpts */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Scrollbar Hiding Utility
   ═══════════════════════════════════════════════════════════════════════════ */

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Dark Mode Scrollbar Styling
   ═══════════════════════════════════════════════════════════════════════════ */

html.dark ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html.dark ::-webkit-scrollbar-track {
  background: var(--color-background-dark);
}

html.dark ::-webkit-scrollbar-thumb {
  background: #3b4050;
  border-radius: 5px;
  border: 2px solid var(--color-background-dark);
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* Firefox dark scrollbar */
html.dark {
  scrollbar-color: #3b4050 var(--color-background-dark);
  scrollbar-width: thin;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Background Patterns
   ═══════════════════════════════════════════════════════════════════════════ */

.bg-grid-pattern {
  background-image: radial-gradient(circle, #ffffff 1px, transparent 1px);
  background-size: 24px 24px;
}

html.dark .bg-grid-pattern {
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px
  );
}

.lazy-bg {
  background-size: cover;
  background-position: center;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Service Card Hover Effects
   ═══════════════════════════════════════════════════════════════════════════ */

.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-color: var(--color-primary);
}

html.dark .service-card:hover {
  border-color: var(--color-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Testimonial Card Effects
   ═══════════════════════════════════════════════════════════════════════════ */

.testimonial-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
}


/* ═══════════════════════════════════════════════════════════════════════════
   CTA Button Hover Scale
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  background-color: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  background-color: transparent;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: #fff;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Partner Logo Grayscale
   ═══════════════════════════════════════════════════════════════════════════ */

.partner-logo img {
  filter: grayscale(100%);
  opacity: 0.7;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.partner-logo img:hover {
  filter: grayscale(0%);
  opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Contact Form Specific
   ═══════════════════════════════════════════════════════════════════════════ */

.contact-form-success {
  animation: fadeInUp 0.5s ease-out forwards;
}

.contact-form-error {
  animation: fadeInUp 0.5s ease-out forwards;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Karriere (Career) Page
   ═══════════════════════════════════════════════════════════════════════════ */

.benefit-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Ticket System Priority Indicator
   ═══════════════════════════════════════════════════════════════════════════ */

.priority-indicator {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.priority-indicator.critical {
  background-color: #ef4444;
  animation: pulse-slow 1.5s ease-in-out infinite;
}

.priority-indicator.high {
  background-color: #f97316;
}

.priority-indicator.normal {
  background-color: #eab308;
}

.priority-indicator.low {
  background-color: #22c55e;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Loading / Spinner
   ═══════════════════════════════════════════════════════════════════════════ */

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

.animate-spin {
  animation: spin 1s linear infinite;
}

.loading-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Print Styles
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {
  /* Hide non-essential elements */
  header,
  footer,
  #cookieConsent,
  #globalModal,
  .cookie-consent,
  .skip-link,
  #navDot,
  .mobile-menu-btn,
  #mobileMenu,
  .promo-bar,
  nav,
  .btn-primary,
  .btn-secondary {
    display: none !important;
  }

  /* Reset backgrounds and colors for print */
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.6;
  }

  /* Ensure content fills the page */
  main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Show URLs for links */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  a[href^="#"]::after,
  a[href^="javascript"]::after,
  a[href^="tel"]::after {
    content: "";
  }

  /* Avoid page breaks inside cards */
  .blog-card,
  .service-card,
  .testimonial-card,
  .faq-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Remove shadows and transforms */
  * {
    box-shadow: none !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* Ensure images print */
  img {
    max-width: 100% !important;
    filter: none !important;
    opacity: 1 !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Responsive Adjustments
   ═══════════════════════════════════════════════════════════════════════════ */

/* Reduce animation distances on small screens */
@media (max-width: 768px) {
  .fade-in-scroll {
    transform: translateY(10px);
  }

  .animate-on-scroll {
    transform: translateY(15px);
  }

  .mega-menu {
    display: none !important;
  }

  /* Stack cookie consent buttons vertically on small screens */
  .cookie-consent .flex-row {
    flex-direction: column;
  }

  /* Reduce hero heading size handled by Tailwind but added as safety */
  h1 {
    word-break: break-word;
  }
}

/* Ensure partners track works on all screen sizes */
@media (max-width: 640px) {
  .partners-track {
    animation-duration: 15s;
  }

  .partner-logo {
    min-width: 80px;
  }

  .partner-logo img {
    height: 3rem;
  }
}

/* Large screens - increase animation travel distance for effect */
@media (min-width: 1280px) {
  .fade-in-scroll {
    transform: translateY(30px);
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Reduced Motion (Accessibility)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in-scroll,
  .animate-on-scroll,
  .animate-fade-in-up {
    opacity: 1;
    transform: none;
  }

  .partners-track {
    animation: none;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Selection / Highlight Colors
   ═══════════════════════════════════════════════════════════════════════════ */

::selection {
  background-color: rgba(37, 99, 235, 0.2);
  color: inherit;
}

html.dark ::selection {
  background-color: rgba(96, 165, 250, 0.3);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Smooth Image Loading
   ═══════════════════════════════════════════════════════════════════════════ */

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img[loading="lazy"][complete] {
  opacity: 1;
}

/* Ensure eagerly loaded images are always visible */
img:not([loading="lazy"]) {
  opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════════════════
   WordPress-Specific Overrides
   ═══════════════════════════════════════════════════════════════════════════ */

/* WordPress admin bar offset when logged in */
body.admin-bar header.sticky {
  top: calc(2rem + 32px); /* promo bar (2rem/32px) + WP admin bar (32px) */
}

@media (max-width: 782px) {
  body.admin-bar header.sticky {
    top: calc(2rem + 46px); /* mobile WP admin bar is 46px */
  }
}

/* WordPress alignment classes */
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}

.alignright {
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

/* WordPress caption */
.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

html.dark .wp-caption-text {
  color: var(--color-text-muted-dark);
}
