/* ================================================================
   GŁÓWNY STYL CSS DLA APLIKACJI SŁOWNIKA GWARY GNIEŹNIEŃSKIEJ
   ================================================ */

.app {
  font-family: Arial, sans-serif;
  margin: 20px;
}

/* Ikony */
.icon {
  width: 1.2em;
  height: 1.2em;
  vertical-align: middle;
  fill: currentColor;
  opacity: 0.8;
  margin-right: 4px;
  transition: opacity 0.2s ease;
}

.icon:hover {
  opacity: 1;
}

/* === Górna sekcja nagłówka z logo i panelem użytkownika === */
.header__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f4f4f4;
  border-radius: 10px 10px 0 0;
  border: 1px solid #ddd;
  padding: 15px 40px;
}

/* Lewa strona z logo i tytułem */
.header__left {
  display: flex;
  align-items: center;
  gap: 25px;
}

/* Logo większe i wyśrodkowane pionowo */
.header__logo {
  height: 110px;
  display: block;
  object-fit: contain;
}

/* Blok tytułów – wyrównanie pionowe do środka logo */
.header__titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.3;
}

/* Tytuł i podtytuł */
.header__title {
  font-size: 26px;
  font-weight: bold;
  margin: 0;
  color: #111;
}

.header__subtitle {
  font-size: 14px;
  color: #666;
  margin: 4px 0 0 0;
  font-style: italic;
}

/* === Panel użytkownika (po prawej) === */
.header__user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

#user-info {
  color: #333;
  font-size: 15px;
  font-weight: 500;
  margin-right: 5px;
}

.user-btn {
  background: #333;
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.3s, transform 0.2s;
}

.user-btn:hover {
  background: #cf4040;
  transform: scale(1.05);
}

.user-btn.hidden {
  display: none;
}

/* === Pasek nawigacji pod spodem === */
.nav {
  background: #333;
  padding: 10px 0;
  margin: 0.8em 0;
}

.nav__list {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 25px;
  margin: 0;
  padding: 0;
}

.nav__link {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 8px 14px;
  border-radius: 6px;
  transition: background-color 0.3s, color 0.3s;
}

.nav__link:hover {
  background: #555;
}


/* Baner */
.banner {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  padding: 10px 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.banner__text {
  font-size: 14px;
}

.banner__close {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #856404;
}
/* Przycisk z filtrami */
.filters-toggle {
  margin: 10px 0;
  padding: 6px 12px;
  cursor: pointer;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 6px;
  position: relative;
  z-index: 2;   /* filtry zawsze wyżej niż litery */
}

/* === Pasek wyszukiwania i filtry === */
.search-with-filters {
  width: 45%;
  margin-bottom: 1rem;
}

.search-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

/* Input z lupą */
.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

.controls__search {
  width: 100%;
  padding: 8px 12px 8px 38px; /* miejsce na ikonę */
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* Przycisk filtry po prawej */
.filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.filters-toggle:hover {
  background: #000;
}

.icon-filter-toggle {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.filters-toggle.active .icon-filter-toggle {
  transform: rotate(180deg);
}

/* === PANEL FILTRÓW (zwarty układ) === */
.filters-panel {
  display: flex;
  width: auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 16px;
  margin-top: 10px;
  animation: fadeIn 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
   width: fit-content;
  max-width: 100%;
}

.filters-panel.hidden {
  display: none !important;
}

/* Grupa label + pole obok siebie */
.filters-panel label {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
}

.filters-panel select {
  height: 32px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 14px;
}

.filters-panel select:disabled {
  background: #eee;
  color: #777;
}

/* Checkbox audio */
.only-audio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-weight: 600;
  white-space: nowrap;
  color: #444;
}

.only-audio-label input {
  width: 16px;
  height: 16px;
}

/* Responsywność — w kolumnie na mobile */
@media (max-width: 768px) {
  .filters-panel {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .only-audio-label {
    margin-left: 0;
  }

  .filters-panel label {
    width: 100%;
    justify-content: space-between;
  }
}

/* === Przycisk losowania słowa === */
.random-btn {
  margin: 15px 0;
  padding: 10px 18px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  transition: background 0.3s, transform 0.2s;
  display: inline-block;
}

.random-btn:hover {
  background: #555;
  transform: scale(1.05);
}

/* Animacja pojawiania się */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* === Animacja zamykania modali === */
.modal.fade-out {
  animation: fadeOut 0.25s ease forwards;
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95); }
}


/* Alfabet przewijany */
.alphabet {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  padding: 5px 0;
  border-bottom: 1px solid #ddd;
  scrollbar-width: thin;
  position: relative;
  z-index: 1;   /* litery są pod filtrami */
}

.alphabet::-webkit-scrollbar {
  height: 6px;
}

.alphabet::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.alphabet__letter {
  display: inline-block;
  min-width: 35px;
  text-align: center;
  margin: 2px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  flex-shrink: 0;
  background: #f9f9f9;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.alphabet__letter:hover {
  background: #333;
  color: white;
  border-color: #333;
}

.alphabet__letter--active {
  background: #cf4040;
  color: white;
  border-color: #cf4040;
}

.alphabet__letter:focus {
  outline: none;
}

.info {
  margin: 10px 0;
  font-size: 14px;
  color: #555;
}

.list:empty {
  position: relative;
  min-height: 80px;
}

/* Animacja spinnera */
.spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  margin-left: -20px;
  border-radius: 50%;
  border: 3px solid #ccc;
  border-top-color: #333;
  animation: spinner 0.8s linear infinite;
  z-index: 10000;
  display: none;
}

.spinner.active {
  display: block;
}

