/* Submit Page Styles */

/* Hero section */
#hero {
  max-width: 90%;
  width: 90%;
  padding: 3rem 2rem 2rem 2rem;
  text-align: center;
  box-sizing: border-box;
}

.hero-description {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #666;
  margin: 0 auto;
  text-align: center;
  max-width: 100%;
  width: 100%;
}

/* Form Layout */
#submit-form {
  max-width: 1000px;
}

#storyForm {
  max-width: 1200px;
  margin: 0 auto;
}

.form-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
  align-items: start;
}

/* Left column: Metadata - inline labels and inputs */
.form-column-left {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem 1.5rem;
  align-items: center;
}

.form-column-left label {
  text-align: right;
  color: #333;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.required {
  color: #c44;
}

.form-column-left input,
.form-column-left select {
  margin-bottom: 0;
}

.form-column-left .tag-input-container {
  grid-column: span 1;
}

.form-column-left .selected-tags {
  margin-top: 0.5rem;
}

.form-column-left .tag-dropdown {
  top: 42px;
}

/* Right column: Content - vertical stack */
.form-column-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-column-right label {
  text-align: left;
  color: #333;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

/* Form inputs */
#storyForm input,
#storyForm textarea,
#storyForm select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #ddd;
  border-radius: 0;
  font-family: inherit;
  font-size: 0.95rem;
  color: #333;
  background: #fff;
  box-sizing: border-box;
}

#storyForm textarea {
  min-height: 200px;
  resize: vertical;
}

/* Tag Input with Autocomplete */
.tag-input-container {
  position: relative;
  width: 100%;
  grid-column: span 1;
}

.tag-input-container.full-width {
  grid-column: 1 / -1;
}

.tag-input-container input {
  position: relative;
  z-index: 1;
}

.tag-dropdown {
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  z-index: 20;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tag-option {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #333;
  transition: background 0.15s ease;
}

.tag-option:hover {
  background: #f5f5f5;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: #f5f5f5;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  color: #333;
  position: relative;
}

.tag-pill.new-tag {
  background: #fff9e6;
  border-color: #f0d68a;
}

.remove-tag {
  background: none;
  border: none;
  color: #666;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.remove-tag:hover {
  color: #111;
}

.new-tag-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 0.5rem 0.8rem;
  font-size: 0.75rem;
  white-space: nowrap;
  margin-bottom: 0.5rem;
  border-radius: 3px;
  z-index: 100;
}

.tag-pill.new-tag:hover .new-tag-tooltip {
  display: block;
}

.new-tag-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
}

/* Read options section */
.read-options {
  max-width: 1200px;
  margin: 2rem auto;
}

.read-options h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: #333;
}

.option-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.option-box {
  position: relative;
  background: #fff;
  border: 2px solid #ddd;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.option-box:hover {
  border-color: #999;
}

.option-box.active {
  border-color: #333;
  background: #fafafa;
}

.option-box input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-content strong {
  display: block;
  font-size: 1.05rem;
  color: #333;
  font-weight: 500;
}

.option-description {
  font-size: 0.9rem;
  color: #666;
  font-weight: normal;
}

.read-link-input,
.file-upload-input {
  margin-bottom: 1rem;
}

.read-link-input input,
.file-upload-input input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #ddd;
  border-radius: 0;
  font-family: inherit;
  font-size: 0.95rem;
  color: #333;
  background: #fff;
  box-sizing: border-box;
}

.upload-note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #666;
}

/* Submit button */
.submit-btn-full {
  background: #fff;
  color: #333;
  border: 1px solid #333;
  padding: 0.8rem 2rem;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: block;
}

.submit-btn-full:hover {
  background: #fafafa;
}

/* Success Message */
#successMessage {
  text-align: center;
  padding: 2rem 0;
}

#successMessage p {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 1.5rem;
}

/* Mobile: stack fields vertically */
@media (max-width: 900px) {
  .form-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .form-column-left {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-column-left label {
    text-align: left;
    margin-bottom: 0.25rem;
  }

  .option-boxes {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .submit-btn-full {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  #hero {
    padding: 1rem 1.5rem 1rem 1.5rem;
    max-width: 100%;
    width: 100%;
  }

  .hero-description {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  .hero-description-second {
    display: none;
  }

  #storyForm {
    padding: 0 1.25rem;
  }

  .read-options {
    padding: 0 1.25rem;
  }

  .option-box {
    padding: 1rem;
  }

  .option-content strong {
    font-size: 0.95rem;
  }

  .option-description {
    font-size: 0.8rem;
  }

  .submit-btn-full {
    margin-bottom: 0;
  }

  footer {
    margin-top: 1rem;
  }
}

@media (max-width: 480px) {
  #hero {
    padding: 0.75rem 1rem 0.75rem 1rem;
  }

  .hero-description {
    font-size: 0.8rem;
  }

  #storyForm {
    padding: 0 1rem;
  }

  .read-options {
    padding: 0 1rem;
  }
}
