/* Reset i podstawowe style */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  background-color: #0f0f0f; /* Ciemniejsze tło dla nowoczesnego wyglądu */
  color: #f5f5f5; /* Jasny tekst dla lepszego kontrastu */
}


/* Sekcje strony */
.section {
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background-color: #1e1e1e; /* Ciemne tło sekcji */
  padding: 20px 5%;
  border-bottom: 1px solid #333; /* Subtelna linia oddzielająca sekcje */
  box-sizing: border-box;
}

.section:nth-child(even) {
  background-color: #252525; /* Nieco jaśniejsze tło dla naprzemiennych sekcji */
}

/* Kontener przycisków przewijania */
.button-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 1000;
}

/* Canvas */
canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
}

/* Kontener z obrazkami */
.img-container {
  position: relative;
  width: clamp(300px, 50vw, 500px); /* Szerokość dostosowująca się do ekranu */
  max-width: 90%;
  flex-direction: column;
  height: fit-content;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  background-color: #2a2a2a; /* Ciemne tło kontenera */
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* Większy cień dla głębi */
  pointer-events: none;
}

/* Węzły (node) w kontenerze z obrazkami */
.node {
  width: 280px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16/11;
  background-color: #444; /* Ciemniejsze tło dla węzłów */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 12px;
  margin: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.node:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.node img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.3s ease;
  pointer-events: none;
}

img {
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
}


.node:hover img {
  transform: scale(1.1);
  pointer-events: none;
}

/* Pozycjonowanie węzłów */
#div1, #div3 {
  top: 0;
  left: 0;
  align-self: start;
}

#div2 {
  top: 32%;
  right: 0;
  align-self: end;
}

#div2,#div3 {
  margin-top: -2rem;
}


/* Przyciski przewijania */
.scroll {
  height: 70px;
  width: 70px;
  padding: 10px 20px;
  font-size: 10px;
  cursor: pointer;
  color: #f5f5f5;
  background-color: #444;
  border-radius: 50%;
  border: none;
  transition: transform 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.scroll:hover {
  transform: scale(1.1);
  background-color: #555;
}

/* Sekcja intro */
.intro {
  color: #f5f5f5;
  width: 400px;
  max-width: 90%;
  background-color: #2a2a2a;
  height: fit-content;
  margin: 20px;
  font-size: 1.2em;
  padding: 30px;
  border-radius: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #333;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.intro:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.intro-main {
  height: fit-content;
  width: 100%;
  box-sizing: border-box;
  background-color: #444;
  border: 1px solid #333;
  border-radius: 12px;
  font-size: .85em;
  padding: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.intro-main:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Bloki z tekstem (fiberIntro, networkSlide, radioIntro) */
.fiberIntro, .networkSlide, .radioIntro {
  width: 450px;
  max-width: 90%;
  padding: 30px;
  background-color: #2a2a2a;
  color: #f5f5f5;
  border-radius: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 20px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.fiberIntro, .networkSlide {
  margin: 20px;
}

.fiberIntro:hover, .networkSlide:hover, .radioIntro:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.fiber-main, .network-main, .radio-main {
  background-color: #444;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #333;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Gry - kontenery */
.fiberGame, .kable-main, .game-container {
  width: 500px;
  max-width: 95%;
  padding: 20px;
  background-color: #2a2a2a;
  color: #f5f5f5;
  border-radius: 15px;
  margin: 10px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #333;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

/* Gra z blokami */
#grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(30px, 50px));
  grid-template-rows: repeat(8, minmax(30px, 50px));
  gap: 2px;
  position: relative;
}

.cell {
  aspect-ratio: 1/1;
  width: 100%;
  height: 100%;
  background-color: #444;
  border: 1px solid #333;
  position: relative;
  border-radius: 4px;
}

/* Gra ze światłowodami */
#fiber-game-container {
  display: grid;
  grid-template-columns: repeat(7, minmax(35px, 60px));
  grid-template-rows: repeat(7, minmax(35px, 60px));
  gap: 3px;
  justify-content: center;
  margin-top: 20px;
}

.grid-cell {
  width: 100%;
  height: 100%;
  aspect-ratio: 1/1;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #444;
  border-radius: 8px;
}

.fiber-part, .grid-cell {
  width: 100%;
  max-width: 60px;
  height: auto;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Media Queries dla mniejszych ekranów */
@media (max-width: 768px) {
  .section {
    flex-direction: column;
    padding: 20px 2%;
    overflow-y: auto;
    justify-content: flex-start;
    height: auto;
    min-height: 100vh;
  }
  
  /* Podział na Slajdy (Każdy blok zajmuje min 100vh) */
  .intro, .img-container, 
  .game-container, .radioIntro,
  .networkSlide, .kable-main,
  .fiberGame, .fiberIntro {
    width: 95% !important;
    min-height: 95vh;
    margin: 30px auto !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px !important;
    box-sizing: border-box;
  }

  .img-container {
    display: flex;
    margin-left: 0;
  }

  .button-container {
    bottom: 5px;
    gap: 5px;
  }

  .scroll {
    height: 50px;
    width: 50px;
    font-size: 8px;
  }
}


.signal-bar {
  width: 100%;
  height: 20px;
  background-color: #555;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
}

.signal {
  height: 100%;
  background-color: #2ecc71;
  transition: width 0.3s ease;
}

.game-info {
  font-size: 18px;
  color: #f5f5f5;
}

.result {
  font-size: 24px;
  margin-top: 20px;
  font-weight: bold;
  color: #2ecc71;
}

.input-container {
  margin-top: 20px;
}

/* Pokrętło */
.knob-container {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto;
  border-radius: 50%;
  background-color: #555;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.knob {
  position: absolute;
  width: 10px;
  height: 100%;
  background-color: #e74c3c;
  transition: transform 0.1s ease;
  transform-origin: center;
}

/* Gra z blokami */
#section-3 {
  display: flex;
  justify-content: center;
}

#game-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #2a2a2a;
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  max-width: 100%;
}

#grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(30px, 45px));
  grid-template-rows: repeat(8, minmax(30px, 45px));
  gap: 3px;
  position: relative;
}

.cell {
  width: 100%;
  height: 100%;
  aspect-ratio: 1/1;
  background-color: #444;
  border: 1px solid #333;
  position: relative;
  border-radius: 4px;
}

/* Gra ze światłowodami */
#fiber-game-container {
  display: grid;
  grid-template-columns: repeat(7, minmax(35px, 55px));
  grid-template-rows: repeat(7, minmax(35px, 55px));
  gap: 3px;
  justify-content: center;
  margin-top: 20px;
}

