/* style.css */

/* Definicja fioletowego koloru */
:root {
  --purple-glow: #a745ed; /* Główny fioletowy kolor */
  --purple-glow-light: rgba(167, 69, 237, 0.4); /* Jaśniejszy dla tła */
  --purple-glow-dark: rgba(167, 69, 237, 0.2); /* Ciemniejszy dla tła */
  --glass-bg-color: rgba(
    61,
    65,
    71,
    0.4
  ); /* Półprzezroczysty kolor tła dla glassmorph */
  --glass-border-color: rgba(
    255,
    255,
    255,
    0.2
  ); /* Kolor ramki dla glassmorph */
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #282c34;
  color: #e0e0e0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  flex-direction: column; /* Zmienione na column, aby ogłoszenie było na górze */

  background-image: url("img/back.png");
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  position: relative; /* Potrzebne dla pseudo-elementu */
}

/* Przyciemniająca warstwa na tle */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(
    0,
    0,
    0,
    0.5
  ); /* Półprzezroczysta warstwa przyciemniająca */
  z-index: -1;
}

.global-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
}

/* Style dla logo zamiast nagłówka H1 */
.header-logo {
  margin-bottom: 25px; /* Zachowaj podobny odstęp jak h1 */
  text-align: center; /* Wyśrodkowanie obrazu */
  /* Opcjonalnie: Ustawienie maksymalnej wysokości dla diva, jeśli obraz jest duży */
  max-height: 150px; /* Przykład, dostosuj do potrzeb */
  display: flex; /* Użyj flexboxa, aby lepiej wyśrodkować obraz */
  justify-content: center;
  align-items: center;
}

.header-logo img {
  max-width: 100%; /* Obraz będzie dopasowany do szerokości kontenera */
  height: auto; /* Zachowanie proporcji */
  max-height: 300px; /* Maksymalna wysokość logo, dostosuj do rozmiaru logo */
  object-fit: contain; /* Upewnij się, że całe logo jest widoczne */
  /* Dodanie fioletowej poświaty do logo, podobnej do tekstu */
  filter: drop-shadow(0 0 10px var(--purple-glow-light))
    drop-shadow(0 0 20px var(--purple-glow-light));
  transition: transform 0.3s ease; /* Płynne przejście na hover */
}

.header-logo img:hover {
  transform: scale(1.05); /* Delikatne powiększenie na najechaniu */
}

/* Responsywność dla logo */
@media (max-width: 480px) {
  .header-logo img {
    max-height: 100px; /* Mniejsza wysokość logo na małych ekranach */
  }
}

.listener-count {
  font-size: 1.1em;
  margin-bottom: 20px;
  color: #a0a0a0;
  text-align: center;
  /* Fioletowa poświata */
  text-shadow: 0 0 5px var(--purple-glow-dark);
}

.main-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
}

.radio-container {
  background-color: var(--glass-bg-color); /* Glassmorph tło */
  backdrop-filter: blur(10px); /* Efekt rozmycia */
  border: 1px solid var(--glass-border-color); /* Lekka ramka */
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 var(--purple-glow-dark),
    /* Poświata glassmorph */ 0 0 15px var(--purple-glow-light); /* Fioletowa poświata */
  padding: 30px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Płynne przejścia */
}

.radio-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 48px 0 var(--purple-glow),
    /* Intensywniejsza poświata na hover */ 0 0 25px var(--purple-glow);
}

.player-box {
  background-color: transparent; /* Tło player-boxa przezroczyste */
  border-radius: 10px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.album-art-wrapper {
  width: 250px;
  height: 250px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border: 3px solid var(--purple-glow); /* Fioletowa ramka */
  display: flex;
  justify-content: center;
  align-items: center;
}

#album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease-in-out;
}

.album-art-wrapper:hover #album-art {
  transform: scale(1.05);
}

.song-info {
  text-align: center;
  margin-top: 10px;
  width: 100%;
  overflow: hidden;
}

#song-title {
  font-size: 1.6em;
  margin: 0;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

#song-time {
  font-size: 1.1em;
  color: #a0a0a0;
  margin-top: 5px;
}

/* Nowe: Pasek postępu (ładniejszy) */
#progress-bar {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 90%;
  height: 8px; /* Zwiększona wysokość */
  background: #555; /* Domyślne tło */
  border-radius: 4px; /* Zaokrąglone rogi */
  outline: none;
  margin-top: 10px;
  cursor: default;
  /* Domyślny gradient będzie ustawiony przez JS */
  /* background: linear-gradient(to right, var(--purple-glow) 0%, #555 0%); */
  /* Usunięto, JS to ustawi */
}

