/* ========================  BASE STYLE TEMPLATE Gom t cc file Layla  gi ======================== */

/* --- RESET & BASE FONT --- */
html {
  font-size: 16px;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  width: 100%;
  line-height: 1.5;
  font-size: 1rem;
  background: #fff;
  color: #000;
  min-height: 100vh;
  overflow-x: hidden;
  flex-direction: column;
  font-family: sans-serif;
  box-sizing: border-box;
  letter-spacing: 0.02em;
  word-break: break-word;
  overflow-wrap: break-word;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

/* --- HEADER & FOOTER --- */
header {
  padding: 20px;
  text-align: center;
  font-weight: bold;
  min-height: 2.5em;
  max-width: 1000px;
  word-break: keep-all;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  font-size: clamp(2.5rem, 6vw, 3rem);
}

header:hover {
  background: rgba(0, 0, 0, 0.001);
  box-shadow: 0 -6px 10px -2px currentColor, 0 6px 10px -2px currentColor;
}

.subline {
  color: inherit;
  text-align: center;
  font-weight: bold;
  font-family: inherit;
  word-break: keep-all;
  background: transparent;
  box-shadow: none !important;
  font-size: clamp(0.75rem, 3vw, 1rem);
}

footer {
  padding: 1rem;
  margin-top: auto;
  text-align: center;
  font-weight: bold;
  word-break: keep-all;
  box-shadow: 0px 0px rgba(0, 0, 0, 0);
  font-size: clamp(0.75rem, 3vw, 1rem);
}

header,
h2,
footer {
  flex-shrink: 0;
  overflow: hidden;
}

/* --- NAVIGATION --- */
.navbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: inherit;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* nhẹ nhàng */
  backdrop-filter: blur(10px);
}

.top-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 1000px;
  padding: 10px;
  box-sizing: border-box;
}

.top-row a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
}

/* --- MENU BUTTON + PANEL --- */
.menu-button {
  display: inline-block;
  white-space: nowrap;
  font-size: 1.125rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  font-weight: bold;
}

/* Menu phụ */
.menu-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
}

.menu-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
  opacity: 0;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 10px 20px;
  flex-direction: column;
  gap: 15px;
  z-index: 1001;
  transition: transform 0.2s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  pointer-events: none;
  min-width: 200px;
  width: max-content;
  max-width: 90vw;
}

.menu-panel.show {
  transform: translateX(-50%) scaleY(1);
  opacity: 1;
  pointer-events: auto;
}

.menu-panel a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  white-space: nowrap;
  color: inherit;
}

.menu-group-title {
  text-align: center;
  font-weight: bold;
  font-size: 1rem;
  margin-top: 10px;
  margin-bottom: -5px;
  color: inherit;
}

/* --- TOOL-BAR --- */
.toolbar,
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.toolbar input,
.toolbar select,
.pagination input {
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid currentColor;
  font-size: 0.875rem;
  font-family: inherit;
  color: inherit;
  box-sizing: border-box;
  background: transparent;
  font-family: inherit;
}

.toolbar select,
.pagination input {
  text-align: center;
}

/* --- MOOD-BAR --- */
.mood-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 16px;
}

.mood-toolbar select {
  width: 100%;
  max-width: 100%;
  font-size: 1rem;
  padding: 6px 10px;
  margin-top: 6px;
  border-radius: 6px;
  border: 2px solid currentColor;
  background: transparent;
  font-family: inherit;
  color: inherit;
  text-align: center;
}

/* --- ZOOM --- */
.zoomInput {
  width: 60px;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  border: 2px solid currentColor;
  background-color: inherit;
  color: inherit;
  font-family: inherit;
}

/* --- MAIN AREA --- */
.main {
  flex: 1;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: 2.5rem;
  margin-right: 2.5rem;
}

.intro {
  text-align: center;
  word-break: keep-all;
  display: block;
  width: fit-content;
  margin: 2em auto;
  max-width: 900px;
  padding: 0 1rem;
  border-block: 2px double currentColor;
  padding-bottom: 4px;
  margin-bottom: 1.25rem;
  transition: all 0.3s ease;
}

.features {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  width: 100%;
  max-width: 1000px;
  margin-bottom: 2.5rem;
}

.feature {
  font-family: inherit;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  border: 2px solid currentColor;
}

.feature strong {
  display: block; /* Tự xuống dòng, không cần <br> */
  font-size: 1.3rem;
}

.feature span {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.1rem;
  opacity: 0.85;
}

/* --- TOOL & PAGE LIST --- */
.section-wrapper {
  width: 100%;
  padding: 0 1rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 540px;
  margin: 3rem auto 1rem;
}

details {
  text-transform: uppercase;
  overflow: hidden;
  border-left: none;
  border-radius: 8px;
  border: 2px solid currentColor;
  border-block: none;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px currentColor;
}

summary {
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  border-radius: 8px 8px 0 0;
  border: 2px solid currentColor;
  font-size: 1.125rem;
  padding: 14px 20px;
  box-shadow: 0 2px 4px currentColor;
}

.page-list,
.tool-list {
  gap: 14px;
  display: flex;
  margin-top: 2rem;
  border-radius: 12px;
  flex-direction: column;
  padding: 10px 20px 20px;
  margin: 0 auto 1rem auto;
}

