/* =========== BASIC RESET =========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

body {
    background: #f1f4f8;
    color: #1e2a35;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 15px;
}

/* =========== CONTAINER =========== */
.container {
    width: 100%;
    max-width: 900px;
    background: #ffffff;
    padding: 25px 25px 30px;
    border-radius: 16px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
}

/* =========== TITLES =========== */
h1 {
    margin-bottom: 0;
    color: #0a3d62;
    font-weight: 700;
}

h2 {
    margin-bottom: 10px;
    color: #0a3d62;
}

/* επάνω μπάρα: τίτλος + κουμπί */
.top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

/* εικόνα αριστερά – τίτλος δεξιά */
.header-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-image {
    max-height: 72px;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* =========== INPUTS + BUTTONS =========== */
input {
    width: 100%;
    padding: 12px;
    margin: 0;
    border-radius: 10px;
    border: 1px solid #c5ced6;
    font-size: 15px;
}

/* default: σκούρο φόντο + άσπρα γράμματα */
button {
    padding: 12px 16px;
    background: #0a3d62;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #074060;
}

/* κουμπί οδηγιών δεξιά, όχι full width */
.instructions-btn {
    white-space: nowrap;
    margin: 0;
}

/* =========== GENERAL LAYOUT =========== */
.section {
    margin-top: 20px;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5b6b;
}

/* Inline form for new palace */
.inline-form {
    display: flex;
    gap: 10px;
}

.inline-form input {
    flex: 1;
}

.inline-form button {
    flex: 0 0 130px;
}

/* Row for save button above palace list */
.palace-save-row {
    margin-bottom: 10px;
}

/* =========== PALACE LIST =========== */
.palace-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ανοιχτό κουμπί: ανοιχτό φόντο + σκούρο κείμενο */
.palace-button {
    padding: 10px 14px;
    border-radius: 10px;
    background: #eef2f6;
    border: 1px solid #d4dde5;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
    color: #0a3d62;
    font-weight: 500;
}

.palace-button:hover {
    background: #dfe8f2;
}

/* =========== SELECTED PALACE + LOCI =========== */
.locus-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.locus-form input {
    flex: 1 1 180px;
}

.locus-form button {
    flex: 0 0 120px;
}

.locus-list {
    margin-top: 15px;
    list-style: none;
    padding-left: 0;
    background: #eef2f6;
    padding: 12px;
    border-radius: 10px;
}

.locus-list li {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    padding: 10px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-left: 4px solid #0a3d62;
    font-size: 15px;
}

.locus-text {
    flex: 0 0 35%;
    font-weight: 600;
}

.locus-assoc {
    flex: 1;
    opacity: 0.9;
}

/* =========== UTILITIES =========== */
.hidden {
    display: none;
}

/* =========== INSTRUCTIONS MODAL =========== */
#instructionsOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    z-index: 900;
    display: none;
}

.help-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #0a3d62;
    color: #ffffff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 600px;
    z-index: 1000;
}

.help-box h2 {
    margin-bottom: 12px;
    font-size: 22px;
    color: #ffffff;
}

.help-box p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.help-box button {
    margin-top: 10px;
    width: 100%;
    background: #074060;
}

/* =========== FOOTER =========== */
footer {
    margin-top: 15px;
    font-size: 12px;
    color: #4b5b6b;
    text-align: center;
}

footer img {
    display: block;
    margin: 6px auto 0;
}

/* ===== Examples Section ===== */

.examples-section {
    margin-top: 24px;
    padding: 16px 18px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.examples-section h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

.examples-info {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f3f6fb;
    font-size: 14px;
    line-height: 1.4;
}

.examples-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

/* ανοιχτά κουμπιά examples: ανοιχτό φόντο + σκούρο κείμενο */
.examples-buttons button {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #c5cfdd;
    background: #f5f7fb;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
    color: #0a3d62;
    font-weight: 500;
}

.examples-buttons button:hover {
    background: #e6ecf8;
    transform: translateY(-1px);
}

.examples-output {
    margin-top: 16px;
}

.examples-hint {
    font-size: 13px;
    margin-bottom: 6px;
    color: #566375;
}

/* σκοτεινό φόντο για JSON preview + ανοιχτό κείμενο */
.examples-json {
    max-height: 260px;
    overflow: auto;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 12px;
    background: #0b1020;
    color: #e7f0ff;
    border-radius: 8px;
    padding: 10px 12px;
    line-height: 1.4;
}

/* Secondary light-style button */
.btn-secondary {
    margin-top: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #c5cfdd;
    background: #ffffff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
    color: #0a3d62;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #f2f5fb;
    transform: translateY(-1px);
}

/* ===== Flashcards ===== */

.flashcards {
    margin-top: 18px;
    padding: 12px 14px;
    background: #f3f6fb;
    border-radius: 10px;
    border: 1px solid #d4dde5;
}

.flashcards h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #0a3d62;
}

.flashcards-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.flashcards-controls label {
    font-size: 14px;
    font-weight: 600;
    color: #4b5b6b;
}

.flashcards-controls select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #c5ced6;
    font-size: 14px;
    background: #ffffff;
}

.flashcard-box {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.flashcard-prompt {
    font-weight: 600;
    margin-bottom: 8px;
}

.flashcard-answer {
    margin-top: 8px;
    opacity: 0.95;
}

.flashcard-nav {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

/* =========== RESPONSIVE =========== */
@media (max-width: 760px) {
    .container {
        padding: 18px;
    }

    .top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    h1 {
        font-size: 22px;
    }

    input,
    button {
        font-size: 14px;
        padding: 11px;
    }

    .inline-form {
        flex-direction: column;
    }

    .inline-form button {
        flex: 0 0 auto;
        width: 100%;
    }

    .locus-list li {
        flex-direction: column;
    }

    .locus-text {
        flex: none;
    }

    .flashcards-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .flashcards-controls button {
        width: 100%;
    }
}

.palace-list-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 4px;
}

.palace-delete-button {
  padding: 0;               /* no extra space */
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  font-size: 12px;          /* μικρό “x” */
  line-height: 20px;
  text-align: center;
  cursor: pointer;
}

/* =============================================================
   BUTTONS IN TOP ROW AFTER HEADER
   ============================================================= */

/* container των κουμπιών */
.header-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

/* όλα τα κουμπιά του header (User Guide, Flashcards, HowTo) */
.header-links a,
#howToBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 6px 14px;
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 600;

  color: #fff;
  background: #222;
  border-radius: 8px;
  border: 1px solid #111;
  text-decoration: none;
  cursor: pointer;

  transition: background 0.2s, transform 0.15s;

  width: auto;          /* μόνο όσο το κείμενο */
  white-space: nowrap;  /* να μην σπάει σε 2 γραμμές */
}

.header-links a:hover,
#howToBtn:hover {
  background: #111;
  transform: translateY(-1px);
}
