/* Create Post modal — Home sidebar entry */
body.create-post-modal-open {
  overflow: hidden;
}

.create-post-modal {
  position: fixed;
  inset: 0;
  z-index: 1260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: min(2.5vh, 1.25rem) min(3vw, 1rem);
  box-sizing: border-box;
}

.create-post-modal[hidden] {
  display: none !important;
}

.create-post-modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.create-post-modal-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 480px);
  max-height: min(92vh, 720px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(168deg, rgba(28, 34, 44, 0.98) 0%, rgba(16, 19, 26, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

.create-post-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.12);
}

.create-post-modal-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #f0f3f7;
}

.create-post-modal-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(230, 236, 245, 0.92);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.create-post-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.create-post-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(110, 176, 255, 0.5) rgba(255, 255, 255, 0.06);
}

.create-post-modal-body::-webkit-scrollbar {
  width: 10px;
}

.create-post-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.create-post-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(110, 176, 255, 0.7) 0%, rgba(72, 130, 210, 0.75) 100%);
  border-radius: 999px;
  border: 2px solid rgba(12, 16, 22, 0.85);
}

.create-post-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(130, 192, 255, 0.82) 0%, rgba(84, 146, 228, 0.86) 100%);
}

.create-post-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.1);
}

.create-post-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(180, 192, 210, 0.85);
  margin-bottom: 0.45rem;
}

.create-post-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 132px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.2);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.create-post-media-layout {
  display: grid;
  gap: 0.8rem;
}

.create-post-dropzone:hover,
.create-post-dropzone:focus-within {
  border-color: rgba(110, 176, 255, 0.35);
  background: rgba(110, 176, 255, 0.05);
}

.create-post-dropzone-hint {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(210, 218, 230, 0.88);
}

.create-post-dropzone-sub {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: rgba(150, 162, 180, 0.9);
}

.create-post-caption {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  color: #f0f3f7;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  padding: 0.65rem 0.75rem;
  box-sizing: border-box;
}

.create-post-caption::placeholder {
  color: rgba(150, 162, 180, 0.75);
}

.create-post-caption:focus {
  outline: none;
  border-color: rgba(110, 176, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(110, 176, 255, 0.12);
}

.create-post-tag-search-wrap {
  position: relative;
}

.create-post-tag-search {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  color: #f0f3f7;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  box-sizing: border-box;
}

.create-post-tag-search:focus {
  outline: none;
  border-color: rgba(110, 176, 255, 0.45);
}

.create-post-tag-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 2;
  max-height: 200px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 22, 30, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: none;
}

.create-post-tag-suggest.is-open {
  display: block;
}

.create-post-tag-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #e8ecf3;
  font: inherit;
  font-size: 0.86rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.create-post-tag-suggest button:hover,
.create-post-tag-suggest button:focus-visible {
  background: rgba(110, 176, 255, 0.12);
  outline: none;
}

.create-post-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.create-post-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.5rem 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(110, 176, 255, 0.12);
  border: 1px solid rgba(110, 176, 255, 0.22);
  color: #e8f1ff;
}

.create-post-chip-remove {
  border: 0;
  background: transparent;
  color: rgba(230, 240, 255, 0.75);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}

.create-post-preview {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.create-post-preview-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0a0c10;
  display: grid;
  place-items: center;
}

.create-post-preview-media img,
.create-post-preview-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.create-post-preview-empty {
  font-size: 0.82rem;
  color: rgba(150, 162, 180, 0.85);
  padding: 1rem;
  text-align: center;
}

.create-post-preview-caption {
  margin: 0;
  padding: 0.65rem 0.75rem 0.85rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(220, 228, 240, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.create-post-btn {
  border-radius: 10px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.create-post-btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(230, 236, 245, 0.95);
}

.create-post-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.09);
}

.create-post-btn--primary {
  background: linear-gradient(180deg, rgba(110, 176, 255, 0.95) 0%, rgba(72, 130, 210, 0.98) 100%);
  color: #0a0c10;
  border-color: rgba(255, 255, 255, 0.12);
}

.create-post-btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.create-post-thumb-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
  margin-top: 0.65rem;
  width: 100%;
}

.create-post-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.create-post-error {
  margin: 0;
  font-size: 0.8rem;
  color: #ff9b9b;
}

.create-post-share-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.create-post-share-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(230, 236, 245, 0.95);
  font: inherit;
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.62rem;
  cursor: pointer;
}

.create-post-share-btn:hover {
  border-color: rgba(110, 176, 255, 0.45);
  background: rgba(110, 176, 255, 0.12);
}

.create-post-share-status {
  margin: 0.45rem 0 0;
  font-size: 0.76rem;
  color: rgba(162, 178, 200, 0.95);
}

.post-edit-type-hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(160, 174, 198, 0.92);
}

.post-delete-modal-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(210, 218, 232, 0.94);
}

.post-delete-confirm-btn {
  background: linear-gradient(180deg, rgba(220, 90, 90, 0.95) 0%, rgba(170, 45, 55, 0.98) 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

.post-delete-confirm-btn:hover {
  filter: brightness(1.06);
}
