/* ===== Create Post Modal ===== */
.cpm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cpmFadeIn 0.2s ease;
}

@keyframes cpmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cpm-modal {
  background: #FFFFFF;
  border-radius: 24px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: cpmSlideUp 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.cpm-modal-sm {
  max-width: 480px;
}

.cpm-modal-lg {
  max-width: 640px;
}

.cpm-modal-feed {
  max-width: 572px;
}

@keyframes cpmSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.cpm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #E9ECF1;
  flex-shrink: 0;
}

.cpm-title {
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  color: #0F1B31;
  flex: 1;
  text-align: center;
}

.cpm-close, .cpm-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s;
  cursor: pointer;
  flex-shrink: 0;
}

.cpm-close:hover, .cpm-back:hover {
  background: #F4F6F8;
}

.cpm-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cpm-editor-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cpm-footer {
  padding: 16px 20px;
  border-top: 1px solid #E9ECF1;
  flex-shrink: 0;
}

.cpm-btn-primary {
  width: 100%;
  height: 48px;
  background: #00B87A;
  color: #FFFFFF;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.cpm-btn-primary:hover:not(.disabled) {
  background: #00A06A;
}

.cpm-btn-primary.disabled {
  background: #E2E6ED;
  color: #7C8696;
  cursor: not-allowed;
}

/* Loading */
.cpm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.cpm-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #E9ECF1;
  border-top-color: #00B87A;
  border-radius: 50%;
  animation: cpmSpin 0.8s linear infinite;
}

@keyframes cpmSpin {
  to { transform: rotate(360deg); }
}

/* Success */
.cpm-success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  text-align: center;
  gap: 12px;
}

.cpm-success-icon {
  margin-bottom: 8px;
}

.cpm-success-title {
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  color: #0F1B31;
}

.cpm-success-desc {
  font-family: inherit;
  font-size: 14px;
  color: #7C8696;
  line-height: 1.5;
}

/* Restricted step */
.cpm-restricted {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  text-align: center;
  gap: 12px;
  position: relative;
}

.cpm-restricted-icon {
  margin-bottom: 8px;
}

.cpm-restricted-title {
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  color: #0F1B31;
}

.cpm-restricted-desc {
  font-family: inherit;
  font-size: 14px;
  color: #7C8696;
  line-height: 1.5;
}

.cpm-restricted-timer {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #FF5135;
  padding: 8px 16px;
  background: rgba(255, 81, 53, 0.08);
  border-radius: 8px;
}

.cpm-restricted-btn {
  margin-top: 8px;
  padding: 10px 32px;
  border-radius: 20px;
  border: 1px solid #E0E4EA;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #0F1B31;
  cursor: pointer;
  transition: background 0.2s;
}

.cpm-restricted-btn:hover {
  background: #F5F6F8;
}

/* Guidelines - matches mobile CommunityGuidelinesScreen */
.cpm-guidelines-sheet {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.cpm-guidelines-handle {
  width: 56px;
  height: 4px;
  background: #DBE0E8;
  border-radius: 100px;
  margin: 16px auto;
  flex-shrink: 0;
}

.cpm-guidelines-rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
  overflow-y: auto;
  flex: 1;
}

.cpm-rule-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 12px 16px 16px;
  background: #F8F9FA;
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.cpm-rule-card:hover {
  background: #F0F1F3;
}

.cpm-rule-checkbox {
  width: 24px;
  height: 24px;
  min-width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cpm-rule-checkbox-checked {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 6px;
  background: #00B87A;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cpm-rule-text {
  flex: 1;
  font-family: inherit;
  font-size: 16px;
  color: #0F1B31;
  line-height: 21px;
}

.cpm-guidelines-footer {
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.cpm-understood-btn {
  width: 100%;
  height: 48px;
  background: #00B87A;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  cursor: pointer;
  letter-spacing: -0.28px;
  transition: background 0.15s;
}

.cpm-understood-btn:hover:not(:disabled) {
  background: #009966;
}

.cpm-understood-btn-disabled {
  background: #D1D5DB;
  color: #9CA3AF;
  cursor: not-allowed;
}

.cpm-view-guidelines-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  background: #F4F6F8;
  border-radius: 100px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #0F1B31;
  text-decoration: none;
  letter-spacing: -0.28px;
  transition: background 0.15s;
}

.cpm-view-guidelines-btn:hover {
  background: #E8EAED;
  text-decoration: none;
  color: #0F1B31;
}

/* Type Selection */
.cpm-type-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cpm-type-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #F8F9FA;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  text-align: left;
}

.cpm-type-card:hover {
  background: #F0F2F5;
}

.cpm-type-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cpm-type-title {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #0F1B31;
}

.cpm-type-desc {
  font-family: inherit;
  font-size: 12px;
  color: #7C8696;
  line-height: 1.3;
}

/* Feeling Picker */
.cpm-feeling-section {
  position: relative;
}

.cpm-feeling-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #F8F9FA;
  border: 1px solid #E2E6ED;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s;
}

.cpm-feeling-btn:hover {
  border-color: #00B87A;
}

.cpm-feeling-img {
  border-radius: 4px;
  object-fit: contain;
}

.cpm-feeling-label {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #0F1B31;
  flex: 1;
}

.cpm-feeling-placeholder {
  font-family: inherit;
  font-size: 14px;
  color: #7C8696;
  flex: 1;
}

