html {
  box-sizing: border-box;
  scroll-behavior: smooth;
  height: 100%; /* Ważne */
}
*, *::before, *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-main);
  background-image: radial-gradient(circle at 50% 30vh, #080d1b 0%, var(--bg-color) 50%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

#tsparticles, #mouse-glow {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}
#mouse-glow {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0, 247, 255, 0.08) 0%, rgba(0, 247, 255, 0) 60%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  opacity: 0;
}
body:hover #mouse-glow { opacity: 1; }

.main-header {
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}
.main-nav {
  display: flex;
  position: relative;
}
.nav-link {
  color: var(--text-secondary-color);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  transition: color 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
  font-size: 1rem;
  position: relative;
  z-index: 2;
}
.nav-link:hover { color: var(--text-color); }
.nav-link.active { color: var(--primary-color); }

.nav-underline {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background-color: var(--primary-color);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}

.lang-switcher {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  padding: 0.25rem;
}
.lang-btn {
  background: none;
  border: none;
  color: var(--text-secondary-color);
  padding: 0.5rem 1rem;
  border-radius: 7px;
  cursor: pointer;
  transition: 0.3s;
}
.lang-btn.active {
  background-color: var(--primary-color);
  color: var(--bg-color);
}

.hamburger-menu {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 2rem;
  cursor: pointer;
  z-index: 1001;
}

.page-loader {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.loader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 247, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-container {
  padding: 0 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  
  flex-grow: 1; 
  display: flex;
  flex-direction: column;
}

#app {
  opacity: 1;
  transition: opacity 0.2s ease-out;
  
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center; 
  width: 100%;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

body:not(.modal-open) .modal-overlay { display: none; }
.modal-overlay[style*="display: flex"] { display: flex !important; }

.modal-content {
  position: relative;
  padding: 2.5rem;
  max-width: 600px;
  width: 90%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  text-align: left;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.modal-close-btn {
  position: absolute;
  top: 10px; right: 10px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--text-secondary-color);
  font-size: 1.5rem;
  cursor: pointer;
  transition: 0.3s;
  z-index: 101;
}
.modal-close-btn:hover { color: var(--primary-color); transform: scale(1.1); }

.modal-content h3 { color: var(--primary-color); margin-bottom: 1rem; font-size: 1.5rem; }
.modal-content p { margin-bottom: 1.5rem; line-height: 1.6; color: var(--text-secondary-color); }

.modal-details {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem;
}
.detail-item {
  background: rgba(13, 2, 33, 0.5); padding: 0.75rem; border-radius: 5px;
  border-left: 3px solid var(--primary-color); color: var(--text-color); font-size: 0.9rem;
}
.modal-links { display: flex; gap: 1rem; margin-top: 1.5rem; }
.modal-link-btn {
  flex-grow: 1; text-align: center; padding: 0.75rem; border-radius: 8px;
  text-decoration: none; color: var(--text-color);
  background-color: rgba(255, 255, 255, 0.1); border: 1px solid var(--glass-border);
  transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.modal-link-btn:hover { background-color: var(--primary-color); color: var(--bg-color); }
.modal-link-btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

#modal-tags-container { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--glass-border); display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  background-color: rgba(0, 247, 255, 0.1);
  color: var(--primary-color);
  padding: 0.25rem 0.6rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(0, 247, 255, 0.2);
}

.history-item {
  position: relative; padding-left: 25px; margin-bottom: 1rem;
  color: var(--text-secondary-color); font-size: 0.95rem;
}
.history-item::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background-color: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-color);
}

.mobile-nav-overlay {
  position: fixed;
  top: 0; right: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 17, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}
.mobile-nav-overlay.is-open { transform: translateX(0); }

.mobile-nav-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: none; border: none;
  color: var(--text-color); font-size: 2.2rem;
  cursor: pointer;
  display: none; 
}

@media (max-width: 820px) {
  .main-nav, .lang-switcher { display: none; }
  .hamburger-menu { display: block; }
  .mobile-nav-close { display: block; }
}
@media (max-width: 768px) {
  .modal-details { grid-template-columns: 1fr; }
  .modal-links { flex-direction: column; }
}