.page-list a,
.tool-list a {
  display: block;
  border-radius: 6px;
  padding: 12px 16px;
  text-decoration: none;
  border: 2px solid currentColor;
  text-align: center;
  color: inherit;
  border-left: 5px solid currentColor;
  transition: background 0.2s ease;
}

.page-list a:hover,
.tool-list a:hover {
  background: #fff;
}

.page-list strong,
.tool-list strong {
  display: block;
  font-weight: bold;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-size: 1.125rem;
  text-decoration: none;
}

.page-list span,
.tool-list span {
  text-transform: none;
  font-size: 1rem;
  color: inherit;
}

/* --- STORY LIST --- */
.story-list {
  padding: 1rem;
}
.fic {
  display: block;
  margin-bottom: 1.5em;
  padding-bottom: 1em;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.fic:hover {
  transform: scale(1.01);
  transition: 0.3s ease;
}
.title {
  font-size: 1.125rem;
  font-weight: bold;
}
.desc {
  font-family: "Arial", sans-serif;
  font-size: 1rem;
  font-style: normal;
  margin-top: 0.5em;
  white-space: pre-wrap;
}

/* ========================= BASE TEMPLATE CSS GOM GN ========================= */

/* --- HEADINGS --- */
h2 {
  text-align: center;
  font-weight: bold;
  max-width: 100%;
  min-height: 2.5em;
  margin: 1.2em 0 0.5em;
  background: none !important;
  box-shadow: none !important;
  border: none !important;
  font-size: clamp(1.8rem, 6vw, 2.25rem);
}

/* --- BOX WRAPPER --- */
.box {
  padding: 2em;
  margin-top: 3rem;
  margin-bottom: 3rem;
  width: 100%;
}

/* --- BUTTON (nav-btn) --- */
.nav-btn {
  background: inherit;
  color: inherit;
  padding: 10px 16px;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid currentColor;
  box-shadow: 0 2px 4px currentColor;
  text-transform: uppercase;
  display: block !important;
  width: fit-content !important;
  margin: 1em auto !important;
  transition: background 0.3s ease;
}

.page-btn:hover,
.btn-404:hover,
.nav-btn:hover {
  border: 2px solid currentColor;
  box-shadow: 0 2px 4px currentColor;
}

.page-btn:disabled,
.btn-404:disabled,
.nav-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.page-btn {
  padding: 8px 12px;
  font-size: 1rem;
  color: inherit;
  background-color: transparent;
  border: 1px solid currentColor;
  box-shadow: 0 2px 4px currentColor;
  transition: all 0.3s ease;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  font-weight: bold;
}

/* --- INPUT FILE --- */
input[type="file"] {
  display: block;
  margin: 1em 0;
  width: 100%;
  font-family: inherit;
  color: inherit;
  font-size: 1rem;
  text-decoration: none;
  box-sizing: border-box;
  padding: 8px;
}

/* --- LOG CONTAINER --- */
.log {
  width: 100%;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 10px;
  padding: 1rem;
  max-height: 800px;
  overflow-y: auto;
  white-space: pre-wrap;
  text-align: left;
  margin-top: 1.5em;
  word-break: break-word;
  background: transparent;
  border: 2px solid currentColor;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* --- FORM LABEL --- */
.form-label {
  font-weight: bold;
  font-family: inherit;
  color: inherit;
}

/* --- TEXT --- */

li {
  margin-bottom: 0.5em;
  font-size: 0.95em;
}

input::placeholder {
  color: currentColor;
  text-align: left;
  opacity: 0.6;
}

.note {
  display: block;
  margin: 0.5rem 0;
  font-size: 0.95rem;
  color: inherit;
  opacity: 0.85;
  font-style: italic;
  text-align: center;
}

.pageInput {
  width: 60px;
  padding: 8px 12px;
  text-align: center;
  background-color: transparent;
  color: inherit;
  border: 2px solid currentColor !important;
  caret-color: inherit;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  line-height: 1.4;
  font-weight: bold;
  margin: 0 auto;
}

.prefix-Input {
  padding: 8px;
  margin-bottom: 10px;
  width: 100%;
  font-family: inherit;
  box-sizing: border-box;
  background-color: transparent;
  color: inherit;
  border: 2px solid currentColor;
  caret-color: inherit;
  max-width: 100%;
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
  margin-top: 6px;
  border-radius: 8px;
}

/* --- 404 PAGE --- */
.center-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  text-align: center;
  gap: 1.5rem;
}

.big-text {
  font-size: clamp(5rem, 6vw, 10rem);
  font-weight: bold;
  animation: floatIn 1s ease-out;
}

.mid-text {
  font-size: clamp(1.8rem, 3vw, 3.6rem);
  font-weight: bold;
  animation: floatIn 1s ease-out;
}

.quote-text {
  font-size: clamp(1.2rem, 3vw, 2.4rem);
  font-style: italic;
  opacity: 0.8;
}

.btn-404 {
  padding: 0.6rem 1.5rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  font-weight: bold;
  display: block;
  width: fit-content;
  margin: 3rem auto 5rem;
  text-transform: uppercase;
  text-shadow: 0 0 0.5px currentColor, 0.5px 0 0 currentColor, -0.5px 0 0 currentColor, 0 0.5px 0 currentColor, 0 -0.5px 0 currentColor;
  border: 2px solid currentColor;
  box-shadow: 0 2px 5px currentColor;
}

@keyframes floatIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }