/* ===== BUTTONS ===== */
.btn {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-bold);
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 44px;
  /* Touch target size */
}

.btn-primary {
  background: var(--gradient);
  color: #000000;
  border: 1px solid transparent;
}

.btn-primary:hover,
.btn-primary:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px oklch(from var(--brand) 0.5 calc(c/2) h / 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid oklch(0.8 0 0 / 0.2);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover,
.btn-ghost:focus {
  background: oklch(0.8 0 0 / 0.1);
  border-color: oklch(0.8 0 0 / 0.3);
  transform: translateY(-1px);
}

/* Electric button - simplified */
.btn-electric {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #000000;
  border: 2px solid var(--brand);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-xl);
  font-weight: var(--font-weight-bold);
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(111, 179, 0, 0.3);
  transition: all 0.3s ease;
}

.btn-electric:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(111, 179, 0, 0.4);
  border-color: var(--brand-dark);
}

/* Button animations - simplified */
.btn {
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s ease;
}

.btn.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Service card buttons should animate with the card */
.service-card .btn {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease;
}

/* Large button variant */
.btn-large {
  padding: var(--space-md) var(--space-2xl);
  font-size: 1.25rem;
}

/* ===== PLACEHOLDER SECTIONS ===== */
.services,
.portfolio,
.contact {
  padding: var(--space-2xl) var(--space-md);
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-2xl);
  color: var(--fg);
}

/* Animation dla section-title gdy używa animate-on-scroll */
.section-title.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-title.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ===== CARD COMPONENTS ===== */
.contact-card {
  background: var(--gradient);
  color: var(--fg);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(147, 228, 1, 0.2);
  transition: transform var(--transition-normal);
}

.contact-card:hover {
  transform: translateY(-4px);
}

.contact-card-title {
  font-size: 1.875rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
}

.contact-card-description {
  font-size: 1.125rem;
  opacity: 0.9;
  line-height: 1.6;
}

/* ===== SOCIAL LINKS ===== */
.social-links {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

.social-link {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.8 0 0 / 0.1);
  border: 1px solid oklch(0.8 0 0 / 0.2);
  border-radius: 50%;
  color: var(--muted);
  font-weight: var(--font-weight-bold);
  font-size: 0.875rem;
  transition: background var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal), transform var(--transition-normal);
}

.social-link:hover {
  background: var(--brand);
  color: var(--fg);
  border-color: var(--brand);
  transform: translateY(-2px);
}

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 52px;
  height: 52px;
  background: rgba(30, 30, 30, 0.9);
  border: 1px solid #333;
  border-radius: 50%;
  color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover,
.scroll-to-top:focus {
  transform: translateY(-4px);
  background: rgba(147, 228, 1, 0.15);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 8px 30px rgba(111, 179, 0, 0.4);
  outline: none;
}

.scroll-to-top:active {
  transform: translateY(-2px);
}

.scroll-to-top svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.scroll-to-top:hover svg {
  transform: translateY(-2px);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
  }

  .scroll-to-top svg {
    width: 18px;
    height: 18px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .scroll-to-top {
    border: 2px solid var(--brand);
    box-shadow: none;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .scroll-to-top {
    transition: none;
  }

  .scroll-to-top:hover,
  .scroll-to-top:focus {
    transform: none;
  }
}

/* ===== UTILITY CLASSES ===== */
.nav-cta {
  display: none;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .btn-large {
    padding: var(--space-sm) var(--space-xl);
    font-size: 1.1rem;
  }

  .nav-cta {
    display: none;
  }
}

@media (max-width: 480px) {
  .contact-card {
    padding: var(--space-lg);
    margin: var(--space-md);
  }

  .btn-large {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
  }
}

/* ===== PRE ELEMENTS FIX ===== */
pre, pre code {
  box-sizing: border-box;
  max-width: 100%;
}

/* 1) domyślnie: preferujemy zawijanie, by nie psuć mobilności */
pre.pre-wrap {
  white-space: pre-wrap;    /* zachowuje nowe linie, ale zawija długie wiersze */
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 2) jeśli to fragmenty kodu i chcemy oryginalne łamanie linii, ale przewijalne */
pre.pre-scroll {
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
