/* ── Basic pop-up menu (taken from the original theme) ───────────────────────────────────────────── */
#dimoverlay {
  visibility: hidden;
  z-index: 6;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: rgba(0,0,0,0.75);
  display: block;
}

.popupmenu {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9;
  padding: 0;
  overflow: auto;
  max-height: 90vh;
}

.popupmenu[style*="display: inline"],
.popupmenu[style*="display:inline"] {
  display: flex !important;
  flex-direction: column;
}

#pageselector { width: 420px; }
#searchbox    { width: 420px; }
#settingsbox  { width: 420px; }

#bookdetails {
  width: min(760px, 95vw);
  background: #1c1c1c;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  font-family: 'Noto Sans', sans-serif;
  color: #ffffff;
}

/* ── Content of the details popup ────────────────────────────────────────────────────────────────── */
#details {
  display: flex;
  flex-direction: column;
  padding: 28px 32px 0;
}

#details_upper_row {
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: flex-start;
}

#details_cover_progress {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

#details_cover img {
  width: 180px;
  border-radius: 6px;
  border: 3px solid #aaaaaa;
  display: block;
}

#details_right_col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

#details_info_panel {
  display: flex;
  flex-direction: column;
}

#details_title {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.2;
}

#details_authors {
  font-size: 15px;
  font-weight: 700;
  color: #4ca2d8;
  margin-bottom: 6px;
}

#details_series {
  font-size: 16px;
  color: #aaaaaa;
  margin-bottom: 16px;
}

/* #details_series::before {
  content: url('/theme/library/series.svg');
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 8px;
  vertical-align: -0.4em;
  opacity: 0;
  filter: invert(1);
} */

#details_tags {
  font-size: 15px;
  color: #aaaaaa;
  font-style: italic;
  margin-bottom: 6px;
}

#details_tags::before {
  content: url('/theme/common/icon-tag.svg');
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 16px;
  vertical-align: -0.4em;
  opacity: 0.5;
}

#details_language {
  font-size: 15px;
  color: #aaaaaa;
  margin-bottom: 6px;
}

#details_language::before {
  content: url('/theme/common/icon-language.svg');
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 16px;
  vertical-align: -0.4em;
  opacity: 0.5;
}

#details_file {
  font-size: 15px;
  color: #888888;
  margin-bottom: 16px;
}

#details_file::before {
  content: url('/theme/common/icon-file.svg');
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 16px;
  vertical-align: -0.4em;
  opacity: 0.5;
}

#details_publication {
  font-size: 13px;
  font-style: italic;
  color: #888888;
  margin-bottom: 12px;
}

.details_rating { display: none; }

#details_button_row {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 16px;
}

#details_close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: #252525;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  z-index: 10;
}

#details_close::after {
  content: '×';
  color: #aaa;
  font-size: 20px;
  line-height: 1;
  font-family: 'Noto Sans', sans-serif;
}

#details_close:hover { background: #4ca2d8; }

#details_close:hover::after { color: #fff; }

#details_description {
  clear: both;
  text-align: left;
  color: #bbbbbb;
  font-size: 13px;
  line-height: 1.75;
  padding: 16px 32px 24px;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 8px;
  overflow-y: auto;
  white-space: pre-line; /* preserves the \n characters in the XML */
}

/* ── Action buttons ──────────────────────────────────────────────────────────────────────────────── */
#details_download {
  display: inline-block;
  width: 64px;
  height: 32px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.5;
  transition: opacity 0.2s;
}

#details_download:hover { opacity: 1; }

#details_read {
  display: inline-block;
  width: 64px;
  height: 32px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.5;
  transition: opacity 0.2s;
}

#details_read:hover { opacity: 1; }

#details_mark_unread {
  display: inline-block;
  width: 64px;
  height: 32px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.5;
  transition: opacity 0.2s;
}

#details_mark_unread:hover { opacity: 1; }

#details_mark_finished {
  display: inline-block;
  width: 64px;
  height: 32px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.5;
  transition: opacity 0.2s;
}

#details_mark_finished:hover { opacity: 1; }

/* ── Progress bar ────────────────────────────────────────────────────────────────────────────────── */
.details_progress_bar {
  width: 100%;
  background: #2e2e2e;
  padding: 2px;
  border-radius: 2px;
  margin-top: 8px;
}

.details_progress_bar_fill {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: #4ca2d8;
  width: var(--value);
}

/* ── Progress bar on the cover ───────────────────────────────────────────────────────────────────── */
.cover_progress_bar {
  position: relative;
  bottom: 1.2rem;
  margin: 0 auto;
  width: 80%;
  background: #2e2e2e;
  padding: 1px;
}

.cover_progress_bar_fill {
  display: block;
  height: 3px;
  background: #4ca2d8;
  width: var(--value);
}

#progressbar {
  position: relative;
  top: 80px;
  margin: auto;
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: #4ca2d8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Settings box ────────────────────────────────────────────────────────────────────────────────── */
#settingsbox {
  background: #1c1c1c !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 14px !important;
  padding: 28px 32px !important;
  font-family: 'Noto Sans', sans-serif !important;
  color: #ffffff !important;
  width: min(520px, 95vw) !important;
}

.popuptitle {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  padding-bottom: 16px !important;
  margin-bottom: 20px !important;
  border-bottom: 1px solid rgba(255,255,255,0.07) !important;
  text-align: center !important;
}

.categorytitle {
  color: #4ca2d8 !important;
  text-transform: capitalize !important;
}

.sectiontitle {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin: 20px 0 12px !important;
  text-align: center !important;
  width: 100% !important;
}

/* ── Labels radio style boutons ──────────────────────────────────────────────────────────────────── */
.radiolabel {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: #252525 !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  margin: 4px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  width: 180px !important;
}

.radiolabel:hover {
  border-color: #4ca2d8 !important;
  background: rgba(76,162,216,0.1) !important;
}

.radiolabel input[type="radio"] {
  accent-color: #4ca2d8 !important;
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
}

/* ── Centered radio button container ─────────────────────────────────────────────────────────────── */
#settingsform > br { display: none !important; }
#settingsform {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 0 !important;
}

/* ── Bouton Apply ────────────────────────────────────────────────────────────────────────────────── */
#settingsform input[type="submit"],
#settingsform .actionbutton {
  background: #4ca2d8 !important;
  border: none !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  font-family: 'Noto Sans', sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  padding: 10px 32px !important;
  cursor: pointer !important;
  transition: background 0.2s !important;
  margin-top: 20px !important;
  /*width: 100% !important;*/
  height: auto !important;
}
#settingsform input[type="submit"]:hover {
  background: #3a8fc2 !important;
}
