#chat-box, #chat-box * {
  white-space: pre-wrap;  /* sortörés engedélyezése */
  word-break: break-word;  /* hosszú szavak törése */
}

body {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
    padding: 1rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    background-color: #121212;
    color: #eee;
}

header { text-align: center; margin-bottom: 1rem; }
select {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 2rem; /* növeltem az alatti margót */
  background-color: #1e1e1e;
  color: #eee;
  border: 1px solid #555;
}


/* Progress bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background-color: #2196f3;
    width: 0%;
    z-index: 30;
}

/* Kiemelt szó */
mark {
    background-color: #ffeb3b;
    color: #000;
    border-radius: 3px;
    padding: 0 2px;
}
#book-selector-section {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 2rem;
  background-color: #1e1e1e;
  color: #eee;
  border: 1px solid #555;
}



/* Könyvjelző gombok */
#bookmark-btn, #goto-bookmark-btn {
    position: fixed;
    bottom: 20px;
    width: 60px;
    height: 60px;
    font-size: 26px;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#bookmark-btn { right: 20px; background-color: #585858; }
#bookmark-btn:hover { background-color: #005fa3; }

#goto-bookmark-btn { right: 90px; background-color: #585858; }
#goto-bookmark-btn:hover { background-color: #1e7e34; }

/* Toast */
#toast {
    visibility: hidden;
    min-width: 200px;
    background-color: #333;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%);
    font-size: 16px;
    z-index: 40;
}

#toast.show {
    visibility: visible;
    animation: fadein 0.4s, fadeout 0.4s 2.2s;
}

@keyframes fadein { from { bottom: 60px; opacity: 0; } to { bottom: 90px; opacity: 1; } }
@keyframes fadeout { from { bottom: 90px; opacity: 1; } to { bottom: 60px; opacity: 0; } }
#auth-section {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  #login-btn {
    cursor: pointer;
  }

  #reset-password-btn{
    cursor: pointer;
  }
  .popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }
  
  .popup-content {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    text-align: center;
  }
  
  .popup-content input {
    width: 90%;
    margin-bottom: 10px;
    padding: 5px;
  }
  /* ===== CHATFAL ELRENDEZÉS ===== */
  #app-section {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    padding: 10px;
    max-width: 1300px;
    margin: 0 auto;
  }
  
  /* Bal oldal: könyv */
  #main-area {
    flex: 2;
  }
  
  /* Jobb oldal: chat */
  #chat-section {
    width: 100%;
    max-height: 800px;
    overflow-y: auto;
    background-color: #1e1e1e;
    color: #eee;
    padding: 10px;
    box-sizing: border-box;
    border-bottom: 2px solid #333;
  }
  
  #chat-box {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 10px;
  }
  
  #chat-input-area {
    display: flex;
    gap: 5px;
  }
  
  #chat-input-area input {
    flex: 1;
    padding: 5px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #121212;
    color: #eee;
  }
  
  #chat-input-area button {
    padding: 5px 10px;
    background-color: #0078d7;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
  }
  
  #chat-input-area button:hover {
    background-color: #005fa3;
  }
  #updateDisplayNameBtn {
    margin-top: 2rem; /* vagy akár több */
    cursor: pointer;
}

  #scrollToTop-btn {
    position: fixed;
    bottom: 20px;
    right: 160px; /* a másik két gomb mellett, kicsit balra */
    width: 60px;
    height: 60px;
    font-size: 26px;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    background-color: #585858; /* például narancssárga */
    transition: background-color 0.3s ease;
}

#scrollToTop-btn:hover {
    background-color: #ad1d1d;
}
#profile-section {
  display: none;
  background-color: #222;
  padding: 10px;
  border-radius: 6px;
  color: #eee;
}
#profile-edit-btn {
  font-size: 14px;       /* kisebb betűméret */
  font-weight: normal;   /* nem vastag */
  padding: 6px 12px;     /* kisebb padding */
  /* vagy egyéb finomítások */
}
#comic-container img {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  border-radius: 8px;
}
#comic-container {
  text-align: center;
}
/* Alapértelmezett (nem CBZ) */
#controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* CBZ mód */
.cbz-mode #controls {
  flex-direction: column;  /* függőleges elrendezés */
  position: fixed;
  right: 15px;
  bottom: 50px;
  gap: 8px;
}

/* CBZ gombok */
/* CBZ gombok kisebbre */
.cbz-mode #controls button {
  font-size: 6px;        /* kisebb betűméret */
  padding: 2px 3px;       /* kisebb belső margó */
  width: 15px;             /* kisebb szélesség */
  height: 15px;            /* kisebb magasság */
}
#cbzSelector {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 2rem;
  background-color: #1e1e1e;
  color: #eee;
  border: 1px solid #555;
}
/* ✅ Ha CBZ módban vagy, csak a vissza az oldal tetejére gomb látszódjon */
.cbz-mode #bookmark-btn,
.cbz-mode #goto-bookmark-btn {
  display: none !important;
}

.cbz-mode #scrollToTop-btn {
  display: block !important;
}
/* ✅ CBZ módban csak a vissza az oldal tetejére gomb látszódjon */
.cbz-mode #bookmark-btn,
.cbz-mode #goto-bookmark-btn {
  display: none !important;
}

/* ✅ CBZ módban a vissza az oldal tetejére gomb legyen teljesen jobb oldalon */
.cbz-mode #scrollToTop-btn {
  display: block !important;
  position: fixed;
  bottom: 20px;
  right: 15px;        /* teljesen a jobb szélhez */
  width: 60px;
  height: 60px;
  font-size: 26px;
  border-radius: 50%;
  background-color: #585858;
  color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  cursor: pointer;
  z-index: 100;       /* mindig látható maradjon */
  transition: background-color 0.3s ease;
}

.cbz-mode #scrollToTop-btn:hover {
  background-color: #8f1d1d;
}
#cbzPartSelector {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 2rem;
  background-color: #1e1e1e;
  color: #eee;
  border: 1px solid #555;
}
.chat-msg mark.mention {
  background-color: #ff9800;  /* narancssárga */
  color: #000;
  padding: 0 3px;
  border-radius: 4px;
}