.cpm-feeling-picker {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: #FFFFFF;
  border: 1px solid #E2E6ED;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 280px;
  overflow-y: auto;
  margin-top: 4px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.cpm-feeling-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
  font-family: inherit;
  font-size: 12px;
  color: #0F1B31;
}

.cpm-feeling-option:hover {
  background: #F4F6F8;
}

.cpm-feeling-option.selected {
  background: #E8F8F0;
}

/* Textarea */
.cpm-textarea-container {
  position: relative;
}

.cpm-textarea {
  width: 100%;
  min-height: 200px;
  padding: 14px 16px;
  background: #F8F9FA;
  border: 1px solid #E2E6ED;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  color: #0F1B31;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.cpm-textarea:focus {
  border-color: #00B87A;
}

.cpm-textarea::placeholder {
  color: #9CA4B1;
}

.cpm-textarea-sm {
  min-height: 100px;
}

.cpm-textarea-lg {
  min-height: 300px;
}

/* Rich Text Editor */
.rte-container {
  border: 1px solid #E2E6ED;
  border-radius: 12px;
  overflow: hidden;
  background: #F8F9FB;
}

.rte-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: #F4F6F8;
  border-bottom: 1px solid #E2E6ED;
  flex-wrap: wrap;
}

.rte-toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  position: relative;
}

.rte-divider {
  width: 1px;
  height: 20px;
  background: #D1D5DC;
  margin: 0 4px;
}

.rte-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #666670;
  transition: background 0.15s ease, color 0.15s ease;
}

.rte-btn:hover {
  background: #E8EAEF;
  color: #0F1B31;
}

.rte-btn.active {
  background: #E0F0FF;
  color: #006ECC;
}

.rte-heading-btn {
  width: auto;
  padding: 0 8px;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}

.rte-heading-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #FFFFFF;
  border: 1px solid #E2E6ED;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 10;
  min-width: 150px;
  padding: 4px;
}

.rte-heading-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border-radius: 6px;
  font-family: inherit;
  color: #0F1B31;
}

.rte-heading-option:hover {
  background: #F4F6F8;
}

.rte-heading-option.active {
  background: #E0F0FF;
  color: #006ECC;
}

.rte-editor {
  min-height: 280px;
  max-height: 400px;
  overflow-y: auto;
  padding: 16px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: #0F1B31;
  outline: none;
  direction: auto;
}

.rte-editor:empty::before {
  content: attr(data-placeholder);
  color: #BBC2CC;
  pointer-events: none;
}

.rte-editor p {
  margin-bottom: 8px;
}

.rte-editor h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.rte-editor h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.rte-editor h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.rte-editor ul, .rte-editor ol {
  padding-left: 24px;
  margin-bottom: 8px;
}

.rte-editor ul {
  list-style-type: disc;
}

.rte-editor ol {
  list-style-type: decimal;
}

.rte-editor li {
  margin-bottom: 2px;
}

.rte-editor blockquote {
  border-left: 3px solid #00B87A;
  padding-left: 12px;
  margin: 8px 0;
  color: #666670;
  font-style: italic;
}

.rte-editor strong, .rte-editor b {
  font-weight: 600;
}

.rte-editor em, .rte-editor i {
  font-style: italic;
}

/* Character Count */
.cpm-char-count {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 6px;
  font-family: inherit;
  font-size: 12px;
}

.cpm-char-under {
  color: #FF9500;
}

.cpm-char-over {
  color: #FF3B30;
}

.cpm-char-ok {
  color: #0F1B31;
}

.cpm-char-limit {
  color: #BBC2CC;
}

.cpm-char-min {
  color: #9CA4B1;
  font-size: 11px;
}

/* Toggles */
.cpm-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cpm-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.cpm-toggle-label {
  font-family: inherit;
  font-size: 14px;
  color: #0F1B31;
}

.cpm-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #E2E6ED;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}

.cpm-toggle.on {
  background: #00B87A;
}

.cpm-toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #FFFFFF;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cpm-toggle.on .cpm-toggle-thumb {
  transform: translateX(20px);
}

/* Form Fields */
.cpm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cpm-field-label {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #7C8696;
}

.cpm-input {
  height: 44px;
  padding: 0 14px;
  background: #F8F9FA;
  border: 1px solid #E2E6ED;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  color: #0F1B31;
  outline: none;
  transition: border-color 0.15s;
}

.cpm-input:focus {
  border-color: #00B87A;
}

.cpm-input::placeholder {
  color: #9CA4B1;
}

/* Chips */
.cpm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cpm-chip {
  padding: 8px 14px;
  border-radius: 12px;
  background: #F1F3F6;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: #0F1B31;
  cursor: pointer;
  transition: all 0.15s;
}

.cpm-chip:hover {
  background: #E8E9EB;
}

.cpm-chip.selected {
  background: #00B87A;
  color: #FFFFFF;
}

/* Cover Grid */
.cpm-cover-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cpm-cover-item {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.15s;
  padding: 0;
  background: #F1F3F6;
}

.cpm-cover-item:hover {
  border-color: #BBC2CC;
}

.cpm-cover-item.selected {
  border-color: #00B87A;
}

.cpm-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Error */
.cpm-error {
  padding: 10px 14px;
  background: #FFF0F0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  color: #FF3B30;
}

/* Submit Hint */
.cpm-submit-hint {
  font-family: inherit;
  font-size: 12px;
  color: #7C8696;
  text-align: center;
  margin-bottom: 10px;
}