/* Ukryj kciuk (slider thumb) jeśli przeglądarka go renderuje dla type="range" */
#progress-bar::-webkit-slider-thumb,
#progress-bar::-moz-range-thumb {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 0;
  height: 0;
  visibility: hidden;
}

.controls {
  margin-top: 15px;
  display: flex; /* Użyj flexbox dla przycisku i suwaka głośności */
  align-items: center;
  justify-content: center;
  gap: 15px; /* Odstęp między elementami */
  width: 100%;
}

/* Styl dla przycisku Play/Pause (zmniejszony) */
#play-pause-button {
  background-color: var(--purple-glow); /* Fioletowy kolor */
  color: #282c34;
  border: none;
  padding: 10px 15px; /* Zmniejszony padding */
  border-radius: 6px;
  font-size: 1em; /* Zmniejszony font-size */
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease,
    box-shadow 0.3s ease;
  outline: none;
  box-shadow: 0 0 10px var(--purple-glow-light); /* Delikatna poświata */
  flex-shrink: 0; /* Zapobiega zmniejszaniu */
}

#play-pause-button:hover {
  background-color: #923de1; /* Trochę ciemniejszy fiolet */
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--purple-glow); /* Intensywniejsza poświata */
}

#play-pause-button:active {
  transform: translateY(0);
}

#play-pause-button.paused {
  background-color: #ff6b6b; /* Czerwony gdy pauza */
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

#play-pause-button.paused:hover {
  background-color: #e05353;
  box-shadow: 0 0 15px rgba(255, 107, 107, 0.8);
}

#play-pause-button i {
  font-size: 1em; /* Rozmiar ikon */
}

/* Nowe: Suwak głośności */
#volume-slider {
  width: 100px; /* Domyślna szerokość */
  height: 6px;
  background: #555;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s;
  -webkit-appearance: none;
  border-radius: 3px;
  flex-grow: 1; /* Pozwala mu się rozszerzyć */
  max-width: 150px; /* Maksymalna szerokość */
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; /* Mniejszy kciuk */
  height: 16px;
  border-radius: 50%;
  background: #61dafb;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(97, 218, 251, 0.5);
}

#volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #61dafb;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(97, 218, 251, 0.5);
}

#volume-value {
  font-size: 0.9em;
  color: #a0a0a0;
  min-width: 40px; /* Zapewnij miejsce na tekst */
  text-align: right;
  flex-shrink: 0;
}

/* Style dla czatu */
.chat-wrapper {
  background-color: var(--glass-bg-color); /* Glassmorph tło */
  backdrop-filter: blur(10px); /* Efekt rozmycia */
  border: 1px solid var(--glass-border-color); /* Lekka ramka */
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 var(--purple-glow-dark),
    /* Poświata glassmorph */ 0 0 15px var(--purple-glow-light); /* Fioletowa poświata */
  padding: 20px;
  width: 100%;
  max-width: 400px;

  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Płynne przejścia */
}

.chat-wrapper:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 48px 0 var(--purple-glow),
    /* Intensywniejsza poświata na hover */ 0 0 25px var(--purple-glow);
}

#toggle-chat-button {
  background-color: var(--purple-glow); /* Fioletowy kolor */
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  margin-bottom: 15px; /* Przywrócony margines */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  box-shadow: 0 0 10px var(--purple-glow-light);
}

#toggle-chat-button:hover {
  background-color: #923de1;
  box-shadow: 0 0 15px var(--purple-glow);
}

#chat-box {
  background-color: var(--glass-bg-color); /* Glassmorph tło dla chat-box */
  border-radius: 8px;
  padding: 15px;
  border: 1px solid var(--glass-border-color);
  backdrop-filter: blur(8px);
  height: 510px;
  max-height: 510px;
  /* Usunięto margin-top: 0; */
}

#chat-messages {
  height: 350px;
  overflow-y: auto;
  border: 1px solid var(--purple-glow-dark); /* Fioletowa ramka */
  border-radius: 5px;
  margin-bottom: 15px;
  padding: 10px;
  background-color: rgba(
    34,
    37,
    42,
    0.6
  ); /* Ciemniejsze, lekko przezroczyste tło */
  color: #e0e0e0;
  text-align: left;
  font-size: 0.9em;
  display: flex;
  flex-direction: column;
}

.chat-message {
  margin-bottom: 8px;
  word-wrap: break-word; /* Wymuś zawijanie długich słów */
  overflow-wrap: break-word; /* Alternatywa dla word-wrap */
  word-break: break-all; /* Dodatkowe zabezpieczenie dla bardzo długich słów bez spacji */
  display: flex;
  align-items: baseline;
}

