/* Custom animations and styles */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out;
}

.gradient-text {
  background: linear-gradient(135deg, #5bc5d4 0%, #3fa8b5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* WhatsApp button pulse animation */
@keyframes pulse-slow {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 10px 25px rgba(37, 211, 102, 0.5));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 15px 35px rgba(37, 211, 102, 0.7));
  }
}

.animate-pulse-slow {
  animation: pulse-slow 2.5s infinite;
}

/* Scroll fade-in animation */
@keyframes fadeInUpScroll {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-animate {
  opacity: 0;
  animation: fadeInUpScroll 0.8s ease-out forwards;
}

/* Staggered animation delays */
.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}
.delay-400 {
  animation-delay: 0.4s;
}
.delay-500 {
  animation-delay: 0.5s;
}
.delay-600 {
  animation-delay: 0.6s;
}

/* Bounce animation for icons */
@keyframes bounce-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.bounce-in {
  animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    transform: translateX(-100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-left {
  animation: slideInLeft 0.8s ease-out;
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-right {
  animation: slideInRight 0.8s ease-out;
}

/* Scale up animation */
@keyframes scaleUp {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.scale-up {
  animation: scaleUp 0.6s ease-out;
}

/* Video slider styles */
.video-slider {
  position: relative;
  overflow: hidden;
}

.video-slide {
  display: none;
}

.video-slide.active {
  display: block;
}

/* Skip to main content - accessibility */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: #5bc5d4;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}

/* Advanced animations for ALL elements */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.float-animation {
  animation: float 3s ease-in-out infinite;
}

@keyframes gentleFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes glow-pulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(91, 197, 212, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(91, 197, 212, 0.6);
  }
}

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

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-down {
  animation: slide-down 0.5s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fade-in 0.8s ease-out;
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* WCAG 2.1 Accessibility: Focus states for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #1b6b76;
  outline-offset: 2px;
}

/* Improved focus visibility */
.focus-visible:focus-visible {
  outline: 3px solid #1b6b76;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(27, 107, 118, 0.2);
}

/* Respect reduced motion preferences - WCAG AA */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Enhanced hover effects for ALL buttons */
.btn-animate {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-animate:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 30px rgba(91, 197, 212, 0.3);
}

.btn-animate:active {
  transform: translateY(0) scale(0.98);
}

/* Language switcher */
.language-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.language-switcher--block {
  width: 100%;
  justify-content: flex-start;
}

.language-switcher--block .language-switcher-button {
  width: 100%;
  justify-content: space-between;
}

.language-switcher--footer {
  justify-content: center;
}

.language-switcher-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.95rem;
  background-image: linear-gradient(135deg, #5bc5d4, #3fa8b5);
  color: #fff;
  box-shadow: 0 15px 35px rgba(91, 197, 212, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.language-switcher-button:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 25px 45px rgba(91, 197, 212, 0.55);
  background-image: linear-gradient(135deg, #2d7a85, #1b6b76);
}

.language-switcher-button:focus-visible {
  outline: 3px solid rgba(27, 107, 118, 0.35);
  outline-offset: 2px;
}

.language-switcher-button i {
  font-size: 0.8rem;
  opacity: 0.85;
}

.language-switcher-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.2);
  min-width: 210px;
  z-index: 40;
}

.language-switcher--footer .language-switcher-menu {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.language-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  border: none;
  border-radius: 9999px;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  font-size: 0.95rem;
  background: transparent;
  color: #0f172a;
  transition: all 0.25s ease;
  cursor: pointer;
}

.language-option:hover {
  background: linear-gradient(
    135deg,
    rgba(91, 197, 212, 0.15),
    rgba(63, 168, 181, 0.15)
  );
  transform: translateX(4px);
}

.language-option:focus-visible {
  outline: 3px solid rgba(27, 107, 118, 0.35);
  outline-offset: 2px;
}

.language-option.language-btn-active {
  background-image: linear-gradient(135deg, #2d7a85, #1b6b76);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.language-option.language-btn-active .language-label {
  color: #fff;
}

.language-label {
  font-weight: 600;
  letter-spacing: 0.05em;
}

.language-flag {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.language-flag-pl {
  background-image: linear-gradient(180deg, #ffffff 50%, #dc143c 50%);
}

.language-flag-en {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2060%2030%27%3E%3Cpath%20fill%3D%27%23012169%27%20d%3D%27M0%200h60v30H0z%27/%3E%3Cpath%20fill%3D%27none%27%20stroke%3D%27%23FFF%27%20stroke-width%3D%276%27%20d%3D%27M0%200l60%2030M60%200L0%2030%27/%3E%3Cpath%20fill%3D%27none%27%20stroke%3D%27%23C8102E%27%20stroke-width%3D%274%27%20d%3D%27M0%200l60%2030M60%200L0%2030%27/%3E%3Cpath%20fill%3D%27none%27%20stroke%3D%27%23FFF%27%20stroke-width%3D%2710%27%20d%3D%27M30%200v30M0%2015h60%27/%3E%3Cpath%20fill%3D%27none%27%20stroke%3D%27%23C8102E%27%20stroke-width%3D%276%27%20d%3D%27M30%200v30M0%2015h60%27/%3E%3C/svg%3E");
}

.language-flag-de {
  background-image: linear-gradient(
    180deg,
    #000000 0%,
    #000000 33%,
    #dd0000 33%,
    #dd0000 66%,
    #ffce00 66%,
    #ffce00 100%
  );
}

/* Link hover animation */
.link-animate {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.3s ease;
}

.link-animate::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: #5bc5d4;
  transition: width 0.3s ease;
}

.link-animate:hover::after {
  width: 100%;
}

.link-animate.nav-link-active {
  color: #1b6b76;
}

.link-animate.nav-link-active::after {
  width: 100%;
}

/* ================= PORTFOLIO PAGE ================= */
.portfolio-hero {
  background: #f9fbff;
  padding: 4rem 0;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.marquee-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  display: flex;
  gap: 0;
}

.marquee-track {
  display: flex;
  gap: 0;
  flex: 0 0 auto;
  min-width: 100%;
  animation: marquee-scroll 55s linear infinite;
}

.marquee-track:nth-of-type(2) {
  animation-delay: -27.5s;
}

.marquee-wrapper:hover .marquee-track,
.marquee-wrapper:focus-within .marquee-track,
.marquee-wrapper.paused .marquee-track {
  animation-play-state: paused;
}

.marquee-tile {
  position: relative;
  display: block;
  border-radius: 0;
  background-size: cover;
  background-position: center;
  width: 200px;
  height: 200px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.25);
  transition: transform 0.45s cubic-bezier(0.165, 0.84, 0.44, 1),
    box-shadow 0.45s ease, border-color 0.45s ease;
  will-change: transform;
  z-index: 1;
}

.marquee-tile:hover,
.marquee-tile:focus-visible {
  transform: scale(1.35);
  box-shadow: 0 45px 90px rgba(27, 107, 118, 0.55);
  border-color: rgba(91, 197, 212, 0.95);
  outline: none;
  z-index: 10;
}

.portfolio-hero__copy {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.portfolio-hero__copy h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1.25rem;
}

.portfolio-hero__copy p {
  font-size: 1.1rem;
  color: #475569;
  line-height: 1.7;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

.portfolio-detail-grid {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.portfolio-detail-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border-radius: 2rem;
  background: #ffffff;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  cursor: pointer;
}

.portfolio-detail-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 40px 80px rgba(27, 107, 118, 0.15);
}

.portfolio-detail-card:focus-visible {
  outline: 4px solid rgba(91, 197, 212, 0.45);
  outline-offset: 6px;
}

.portfolio-detail-image {
  border-radius: 1.5rem;
  overflow: hidden;
  position: relative;
}

.portfolio-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.portfolio-detail-card[data-collapsed="true"] .portfolio-detail-image img {
  transform: scale(0.9);
  filter: saturate(0.7);
}

.portfolio-detail-copy h3 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.portfolio-detail-copy p {
  color: #475569;
  line-height: 1.6;
}

.portfolio-detail-eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #1b6b76;
  margin-bottom: 0.75rem;
}

.portfolio-detail-domain {
  font-size: 0.85rem;
  color: #0f172a;
  font-weight: 600;
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .portfolio-detail-card {
    padding: 1.5rem;
    grid-template-columns: 1fr;
  }
}

/* Card hover lift effect */
.card-lift {
  transition: all 0.3s ease;
}

.card-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Text reveal animation */
@keyframes text-reveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.text-reveal {
  animation: text-reveal 0.6s ease-out forwards;
}

/* Icon bounce on hover */
.icon-bounce:hover i {
  animation: bounce-in 0.5s ease;
}

/* Stagger delays for sequential animations */
.delay-700 {
  animation-delay: 0.7s;
}
.delay-800 {
  animation-delay: 0.8s;
}
.delay-900 {
  animation-delay: 0.9s;
}
.delay-1000 {
  animation-delay: 1s;
}

/* ========== ACCESSIBILITY MODES CSS ========== */

/* High Contrast Mode - Light Mode (White background, Black text) */
body.high-contrast:not(.dark-mode) {
  background: #fff !important;
  color: #000 !important;
}

body.high-contrast:not(.dark-mode) * {
  border-color: #000 !important;
}

body.high-contrast:not(.dark-mode) a {
  color: #000 !important;
  text-decoration: underline !important;
  border-bottom: 2px solid #000 !important;
  padding-bottom: 2px;
}

body.high-contrast:not(.dark-mode) button,
body.high-contrast:not(.dark-mode) .btn,
body.high-contrast:not(.dark-mode) input,
body.high-contrast:not(.dark-mode) select,
body.high-contrast:not(.dark-mode) textarea {
  background: #fff !important;
  color: #000 !important;
  border: 3px solid #000 !important;
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px #000 !important;
}

body.high-contrast:not(.dark-mode) .bg-gradient-to-br,
body.high-contrast:not(.dark-mode) .bg-gradient-to-r,
body.high-contrast:not(.dark-mode) section,
body.high-contrast:not(.dark-mode) div,
body.high-contrast:not(.dark-mode) header,
body.high-contrast:not(.dark-mode) footer {
  background: #fff !important;
  color: #000 !important;
}

body.high-contrast:not(.dark-mode) img,
body.high-contrast:not(.dark-mode) video {
  border: 3px solid #000 !important;
  opacity: 1 !important;
}

body.high-contrast:not(.dark-mode) .card,
body.high-contrast:not(.dark-mode) [class*="card"],
body.high-contrast:not(.dark-mode) [class*="bg-"] {
  background: #fff !important;
  border: 3px solid #000 !important;
  padding: 1rem;
}

/* Icons in High Contrast Light Mode */
body.high-contrast:not(.dark-mode) i[class*="fa-"],
body.high-contrast:not(.dark-mode) .fas,
body.high-contrast:not(.dark-mode) .far,
body.high-contrast:not(.dark-mode) .fab {
  color: #000 !important;
}

/* Icon containers with gradients in High Contrast Light Mode */
body.high-contrast:not(.dark-mode) [class*="bg-gradient-to-br"],
body.high-contrast:not(.dark-mode) [class*="bg-gradient-to-r"] {
  background: #fff !important;
  border: 3px solid #000 !important;
}

/* Footer logo in High Contrast Light Mode - set to #545454 */
body.high-contrast:not(.dark-mode) footer img[src*="polybrand-logo"] {
  filter: brightness(0) saturate(100%) !important;
  opacity: 0.33 !important;
}

/* Remove border from "Ustawienia cookies" button in footer - style like regulamin and polityka prywatności */
body.high-contrast:not(.dark-mode) footer button[onclick*="showCookieConsent"],
body.high-contrast:not(.dark-mode)
  footer
  button[onclick*="showCookieConsent"]:hover {
  border: none !important;
  background: transparent !important;
  color: #000 !important;
  text-decoration: underline !important;
  box-shadow: none !important;
  padding-bottom: 2px !important;
  border-bottom: 2px solid #000 !important;
}

/* WhatsApp button - larger icon in high contrast light mode (button stays same size) */
body.high-contrast:not(.dark-mode) .whatsapp-button img,
body.high-contrast:not(.dark-mode) .whatsapp-button img.w-full {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
}

/* High Contrast Mode - Dark Mode (Black background, White text) */
body.high-contrast.dark-mode {
  background: #000 !important;
  color: #fff !important;
}

body.high-contrast.dark-mode * {
  border-color: #fff !important;
}

body.high-contrast.dark-mode a {
  color: #fff !important;
  text-decoration: underline !important;
  border-bottom: 2px solid #fff !important;
  padding-bottom: 2px;
}

body.high-contrast.dark-mode button,
body.high-contrast.dark-mode .btn,
body.high-contrast.dark-mode input,
body.high-contrast.dark-mode select,
body.high-contrast.dark-mode textarea {
  background: #000 !important;
  color: #fff !important;
  border: 3px solid #fff !important;
  box-shadow: 0 0 0 2px #000, 0 0 0 5px #fff !important;
}

body.high-contrast.dark-mode .bg-gradient-to-br,
body.high-contrast.dark-mode .bg-gradient-to-r,
body.high-contrast.dark-mode section,
body.high-contrast.dark-mode div,
body.high-contrast.dark-mode header,
body.high-contrast.dark-mode footer {
  background: #000 !important;
  color: #fff !important;
}

body.high-contrast.dark-mode img,
body.high-contrast.dark-mode video {
  border: 3px solid #fff !important;
  opacity: 1 !important;
}

/* Exception: footer logo should not have border */
body.high-contrast.dark-mode footer img[src*="polybrand-logo"] {
  border: none !important;
}

body.high-contrast.dark-mode .card,
body.high-contrast.dark-mode [class*="card"],
body.high-contrast.dark-mode [class*="bg-"] {
  background: #000 !important;
  border: 3px solid #fff !important;
  padding: 1rem;
}

/* Remove border from footer logo in dark high contrast mode */
body.high-contrast.dark-mode footer img[src*="polybrand-logo"] {
  border: none !important;
}

/* Remove border from "Ustawienia cookies" button in footer - style like regulamin and polityka prywatności */
body.high-contrast.dark-mode footer button[onclick*="showCookieConsent"],
body.high-contrast.dark-mode footer button[onclick*="showCookieConsent"]:hover {
  border: none !important;
  background: transparent !important;
  color: #fff !important;
  text-decoration: underline !important;
  box-shadow: none !important;
  padding-bottom: 2px !important;
  border-bottom: 2px solid #fff !important;
}

/* Remove border from dropdown buttons in navbar - style like regular links (Portfolio, Cennik, etc.) */
body.high-contrast.dark-mode nav button[aria-haspopup="true"],
body.high-contrast.dark-mode nav .nav-link-wrapper button,
body.high-contrast.dark-mode header nav button[aria-haspopup="true"] {
  border: none !important;
  background: transparent !important;
  color: #fff !important;
  text-decoration: underline !important;
  box-shadow: none !important;
}

/* Ensure dropdown buttons in navbar don't have borders in high contrast dark mode */
body.high-contrast.dark-mode header button[aria-haspopup="true"] {
  border: none !important;
  background: transparent !important;
}

/* WhatsApp button - larger icon in high contrast dark mode (button stays same size) */
body.high-contrast.dark-mode .whatsapp-button img,
body.high-contrast.dark-mode .whatsapp-button img.w-full {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
}

/* All text should be white in dark high contrast mode */
body.high-contrast.dark-mode p,
body.high-contrast.dark-mode .text-gray-600,
body.high-contrast.dark-mode .text-gray-700,
body.high-contrast.dark-mode .text-gray-800,
body.high-contrast.dark-mode .text-gray-900,
body.high-contrast.dark-mode .text-gray-400,
body.high-contrast.dark-mode .text-gray-500,
body.high-contrast.dark-mode h1,
body.high-contrast.dark-mode h2,
body.high-contrast.dark-mode h3,
body.high-contrast.dark-mode h4,
body.high-contrast.dark-mode h5,
body.high-contrast.dark-mode h6,
body.high-contrast.dark-mode span:not(.gradient-text),
body.high-contrast.dark-mode li,
body.high-contrast.dark-mode td,
body.high-contrast.dark-mode th {
  color: #fff !important;
}

/* All text should be white in dark high contrast mode - comprehensive fix */
body.high-contrast.dark-mode p,
body.high-contrast.dark-mode .text-gray-600,
body.high-contrast.dark-mode .text-gray-700,
body.high-contrast.dark-mode .text-gray-800,
body.high-contrast.dark-mode .text-gray-900,
body.high-contrast.dark-mode .text-gray-400,
body.high-contrast.dark-mode .text-gray-500,
body.high-contrast.dark-mode h1,
body.high-contrast.dark-mode h2,
body.high-contrast.dark-mode h3,
body.high-contrast.dark-mode h4,
body.high-contrast.dark-mode h5,
body.high-contrast.dark-mode h6,
body.high-contrast.dark-mode span:not(.text-brand-blue):not(.gradient-text),
body.high-contrast.dark-mode li,
body.high-contrast.dark-mode td,
body.high-contrast.dark-mode th {
  color: #fff !important;
}

/* Remove gray colors from specific sections */
body.high-contrast.dark-mode #system-monitor h2,
body.high-contrast.dark-mode #system-monitor p,
body.high-contrast.dark-mode #system-monitor .text-gray-600,
body.high-contrast.dark-mode #system-monitor .text-gray-700,
body.high-contrast.dark-mode #system-monitor .text-gray-800,
body.high-contrast.dark-mode #system-monitor * {
  color: #fff !important;
}

/* Ensure all backgrounds are black in dark high contrast mode (except footer and navbar) */
body.high-contrast.dark-mode section:not(footer):not(header) {
  background: #000 !important;
}

/* Force all text to white in dark high contrast mode (except CTA section and footer/navbar) */
body.high-contrast.dark-mode
  section:not(footer):not(header):not(.bg-gradient-to-r)
  p,
body.high-contrast.dark-mode
  section:not(footer):not(header):not(.bg-gradient-to-r)
  h1,
body.high-contrast.dark-mode
  section:not(footer):not(header):not(.bg-gradient-to-r)
  h2,
body.high-contrast.dark-mode
  section:not(footer):not(header):not(.bg-gradient-to-r)
  h3,
body.high-contrast.dark-mode
  section:not(footer):not(header):not(.bg-gradient-to-r)
  h4,
body.high-contrast.dark-mode
  section:not(footer):not(header):not(.bg-gradient-to-r)
  h5,
body.high-contrast.dark-mode
  section:not(footer):not(header):not(.bg-gradient-to-r)
  h6,
body.high-contrast.dark-mode
  section:not(footer):not(header):not(.bg-gradient-to-r)
  li,
body.high-contrast.dark-mode
  section:not(footer):not(header):not(.bg-gradient-to-r)
  span:not(.text-brand-blue):not(.gradient-text),
body.high-contrast.dark-mode
  section:not(footer):not(header):not(.bg-gradient-to-r)
  div:not(.text-brand-blue):not(.gradient-text) {
  color: #fff !important;
}

/* "Gotowy na rozwój Twojego biznesu online?" - "Twojego" should be turquoise (#5BC5D4) */
body.high-contrast.dark-mode section.bg-gradient-to-r h2 .text-brand-blue {
  color: #5bc5d4 !important;
}

/* Keep CTA section text white except for "Twojego" */
body.high-contrast.dark-mode section.bg-gradient-to-r h2 {
  color: #fff !important;
}

/* Dark Mode - Fully Dark with Purple Theme (only when high-contrast is NOT active) */
body.dark-mode:not(.high-contrast) {
  background: #0a0a0a !important;
  color: #e0e0e0 !important;
}

body.dark-mode:not(.high-contrast) header {
  background: linear-gradient(to bottom, #1a0a2e, #0a0a0a) !important;
  border-bottom: 2px solid #8b5cf6 !important;
}

body.dark-mode:not(.high-contrast) footer {
  background: #000 !important;
  border-top: 2px solid #8b5cf6 !important;
}

body.dark-mode:not(.high-contrast) .bg-white,
body.dark-mode:not(.high-contrast) .bg-gray-50,
body.dark-mode:not(.high-contrast) .bg-gray-100,
body.dark-mode:not(.high-contrast) [class*="bg-blue"],
body.dark-mode:not(.high-contrast) [class*="bg-cyan"] {
  background: #1a1a1a !important;
  color: #e0e0e0 !important;
}

body.dark-mode:not(.high-contrast) .text-gray-600,
body.dark-mode:not(.high-contrast) .text-gray-700,
body.dark-mode:not(.high-contrast) .text-gray-800,
body.dark-mode:not(.high-contrast) .text-gray-900 {
  color: #d0d0d0 !important;
}

body.dark-mode:not(.high-contrast) .text-brand-blue,
body.dark-mode:not(.high-contrast) .text-brand-blue-text,
body.dark-mode:not(.high-contrast) .text-cyan-400,
body.dark-mode:not(.high-contrast) .text-cyan-500 {
  color: #a78bfa !important;
}

body.dark-mode:not(.high-contrast) .bg-gradient-to-br,
body.dark-mode:not(.high-contrast) .bg-gradient-to-r,
body.dark-mode:not(.high-contrast) section {
  background: linear-gradient(to bottom right, #1a0a2e, #0a0a0a) !important;
}

body.dark-mode:not(.high-contrast) a {
  color: #c4b5fd !important;
}

body.dark-mode:not(.high-contrast) button,
body.dark-mode:not(.high-contrast) .btn {
  background: linear-gradient(to right, #7c3aed, #6d28d9) !important;
  border-color: #8b5cf6 !important;
  color: #fff !important;
}

/* Dark mode specific button fixes */
body.dark-mode:not(.high-contrast) a[href*="kontakt"],
body.dark-mode:not(.high-contrast) a.bg-white {
  background: transparent !important;
  color: #c4b5fd !important;
  border: none !important;
}

/* Remove purple border from email in top bar and footer */
body.dark-mode:not(.high-contrast) a[href^="mailto:"] {
  border: none !important;
  background: transparent !important;
}

/* Remove purple highlighting from dropdown buttons in main menu - make them same as regular links */
body.dark-mode:not(.high-contrast) nav button[aria-haspopup="true"],
body.dark-mode:not(.high-contrast) nav .nav-link-wrapper button,
body.dark-mode:not(.high-contrast) header nav button[aria-haspopup="true"] {
  color: #c4b5fd !important;
  background: transparent !important;
  border: none !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

/* Ensure dropdown buttons look same as regular nav links in dark mode */
body.dark-mode:not(.high-contrast) nav .nav-link-wrapper button:hover,
body.dark-mode:not(.high-contrast)
  header
  nav
  button[aria-haspopup="true"]:hover {
  color: #a78bfa !important;
  background: transparent !important;
  border: none !important;
}

/* Remove purple borders from footer links */
body.dark-mode:not(.high-contrast) footer a {
  border: none !important;
  background: transparent !important;
}

/* Remove purple borders from cookie settings */
body.dark-mode:not(.high-contrast) #cookieConsent a,
body.dark-mode:not(.high-contrast) #cookieSettings a {
  border: none !important;
  background: transparent !important;
}

/* Remove purple highlighting from "Ustawienia cookies" button in footer */
body.dark-mode:not(.high-contrast) footer button[onclick*="showCookieConsent"],
body.dark-mode:not(.high-contrast)
  footer
  button[onclick*="showCookieConsent"]:hover {
  color: #c4b5fd !important;
  border: none !important;
  background: transparent !important;
}

body.dark-mode:not(.high-contrast) a.bg-gradient-to-r {
  background: linear-gradient(to right, #7c3aed, #6d28d9) !important;
  color: #fff !important;
}

/* Dark mode System Monitor */
body.dark-mode:not(.high-contrast) #system-monitor {
  background: linear-gradient(to bottom right, #1a0a2e, #0a0a0a) !important;
}

body.dark-mode:not(.high-contrast) #system-monitor h2,
body.dark-mode:not(.high-contrast) #system-monitor p,
body.dark-mode:not(.high-contrast) #system-monitor i {
  color: #a78bfa !important;
}

body.dark-mode:not(.high-contrast) #system-monitor .bg-white {
  background: #1a1a1a !important;
  border-color: #8b5cf6 !important;
}

body.dark-mode:not(.high-contrast) #system-monitor .text-gray-500,
body.dark-mode:not(.high-contrast) #system-monitor .text-gray-600 {
  color: #9ca3af !important;
}

body.dark-mode:not(.high-contrast) #system-monitor .text-brand-blue-text {
  color: #c4b5fd !important;
}

body.dark-mode:not(.high-contrast) .border,
body.dark-mode:not(.high-contrast) [class*="border-"] {
  border-color: #8b5cf6 !important;
}

body.dark-mode:not(.high-contrast) input,
body.dark-mode:not(.high-contrast) select,
body.dark-mode:not(.high-contrast) textarea {
  background: #1a1a1a !important;
  border-color: #8b5cf6 !important;
  color: #e0e0e0 !important;
}

/* Wide Letter Spacing */
body.wide-spacing * {
  letter-spacing: 0.1em !important;
}

body.wide-spacing h1,
body.wide-spacing h2,
body.wide-spacing h3 {
  letter-spacing: 0.15em !important;
}

/* Dynamic Word Changer */
#dynamicWord {
  display: inline-block;
  min-width: 120px;
  text-align: left;
  line-height: inherit;
  padding-bottom: 0.15em;
  vertical-align: baseline;
  overflow: visible;
  height: auto;
}

/* Screen reader only - SEO visibility */
.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;
}

/* Ensure words are visible for SEO but hidden visually when not active */
#dynamicWord::before {
  content: attr(data-seo-text);
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Hero Section Spacing Adjustment - Reduced padding to take space from breadcrumbs */
#main-content > section:first-of-type {
  padding-top: 3rem !important;
  padding-bottom: 4rem !important;
}

@media (min-width: 768px) {
  #main-content > section:first-of-type {
    padding-top: 4rem !important;
    padding-bottom: 5rem !important;
  }
}