.grid-cell {
  width: 100%;
  height: 100%;
  aspect-ratio: 1/1;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #444;
  border-radius: 6px;
}

.fiber-part {
  width: min(50px, 12vw);
  height: min(50px, 12vw);
  background-color: #555;
  border: 2px solid #333;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.fiber-part, .grid-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.block {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.3s ease;
}

.block.red {
  background-color: #e74c3c;
}

.block.blue {
  background-color: #3498db;
}

.block.green {
  background-color: #2ecc71;
}

.line-preview {
  position: absolute;
  width: 2px;
  background-color: transparent;
  z-index: 1;
  pointer-events: none;
}

.cell {
  user-select: none;
}

button {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  background-color: #3498db;
  color: #f5f5f5;
  border: none;
  border-radius: 8px;
  transition: transform 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:hover {
  transform: scale(1.05);
  background-color: #2980b9;
}

#win-message {
  margin-top: 20px;
  font-size: 18px;
  font-weight: bold;
  color: #2ecc71;
  display: none;
}

/* Gra ze światłowodami */
#fiber-game-container {
  display: grid;
  grid-template-columns: repeat(7, 60px);
  grid-template-rows: repeat(7, 60px);
  gap: 3px;
  justify-content: center;
  margin-top: 20px;
}

.grid-cell {
  width: 60px;
  height: 60px;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #444;
  border-radius: 8px;
}

.grid-cell img, .fiber-part img {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#fiber-parts {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.fiber-part {
  width: 60px;
  height: 60px;
  background-color: #555;
  border: 2px solid #333;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.fiber-part:hover {
  transform: scale(1.1);
}

#fiber-win-message {
  display: none;
  font-size: 20px;
  color: #2ecc71;
  margin-top: 20px;
}

#check-button {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  background-color: #3498db;
  color: #f5f5f5;
  border: none;
  border-radius: 8px;
  transition: transform 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#check-button:hover {
  transform: scale(1.05);
  background-color: #2980b9;
}
.fiber-part, .grid-cell {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

section > .warning {
  display:  none;
}