.chat-nick {
  font-weight: bold;
  color: var(--purple-glow); /* Fioletowy kolor nicku użytkownika */
  white-space: nowrap;
  margin-right: 5px;
  flex-shrink: 0;
}

.admin-nick {
  color: #ff6b6b;
}

.chat-text {
  flex-grow: 1;
}

.chat-timestamp {
  font-size: 0.7em;
  color: #888;
  margin-left: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

#chat-form {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

#nick-input,
#message-input {
  padding: 10px;
  border: 1px solid var(--purple-glow-dark); /* Fioletowa ramka */
  border-radius: 5px;
  background-color: rgba(58, 63, 71, 0.7); /* Półprzezroczyste tło */
  color: #e0e0e0;
  font-size: 0.9em;
  outline: none;
  box-shadow: 0 0 5px var(--purple-glow-dark);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

#nick-input:focus,
#message-input:focus {
  border-color: var(--purple-glow);
  box-shadow: 0 0 8px var(--purple-glow-light);
}

#nick-input {
  flex-basis: 35%;
  flex-grow: 1;
  min-width: 80px;
}

#message-input {
  flex-basis: calc(65% - 10px);
  flex-grow: 2;
  min-width: 150px;
}

#chat-form button[type="submit"] {
  background-color: var(--purple-glow);
  color: #282c34;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
  flex-basis: 100%;
  box-shadow: 0 0 10px var(--purple-glow-light);
}

#chat-form button[type="submit"]:hover {
  background-color: #923de1;
  box-shadow: 0 0 15px var(--purple-glow);
}

.hidden {
  display: none;
}

/* Usunięto: Nowe: Style dla paska ogłoszeń i animacji */

/* NOWE STYLE DLA PANELU ADMINA W index.html */
.admin-panel-in-page {
  background-color: var(--glass-bg-color);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 var(--purple-glow-dark),
    0 0 15px var(--purple-glow-light);
  padding: 30px;
  width: 100%;
  max-width: 400px; /* Taka sama szerokość jak radio-container i chat-wrapper */
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-right: 20px; /* Odstęp od reszty elementów */
}

.admin-panel-in-page:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 48px 0 var(--purple-glow), 0 0 25px var(--purple-glow);
}

.admin-panel-in-page h1 {
  color: #61dafb;
  margin-bottom: 25px;
  font-size: 2em; /* Dostosuj rozmiar, aby pasował do h1 */
}

.admin-panel-in-page h2 {
  color: #90ee90;
  margin-top: 25px;
  margin-bottom: 15px;
  font-size: 1.3em; /* Dostosuj rozmiar, aby pasował do h2 */
}

.admin-panel-in-page .current-song-status {
  background-color: rgba(58, 63, 71, 0.7);
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.admin-panel-in-page #admin-current-song-title {
  font-size: 1.4em;
  color: #fff;
  margin: 10px 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.admin-panel-in-page #admin-current-time,
.admin-panel-in-page #admin-total-duration {
  color: #ccc;
  font-size: 1em;
}

.admin-panel-in-page #seek-slider {
  width: 90%;
  height: 8px;
  background: #555;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s;
  -webkit-appearance: none;
  margin-top: 15px;
  border-radius: 5px;
}

.admin-panel-in-page #seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #61dafb;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(97, 218, 251, 0.5);
}

.admin-panel-in-page #seek-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #61dafb;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(97, 218, 251, 0.5);
}

.admin-panel-in-page .controls button {
  background-color: #61dafb;
  color: #2a2a2a;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  outline: none;
  margin: 5px;
}

.admin-panel-in-page .controls button:hover {
  background-color: #4fa3d1;
  transform: translateY(-1px);
}

.admin-panel-in-page .search-box {
  margin: 20px 0;
  display: flex;
  gap: 10px;
}

#search-input {
  flex-grow: 1;
  padding: 10px;
  border: 1px solid #61dafb;
  border-radius: 5px;
  background-color: rgba(58, 63, 71, 0.7);
  color: #e0e0e0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1em;
  outline: none;
}

#search-input::placeholder {
  color: #a0a0a0;
}

#reset-search-button {
  background-color: #ff6b6b;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease;
  outline: none;
}

#reset-search-button:hover {
  background-color: #e05353;
}

.admin-panel-in-page #playlist {
  list-style-type: none;
  padding: 0;
  max-height: 250px; /* Trochę mniejsza wysokość */
  overflow-y: auto;
  text-align: left;
  background-color: rgba(58, 63, 71, 0.7);
  border-radius: 5px;
  padding: 10px 0;
}

