/* ═══════════════════════════════════════════════════════
   event-write.css  –  행사 등록 폼 전용 스타일
   ═══════════════════════════════════════════════════════ */

/* ── 컨테이너 ── */
.ew-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ── 페이지 제목 ── */
.ew-page-title {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid #e74c3c;
}
.ew-page-title h1 {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 6px;
}
.ew-page-title h1 i { color: #e74c3c; margin-right: 8px; }
.ew-page-title p    { font-size: 13px; color: #64748b; margin: 0; }
.ew-required-mark   { color: #e74c3c; font-weight: 700; }

/* ── 에러 알림 ── */
.ew-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.6;
}
.ew-alert i        { font-size: 18px; margin-top: 2px; flex-shrink: 0; }
.ew-alert-error    { background: #fff5f5; border: 1px solid #fca5a5; color: #b91c1c; }
.ew-alert-error i  { color: #ef4444; }
.ew-alert ul       { margin: 4px 0 0 16px; padding: 0; }
.ew-alert ul li    { margin-bottom: 2px; }

/* ── 섹션 박스 ── */
.ew-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.ew-section-title {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ew-section-title i { color: #e74c3c; }
.ew-section-title.ew-required::after {
  content: ' *';
  color: #e74c3c;
}

/* ── 행(row) ── */
.ew-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  border-bottom: 1px solid #f1f5f9;
  min-height: 52px;
}
.ew-row:last-child { border-bottom: none; }

/* 라벨 */
.ew-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  background: #fafafa;
  border-right: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.ew-label.ew-required::after {
  content: ' *';
  color: #e74c3c;
  font-size: 12px;
}
.ew-check {
  color: #e74c3c;
  font-size: 10px;
}

/* 필드 영역 */
.ew-field {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

/* ── 2열 행 ── */
.ew-row-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.ew-row-half .ew-row {
  border-bottom: none;
  border-right: 1px solid #f1f5f9;
}
.ew-row-half .ew-row:last-child { border-right: none; }

/* ── 입력 공통 ── */
.ew-input,
.ew-select,
.ew-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
  box-sizing: border-box;
}
.ew-input:focus,
.ew-select:focus,
.ew-textarea:focus {
  outline: none;
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231,76,60,.1);
}
.ew-textarea { resize: vertical; line-height: 1.6; }
.ew-hint     { font-size: 11px; color: #94a3b8; }
.ew-mt6      { margin-top: 6px; }

/* ── 선택 박스 그룹 ── */
.ew-select-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ew-select-group .ew-select { flex: 1; min-width: 120px; }
.ew-select-md  { max-width: 240px; }
.ew-select-sm  { width: auto; min-width: 80px; flex: none; }

/* ── 날짜 범위 ── */
.ew-date-range {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ew-date-input { max-width: 170px; }
.ew-range-sep  { color: #94a3b8; font-weight: 600; flex-shrink: 0; }

/* ── 시간 범위 ── */
.ew-time-range {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── 주소 검색 ── */
.ew-addr-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.ew-input-addr  { flex: 1; }
.ew-btn-map {
  flex-shrink: 0;
  padding: 9px 16px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.ew-btn-map:hover { background: #c0392b; }

/* ── 라디오 버튼 ── */
.ew-radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ew-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}
.ew-radio:hover { border-color: #e74c3c; color: #e74c3c; }
.ew-radio.selected,
.ew-radio input:checked + span {
  border-color: #e74c3c;
  background: #fff5f5;
  color: #e74c3c;
  font-weight: 600;
}
.ew-radio input[type=radio] {
  width: 15px; height: 15px;
  accent-color: #e74c3c;
  cursor: pointer;
}

/* ── 파일 업로드 ── */
.ew-file-hidden { display: none; }
.ew-file-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ew-file-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.ew-file-label:hover { background: #e2e8f0; border-color: #94a3b8; }
.ew-file-name {
  font-size: 13px;
  color: #64748b;
}

/* ── 리치 에디터 ── */
.ew-editor-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  margin: 0;
}
.ew-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.ew-tb-btn {
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: none;
  font-size: 13px;
  cursor: pointer;
  color: #334155;
  transition: all .15s;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
}
.ew-tb-btn:hover { background: #e2e8f0; border-color: #cbd5e1; }
.ew-tb-sep {
  width: 1px; height: 20px;
  background: #e2e8f0;
  margin: 0 4px;
  flex-shrink: 0;
}
.ew-tb-select {
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 12px;
  color: #334155;
  background: #fff;
  cursor: pointer;
}
.ew-tb-font { width: 100px; }
.ew-tb-size { width: 60px; }

/* 글자색/형광펜 */
.ew-tb-color,
.ew-tb-highlight {
  position: relative;
  overflow: visible;
  cursor: pointer;
}
.ew-tb-color input[type=color],
.ew-tb-highlight input[type=color] {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  bottom: 0; left: 50%;
  cursor: pointer;
}

/* 편집 영역 */
.ew-editor {
  min-height: 280px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.7;
  color: #1e293b;
  background: #fff;
  outline: none;
  word-break: break-word;
}
.ew-editor:focus { box-shadow: inset 0 0 0 2px rgba(231,76,60,.12); }
.ew-editor img   { max-width: 100%; height: auto; }

/* HTML 모드 textarea */
.ew-editor-raw {
  display: block;
  width: 100%;
  min-height: 280px;
  padding: 16px 18px;
  font-size: 12px;
  font-family: monospace;
  color: #1e293b;
  border: none;
  resize: vertical;
  box-sizing: border-box;
}
.ew-hidden { display: none !important; }

/* ── 하단 버튼 ── */
.ew-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}
.ew-btn-cancel,
.ew-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 32px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .2s;
}
.ew-btn-cancel  { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.ew-btn-cancel:hover  { background: #e2e8f0; }
.ew-btn-submit  { background: #e74c3c; color: #fff; }
.ew-btn-submit:hover  { background: #c0392b; }

/* ── 반응형 ── */
@media (max-width: 640px) {
  .ew-row { grid-template-columns: 1fr; }
  .ew-label { border-right: none; border-bottom: 1px solid #f1f5f9; padding: 10px 14px; }
  .ew-field { padding: 10px 14px; }
  .ew-row-half { grid-template-columns: 1fr; }
  .ew-row-half .ew-row { border-right: none; }
  .ew-date-input { max-width: 100%; }
  .ew-addr-search-row { flex-direction: column; align-items: stretch; }
  .ew-btn-map { width: 100%; justify-content: center; }
  .ew-actions { flex-direction: column; }
  .ew-btn-cancel, .ew-btn-submit { justify-content: center; }
}

/* ── 교통편/주변정보 섹션 ── */
.ew-section-location { border-left: 4px solid #27ae60; }
.ew-textarea-transport { font-family: 'Noto Sans KR', monospace; font-size: 13px; }

/* 탭 버튼 */
.ew-nearby-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.ew-ntab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.ew-ntab:hover { border-color: #27ae60; color: #27ae60; }
.ew-ntab-active { background: #27ae60; border-color: #27ae60; color: #fff; }
.ew-ntab-panel-hidden { display: none; }

/* 주변정보 아이템 */
.ew-nearby-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ew-nearby-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
}
.ew-ni-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.ew-ni-row2 { display: flex; gap: 6px; align-items: center; }
.ew-ni-name { flex: 2; }
.ew-ni-dist { flex: 1; max-width: 100px; }
.ew-ni-type { flex: 1; max-width: 100px; }
.ew-ni-icon { flex: 1; max-width: 130px; }
.ew-ni-desc { flex: 3; }
.ew-ni-name, .ew-ni-dist, .ew-ni-type, .ew-ni-icon, .ew-ni-desc {
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  font-size: 13px;
  background: #fff;
}
.ew-ni-del {
  padding: 5px 8px;
  border: 1px solid #fca5a5;
  background: #fff5f5;
  color: #e74c3c;
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
}
.ew-ni-del:hover { background: #fee2e2; }
.ew-nearby-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: #f0fdf4;
  border: 1.5px dashed #86efac;
  border-radius: 6px;
  color: #16a34a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  justify-content: center;
}
.ew-nearby-add-btn:hover { background: #dcfce7; border-color: #4ade80; }
