/* === Reset & Base === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /*font-size: 20px;*/
  height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f4f7f9;
  color: #333;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Layout === */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
}

.index_text {
  justify-content: normal;
}

/* === Header Navigation === */
/*header nav ul {*/
/*  list-style: none;*/
/*  display: flex;*/
/*  justify-content: flex-start;*/
/*  background: #2f3640;*/
/*  padding: 12px 24px;*/
/*  flex-wrap: wrap;*/
/*}*/

/*header nav ul li {*/
/*  margin-right: 25px;*/
/*}*/

/*header nav ul li a {*/
/*  color: #f5f6fa;*/
/*  text-decoration: none;*/
/*  font-weight: bold;*/
/*  font-size: 1.1rem;*/
/*}*/

/* === Editor Toolbar === */
.editor-toolbar {
  border: 1px solid #ccc;
  background-color: #ecf0f1;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-radius: 6px;
  justify-content: center;
  margin-bottom: 20px;
}

.editor-toolbar button,
.editor-toolbar select,
.editor-toolbar input[type="color"] {
  padding: 10px 16px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  min-width: 100px;
}

.editor-toolbar button:hover {
  background-color: #dcdde1;
}

/* === Dropdown Styling === */
select {
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* === Editor Area === */
#editor {
  border: 1px solid #ccc;
  min-height: 320px;
  padding: 20px;
  margin-top: 20px;
  background-color: white;
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1.8;
  text-align: left;
  width: 100%;
  max-width: 100%;
}

/* === Save Button === */
.save-btn {
  margin-top: 20px;
  padding: 14px 24px;
  background: #44bd32;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
}

.save-btn:hover {
  background-color: #4cd137;
}

.forgot-link {
  margin-top: 10px;
  text-align: center;
}

.forgot-link a {
  color: #007bff;
  text-decoration: none;
  font-size: 0.9rem;
}

.forgot-link a:hover {
  text-decoration: underline;
}

/* === Story Fields === */
.story-fields {
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  flex-direction: column; /* Default: mobile */
  width: 100%;
}

.story-fields input,
.story-fields select {
  padding: 14px;
  flex: 1;
  width: 100%; /* Full width mobile default */
  box-sizing: border-box;
  min-width: 100px;
  max-width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

/* === Displayed Story Title === */
#storyTitleDisplay {
  margin-top: 12px;
  font-style: italic;
  color: #555;
  font-size: 1rem;
}

/* === Login Form Styling === */
form {
  background: #ffffff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.form-row label {
  flex: 1;
}

.form-row button {
  flex-shrink: 0;
}

/* === Responsive: Mobile Layout (≤ 768px) === */
@media (max-width: 768px) {
  html {
    /*font-size: 18px;*/
  }

  main {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .editor-toolbar {
    justify-content: center;
    gap: 10px;
    flex-direction: row-reverse;
  }

  .story-fields {
    flex-direction: column !important;
    flex-wrap: wrap;
    width: 100%;
  }

  .story-fields input,
  .story-fields select,
  .editor-toolbar button,
  .editor-toolbar select,
  .editor-toolbar input[type="color"],
  .save-btn {
    width: 100%;
    font-size: 1rem;
    max-width: 100%;
  }

  #editor {
    font-size: 1.05rem;
  }

  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .form-row label,
  .form-row button {
    width: 100%;
  }
}

/* === Desktop Layout (≥ 768px) === */
@media (min-width: 768px) {
  .story-fields {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center;
    gap: 12px;
  }

  .story-fields input,
  .story-fields select {
    flex: 1;
    min-width: 100px;
    max-width: 200px;
    width: auto;
    height: 50px;
  }
}

/* === Form Inputs & Buttons === */
label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  border-color: #3498db;
  outline: none;
}

button[type="submit"] {
  width: 100%;
  padding: 0.75rem;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

button[type="submit"]:hover {
  background: #2980b9;
}

/* === Feedback Messages === */
.message {
  text-align: center;
  margin-bottom: 1rem;
  font-weight: bold;
}

.message.success {
  color: green;
}

.message.error {
  color: red;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 1rem;
  background-color: #333;
  font-size: 0.9rem;
  color: white;
  margin-top: auto;
  border-top: 1px solid #ddd;
}

/* === Tooltip === */
.tooltip {
  position: absolute;
  background-color: #f9f9f9;
  color: #333;
  border: 1px solid #ccc;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  font-size: 14px;
  z-index: 999;
  transform: translateX(-50%);
  pointer-events: none;
}

.word {
  position: relative;
  cursor: pointer;
}