.admin-panel-in-page #playlist li {
  padding: 8px 15px;
  cursor: pointer;
  border-bottom: 1px solid #4a4a4a;
  transition: background-color 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-panel-in-page #playlist li:last-child {
  border-bottom: none;
}

.admin-panel-in-page #playlist li:hover {
  background-color: #4a4a4a;
}

.admin-panel-in-page #playlist li.active {
  background-color: #007bff;
  color: white;
  font-weight: bold;
}

.admin-panel-in-page #playlist li .song-info-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  margin-right: 10px;
}

.admin-panel-in-page #playlist li .song-duration {
  color: #aaa;
  font-size: 0.9em;
  flex-shrink: 0;
}

/* Usunięto: Style dla sekcji ogłoszeń admina */

/* Style dla czatu admina w panelu */
.admin-chat-section {
  margin-top: 30px;
  background-color: rgba(58, 63, 71, 0.7);
  border-radius: 8px;
  padding: 20px;
}

.admin-chat-section h2 {
  margin-top: 0;
}

.admin-chat-messages {
  height: 200px; /* Mniejsza wysokość */
  overflow-y: auto;
  border: 1px solid #61dafb;
  border-radius: 5px;
  margin-bottom: 15px;
  padding: 10px;
  background-color: rgba(47, 52, 58, 0.8);
  text-align: left;
  font-size: 0.9em;
  display: flex;
  flex-direction: column;
}

.admin-chat-message {
  margin-bottom: 8px;
  word-wrap: break-word; /* Wymuś zawijanie długich słów */
  overflow-wrap: break-word; /* Alternatywa dla word-wrap */
  word-break: break-all; /* Dodatkowe zabezpieczenie dla bardzo długich słów bez spacji */
  display: flex;
  align-items: baseline;
}

.admin-chat-message .chat-nick {
  font-weight: bold;
  color: #61dafb;
  white-space: nowrap;
  margin-right: 5px;
  flex-shrink: 0;
}

.admin-chat-message .admin-nick {
  color: #ff6b6b;
}

.admin-chat-message .chat-text {
  flex-grow: 1;
}

.admin-chat-message .chat-timestamp {
  font-size: 0.7em;
  color: #888;
  margin-left: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.delete-chat-button {
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 0.7em;
  cursor: pointer;
  margin-left: 10px;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.delete-chat-button:hover {
  background-color: #c82333;
}

.admin-chat-input-box {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

#admin-chat-message-input {
  flex-grow: 1;
  padding: 10px;
  border: 1px solid #61dafb;
  border-radius: 5px;
  background-color: rgba(58, 63, 71, 0.7);
  color: #e0e0e0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.9em;
  outline: none;
}

#admin-send-chat-message {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.3s ease;
  outline: none;
}

#admin-send-chat-message:hover {
  background-color: #218838;
}

/* Nowe: Sekcja wylogowania admina */
.admin-logout-section {
  margin-top: 30px;
}

#admin-logout-button {
  background-color: #6c757d; /* Szary */
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease;
  outline: none;
}

#admin-logout-button:hover {
  background-color: #5a6268;
}

/* Responsywność dla ekranów mniejszych niż 850px */
@media (max-width: 850px) {
  .main-layout {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }

  .radio-container,
  .chat-wrapper,
  .admin-panel-in-page {
    /* Dodano admin-panel-in-page */
    max-width: 400px;
    width: 100%;
    margin-right: 0; /* Usuń margines, gdy w kolumnie */
  }

  /* Usunięto: Dostosuj ogłoszenie na mniejszych ekranach */
}

/* Responsywność dla jeszcze mniejszych ekranów */
@media (max-width: 480px) {
  .global-wrapper {
    padding: 10px;
  }
  .radio-container,
  .chat-wrapper {
    padding: 20px;
  }
  .album-art-wrapper {
    width: 200px;
    height: 200px;
  }
  h1 {
    font-size: 1.8em;
  }
  #song-title {
    font-size: 1.4em;
  }
  #play-pause-button {
    padding: 8px 12px;
    font-size: 0.9em;
  }
  .controls {
    flex-wrap: wrap; /* Pozwól elementom zawijać się na mniejszych ekranach */
    gap: 10px;
  }
  #volume-slider {
    width: 100%; /* Pełna szerokość na małych ekranach */
    max-width: none;
  }
  #volume-value {
    text-align: center;
    width: 100%;
  }

  /* Usunięto: Dostosuj ogłoszenie na mniejszych ekranach */

  /* Usunięto: Responsywność dla inputów ogłoszeń */
}
