/* Thread list, detail, and post form styles. */

.thread-box-outline {
  margin: 20px 0;
  padding: 0;
}

.thread-box {
  background-color: var(--color-surface-soft);
  position: relative;
  width: 100%;
  border: none;
  outline: none;
  box-shadow: var(--shadow-card);
  border-radius: 10px;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Apple Color Emoji",
    "Segoe UI Emoji",
    "Noto Color Emoji",
    "Noto Sans JP",
    "Hiragino Sans",
    "Yu Gothic",
    sans-serif;
}

.thread-box a {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75%;
}

.thread-id {
  white-space: nowrap;
}

.thread-title {
  max-width: 20ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.pagination-container {
  display: flex;
  gap: 0;
}

.pagination-container .page-link {
  padding: 6px 12px;
  border: 1px solid var(--color-surface-muted);
  border-radius: 0;
  text-decoration: none;
  color: var(--color-muted);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.pagination-container .page-link.active {
  color: var(--color-secondary);
  border-color: var(--color-surface-muted);
  font-weight: bold;
}

.pagination-container .page-link.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-secondary);
  border-radius: 2px;
}

.pagination-container .page-link:hover {
  background-color: var(--color-surface-muted);
  border-color: var(--color-surface-muted);
  color: var(--color-muted);
}

.page-dots {
  padding: 6px 12px;
  color: var(--color-muted);
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 600px;
}

.search-row {
  display: flex;
}

.search-input,
.search-select {
  flex: 1 1;
  padding: 8px;
  margin: 6px 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  transition: none;
}

.search-input::placeholder {
  color: var(--color-muted-light);
}

.search-input:focus,
.search-select:focus {
  border-color: var(--color-secondary);
  outline: none;
  box-shadow: none;
}

.thread-form .form-control,
.thread-form .form-select {
  width: 100%;
  padding: 4px 0 1px;
  border: none;
  border-bottom: 2px solid var(--color-border);
  font-size: 16px;
  background: transparent;
  transition: border-bottom-color 0.2s ease-in-out;
  border-radius: 0;
  color: var(--color-text);
}

.thread-form .category-select-container {
  position: relative;
  display: inline-block;
}

.thread-form .form-label {
  display: block;
}

.thread-form .short-select {
  width: 250px;
  appearance: none;
  padding: 4px 30px 1px 1px;
  border: none;
  border-bottom: 2px solid var(--color-border);
  font-size: 14px;
  background: transparent;
  transition: border-bottom-color 0.2s ease-in-out;
  cursor: pointer;
  outline: none;
  box-shadow: none;
}

.thread-form .category-select-container::after {
  content: "▼";
  font-size: 14px;
  color: var(--color-muted);
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.thread-form .short-input {
  width: 250px;
  padding: 4px 0 1px;
  border: none;
  border-bottom: 2px solid var(--color-border);
  font-size: 16px;
  background: transparent;
  transition: border-bottom-color 0.2s ease-in-out;
  box-shadow: none;
}

.thread-form .form-textarea {
  width: 100%;
  height: 200px;
  padding: 2px 1px;
  border: 2px solid var(--color-border);
  font-size: 14px;
  background: transparent;
  transition: border-bottom-color 0.2s ease-in-out;
  border-radius: 4px;
}

.thread-form .form-textarea:focus {
  border-color: var(--color-secondary);
  outline: none;
  box-shadow: none;
}

.thread-form .short-input:focus,
.thread-form .form-control:focus {
  border-bottom-color: var(--color-secondary);
  outline: none;
  box-shadow: none;
}

.thread-form input::placeholder,
.thread-form textarea::placeholder {
  font-size: 14px !important;
  color: var(--color-muted-light) !important;
}

.thread-form .button-container {
  text-align: center;
  margin-top: 20px;
}

.thread-form .input-error {
  border-bottom: 2px solid var(--color-danger) !important;
  background-color: var(--color-danger-soft) !important;
  transition: border-color 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.thread-form .input-error:focus {
  border-bottom-color: var(--color-danger) !important;
  outline: none;
  background-color: var(--color-danger-soft) !important;
}

.thread-form .text-danger {
  font-size: 14px;
  margin-top: 4px;
  display: block;
}

.thread-form .short-select.input-error {
  background-color: var(--color-danger-soft) !important;
}