/* === Spinner dolny (podczas infinite scrolla na telefonie) === */
.scroll-bottom-spinner {
  width: 30px;
  height: 30px;
  margin: 20px auto;
  border-radius: 50%;
  border: 3px solid #ccc;
  border-top-color: #333;
  animation: spinner 0.8s linear infinite;
}

/* Spinner dla modalu losowania słowa */
.modal-spinner {
  width: 40px;
  height: 40px;
  margin: 40px auto;
  border-radius: 50%;
  border: 3px solid #ccc;
  border-top-color: #333;
  animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* === Link do szczegółu słowa === */
.word__text {
  display: block;
  font-size: 20px;
  color: #222;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.word__text:hover {
  color: #cf4040;
  transform: translateX(3px);
  text-decoration: underline;
}

/* Kontener słowa */
.word {
  padding: 12px 10px;
  border-bottom: 1px solid #ddd;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.word:hover {
  background: #f9f9f9;
}

/* Nagłówek słowa z przyciskiem audio */
.word__header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.list-audio-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: #444;
  transition: color 0.2s ease;
}

.audio-btn:hover {
  color: #000;
}

/* Znaczenie i kategorie */
.word__meaning {
  color: #444;
  margin-left: 10px;
  font-size: 18px;
}

.word__categories {
  color: #777;
  margin-left: 10px;
  font-size: 14px;
}


/* Paginacja */
.pagination {
  margin: 20px 0;
  text-align: center;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination__btn {
  padding: 6px 12px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  color: #333;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.pagination__btn:hover {
  background: #333;
  color: #fff;
  border-color: #333;
}

.pagination__btn--active {
  background: #333;
  color: #fff;
  border-color: #333;
  font-weight: bold;
  cursor: default;
}

.pagination__dots {
  display: inline-block;
  padding: 6px 10px;
  color: #cf4040;
  font-size: 24px;
}

/* Stopka */
.footer {
  background-color: #f4f4f4;
  border-top: 1px solid #ddd;
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: #444;
}

.footer__text {
  margin-bottom: 15px;
}

.footer__logos {
  margin: 15px 0;
}

.footer__logo {
  height: 60px;
  margin: 0 10px;
  vertical-align: middle;
}

.footer__source {
  font-size: 13px;
  color: #666;
  margin-top: 15px;
}

.footer__version {
  margin-top: 10px;
  font-size: 12px;
  color: #999;
}

/* === Baner cookies === */
.cookie-banner {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(200%);
  z-index: 9999;
  background: rgba(31, 31, 31, 0.8);
  color: #f5f5f5;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  font-size: 0.95rem;
  max-width: 700px;
  width: 90%;
  text-align: center;
  transition: transform 0.4s ease;
}

.cookie-banner:not(.hidden) {
  transform: translateX(-50%) translateY(0);
}

.cookie-content p {
  margin: 0;
  line-height: 1.5;
}

.cookie-content a {
  color: #ffd966;
  font-weight: 500;
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.cookie-btn {
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.cookie-btn.accept {
  background: #28a745;
  color: #fff;
}

.cookie-btn.accept:hover {
  background: #23963e;
}

.cookie-btn.decline {
  background: transparent;
  color: #ddd;
  border: 1px solid #555;
}

.cookie-btn.decline:hover {
  background: #333;
  border-color: #666;
}

/* Powiadomienia */
.message-container {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}
/* Przycisk powrotu na górę */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 45px;
  height: 45px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 10%;
  font-size: 20px;
  cursor: pointer;
  display: none;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: background-color 0.3s, transform 0.2s;
}
.back-to-top .icon {
margin: 0;
}

.back-to-top:hover {
  background: #555;
  transform: scale(1.1);
}

/* Powiadomienia */
.message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 500;
  min-width: 280px;
  max-width: 90vw;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
  pointer-events: auto;
}

.message.visible {
  opacity: 1;
  transform: translateY(0);
}

.msg-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.message--success {
  border-color: #bde5b8;
  background: #edf9ed;
  color: #256029;
}

.message--error {
  border-color: #f4bebe;
  background: #fbeaea;
  color: #7b1113;
}

.message--warning {
  border-color: #ffe9a9;
  background: #fff7df;
  color: #7a5200;
}

.message--info {
  border-color: #b8e2f2;
  background: #e8f6fb;
  color: #055f7a;
}

.message-container .message {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/*Mobilne – ekrany do 768px */
@media (max-width: 768px) {
  .header__top {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 20px;
  }

  .header__left {
    flex-direction: column;
    align-items: center;
  }

  .header__logo {
    height: 100px;
  }

  .header__title {
    font-size: 20px;
  }

  .header__subtitle {
    font-size: 13px;
  }

  .header__user-panel {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav {
    margin: 0;
  }

  .nav__list {
    flex-direction: column;
    align-items: center;
  }

  .nav__list li {
    margin: 0px 0;
  }

  .search-with-filters {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    display: flex;
    align-items: center;
    width: 100%;
  }

  .search-box input {
    flex: 1;
  }

  .filters-toggle {
    margin-left: 8px;
  }

  .filters-panel {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: 10px;
    box-sizing: border-box;
  }

  .filters-panel label {
    display: block;
    margin: 10px 0 4px;
    font-size: 14px;
    font-weight: bold;
  }

  .filters-panel select {
    display: block;
    width: 100%;
    padding: 6px;
    font-size: 14px;
  }

  /* alfabet też przewijany */
  .alphabet {
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .pagination {
    display: none;
  }

  .word {
    padding: 12px 6px;
  }

  .pagination__btn {
    padding: 4px 6px;
    font-size: 12px;
  }
}

/* Bardzo małe ekrany – do 480px */
@media (max-width: 480px) {
  .header__title {
    font-size: 20px;
  }

  .header__subtitle {
    font-size: 13px;
  }
}