@charset "UTF-8";

/* ========================================
   Template Page Styles
   템플릿 관련 페이지 전용 스타일
   - 템플릿 제작 페이지 (pms-order.xst)
   - 템플릿 보관함 페이지 (pms-leaflet.xst)
   - 템플릿 관련 컴포넌트들
   ======================================== */

/* Template Page Layout */
.template-page {
  padding: 30px 0;
  background: #f8f9fa;
  min-height: calc(100vh - 80px);
}

.template-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.template-header {
  margin-bottom: 30px;
}

.template-title {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}

.template-subtitle {
  color: #666;
  font-size: 16px;
}

/* Template Categories */
.template-categories {
  background: #fff;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.template-categories-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
}

.template-categories-list {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.template-category {
  padding: 10px 20px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.template-category:hover {
  background: #e9ecef;
  color: #333;
}

.template-category.active {
  background: #3498db;
  color: #fff;
  border-color: #3498db;
}

/* Template Grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* Storage Template Grid */
.storage-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.template-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  cursor: pointer;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Storage Template Card */
.storage-template-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

/* Storage Template Preview Phone in Card */
.storage-template-card .storage-template-preview-phone {
  flex: 1;
  min-height: 0;
}

/* ========================================
   Template Editor Styles
   ======================================== */

/* 템플릿 제목 입력 섹션 */
.template-title-input-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #e9ecef;
}

.template-title-input-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.template-title-input-section input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.template-title-input-section input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.template-title-input-section input::placeholder {
  color: #adb5bd;
  font-style: italic;
}

/* 필수 입력 표시 */
.required-mark {
  color: #e74c3c;
  font-weight: bold;
  margin-left: 2px;
}

/* 검증 메시지 */
.validation-message {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  display: none;
}

.validation-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.validation-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* 템플릿 검색 섹션 */
.template-search-section {
  margin-bottom: 10px;
  min-width: 300px;
}

.template-search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.template-search-container i {
  position: absolute;
  left: 12px;
  color: #6c757d;
  font-size: 14px;
  z-index: 2;
}

.template-search-container input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.template-search-container input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.template-search-container input::placeholder {
  color: #adb5bd;
  font-style: italic;
}

/* 템플릿 제작 페이지 스타일 */
.template-editor {
  display: flex;
  flex-direction: column;
}

.template-element-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: space-between;
}

.template-element-buttons .template-element-btn {
  flex: 1;
  min-width: 0; /* flex 아이템이 줄어들 수 있도록 */
}

.template-element-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: #495057;
}

.template-element-btn:hover {
  border-color: #007bff;
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.template-element-btn i {
  font-size: 18px;
  margin-bottom: 8px;
  color: #6c757d;
}

.template-element-btn:hover i {
  color: #007bff;
}

.template-canvas {
  min-height: 400px;
  position: relative;
  /* 드래그 중 요소가 시각적으로 캔버스 밖으로 벗어나 보이지 않도록 */
  overflow: hidden;
  border-radius: 8px;
}

.template-canvas-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
  text-align: center;
  margin-top: 30px;
}

.template-canvas-placeholder i {
  font-size: 36px;
  margin-bottom: 16px;
  color: #dee2e6;
}

.template-canvas-placeholder p {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 500;
}

/* Editor Template Canvas */
.editor-template-canvas {
  min-height: 400px;
  position: relative;
  /* 드래그 중 요소가 시각적으로 캔버스 밖으로 벗어나 보이지 않도록 */
  overflow: hidden;
  border-radius: 8px;
}

.editor-template-canvas-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
  text-align: center;
  margin-top: 30px;
}

.editor-template-canvas-placeholder i {
  font-size: 36px;
  margin-bottom: 16px;
  color: #dee2e6;
}

.editor-template-canvas-placeholder p {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 500;
}

/* 드래그 기능 안내 메시지 */
.drag-help-message {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  animation: slideIn 0.5s ease;
}

.drag-help-message div {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 5px 0;
}

.drag-help-message i {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
}

.drag-help-message span {
  line-height: 1.5;
}

/* ========================================
   SortableJS 드래그 앤 드롭 스타일
   ======================================== */

/* 드래그 중인 요소의 고스트(투명한 복사본) 스타일 */
.sortable-ghost {
  opacity: 0.4;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  border: 2px dashed #3498db;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

/* 드래그 중 선택된 요소 스타일 */
.sortable-chosen {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  box-shadow: 0 6px 16px rgba(52, 152, 219, 0.25);
  border: 2px solid #3498db;
  border-radius: 8px;
  transition: all 0.2s ease;
}

/* 드래그 중일 때 버튼 비활성화 */
.template-draggable-element.dragging button {
  opacity: 0.7;
  pointer-events: none;
}

/* 드래그 가능한 요소의 기본 상태 */
.template-draggable-element {
  position: relative;
  margin-bottom: 16px;
  padding: 16px;
  cursor: grab;
  transition: all 0.2s ease;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e9ecef;
  /* transform 보간을 위해 will-change 지정 */
  will-change: transform;
}

/* 드래그 가능한 요소 선택 상태 */
.template-draggable-element.selected {
  border-color: #3498db;
  background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
  border-radius: 8px;
}

/* 드래그 불가능한 요소들 */
.template-canvas-placeholder {
  pointer-events: none;
  user-select: none;
}

/* 드래그 중일 때 전체 페이지 커서 변경 */
body.dragging {
  cursor: grabbing;
}

/* 드래그 중일 때 텍스트 선택 방지 */
body.dragging * {
  user-select: none;
}

/* 요소가 있을 때는 안내 메시지 숨김 */

.element-content p {
  margin: 0;
  color: #495057;
  line-height: 1.6;
}

/* ========================================
   Text Element Styles
   ======================================== */

/* 텍스트 요소 입력 영역 */
.text-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.text-title-input {
  flex: 1;
  margin-right: 15px;
}

.text-title-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.text-title-field:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.text-content-field {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s ease;
}

.text-content-field:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 텍스트 스타일링 툴바 */
.text-styling-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.style-button-group {
  display: flex;
  gap: 2px;
  align-items: center;
}

.style-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #ced4da;
  background: #fff;
  color: #495057;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 14px;
}

.style-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.style-btn.active {
  background: #3498db;
  border-color: #3498db;
  color: #fff;
}

.style-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 색상 선택기 */
.color-picker-wrapper {
  position: relative;
}

.color-btn {
  position: relative;
  overflow: hidden;
}

.color-indicator {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 1px;
}

.text-color-field.hidden {
  display: none;
}

/* 크기별 폰트 아이콘 */
.size-btn[data-size='small'] i {
  font-size: 12px;
}

.size-btn[data-size='medium'] i {
  font-size: 14px;
}

.size-btn[data-size='large'] i {
  font-size: 16px;
}

/* 텍스트 미리보기 */
.text-preview-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.text-preview-title:empty {
  display: none;
}

.text-preview-content {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

/* 텍스트 요소 placeholder */
.text-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  text-align: center;
  color: #6c757d;
}

.text-placeholder:hover {
  border-color: #007bff;
  background: #f0f8ff;
}

.text-placeholder i {
  font-size: 32px;
  margin-bottom: 15px;
  opacity: 0.6;
  color: #007bff;
}

.text-placeholder p {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 500;
}

.text-placeholder small {
  font-size: 12px;
  opacity: 0.8;
}

/* 템플릿 미리보기 스타일 */
.template-preview-phone {
  width: 100%;
  margin: 0 auto;
}

.template-preview-phone-frame {
  width: 100%;
  height: 700px;
  border: 8px solid #333;
  border-radius: 25px;
  background: #fff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.template-preview-phone-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #000;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.template-preview-phone-time {
  font-size: 14px;
}

.template-preview-phone-icons {
  display: flex;
  gap: 4px;
}

.template-preview-phone-icons i {
  font-size: 10px;
}

.template-preview-phone-url {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  font-size: 14px;
  color: #495057;
}

.template-preview-phone-url i {
  color: #3498db;
  font-size: 14px;
}

.template-preview-phone-content {
  padding: 16px;
  height: calc(100% - 80px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.template-preview-placeholder {
  text-align: center;
  color: #6c757d;
  font-size: 14px;
  margin: 0;
  padding: 40px 20px;
}

/* Editor Template Preview */
.editor-template-preview-phone {
  width: 100%;
  margin: 0 auto;
}

.editor-template-preview-phone-frame {
  width: 100%;
  height: 700px;
  border: 8px solid #333;
  border-radius: 25px;
  background: #fff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.editor-template-preview-phone-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #000;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.editor-template-preview-phone-time {
  font-size: 14px;
}

.editor-template-preview-phone-icons {
  display: flex;
  gap: 4px;
}

.editor-template-preview-phone-icons i {
  font-size: 10px;
}

.editor-template-preview-phone-url {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  font-size: 12px;
  color: #495057;
}

.editor-template-preview-phone-url i {
  color: #28a745;
  font-size: 10px;
}

.editor-template-preview-phone-content {
  padding: 16px;
  height: calc(100% - 80px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Storage Template Preview Phone */
.storage-template-preview-phone {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.storage-template-preview-phone-frame {
  width: 100%;
  height: 700px;
  border: 8px solid #333;
  border-radius: 25px;
  background: #fff;
  overflow: hidden;
  position: relative;
}

.storage-template-preview-phone-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #000;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.storage-template-preview-phone-time {
  font-size: 14px;
}

.storage-template-preview-phone-icons {
  display: flex;
  gap: 4px;
}

.storage-template-preview-phone-icons i {
  font-size: 10px;
}

.storage-template-preview-phone-url {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  font-size: 14px;
  color: #495057;
}

.storage-template-preview-phone-url i {
  color: #3498db;
  font-size: 14px;
}

.storage-template-preview-phone-content {
  padding: 16px;
  height: calc(100% - 80px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Storage Template Preview Phone Content Elements */
.storage-template-preview-phone-content .element-content {
  font-size: 14px;
  line-height: 1.6;
}

.storage-template-preview-phone-content .text-preview-content {
  color: #495057;
  margin-bottom: 8px;
}

.storage-template-preview-phone-content .template-title-preview {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 16px;
  text-align: center;
}

.storage-template-preview-phone-content .image-element-preview {
  text-align: center;
}

.storage-template-preview-phone-content .image-element-preview img {
  max-width: 100%;
  height: auto;
}

.storage-template-preview-phone-content .contact-name h3 {
  margin: 0 0 12px 0;
  color: #333;
  font-size: 14px;
  font-weight: 600;
}

.storage-template-preview-phone-content .contact-icon {
  width: 20px;
  height: 20px;
}

.storage-template-preview-phone-content .contact-value {
  font-size: 11px;
  color: #495057;
}

.storage-template-preview-phone-content .address-details {
  display: flex;
  gap: 5px;
  align-items: center;
}

.storage-template-preview-phone-content .main-address {
  font-weight: 600;
  color: #333;
}

.storage-template-preview-phone-content .detail-address {
  color: #666;
  font-size: 13px;
}

.storage-template-preview-phone-content .contact-icons-section {
  position: absolute;
  bottom: 40px;
  right: 0px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 180px;
}

.storage-template-preview-phone-content .youtube-element-preview {
  text-align: center;
}

.storage-template-preview-phone-content .youtube-element-preview iframe {
  width: 100%;
  height: 300px;
}

.storage-template-preview-phone-content .reservation-element-preview {
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.storage-template-preview-phone-content .reservation-header p {
  margin: 0 0 12px 0;
  color: #495057;
  font-size: 14px;
}

.storage-template-preview-phone-content .reservation-form input,
.storage-template-preview-phone-content .reservation-form select,
.storage-template-preview-phone-content .reservation-form textarea {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}

.storage-template-preview-placeholder {
  text-align: center;
  color: #6c757d;
  font-size: 12px;
  margin: 0;
  padding: 40px 20px;
}

.editor-template-preview-placeholder {
  text-align: center;
  color: #6c757d;
  font-size: 14px;
  margin: 0;
  padding: 40px 20px;
}

/* 템플릿 미리보기 모달 */
.template-preview-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.template-preview-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-preview-modal-content {
  background-color: #fff;
  margin: 20px;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.template-preview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef;
}

.template-preview-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #212529;
}

.template-preview-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6c757d;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.template-preview-modal-close:hover {
  color: #dc3545;
  background: #f8f9fa;
}

.template-preview-modal-body {
  padding: 0;
  height: 600px;
}

#previewFrame {
  width: 100%;
  height: 100%;
  border: none;
}

/* Editor Template Preview Modal */
.editor-template-preview-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.editor-template-preview-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-template-preview-modal-content {
  background-color: #fff;
  margin: 20px;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.editor-template-preview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef;
}

.editor-template-preview-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #212529;
}

.editor-template-preview-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6c757d;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.editor-template-preview-modal-close:hover {
  color: #dc3545;
  background: #f8f9fa;
}

.editor-template-preview-modal-body {
  padding: 0;
  height: 600px;
}

/* 템플릿 액션 버튼들 (저장, 전체삭제) */
.template-action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}

.template-action-buttons .btn-send,
.template-action-buttons .btn-clear {
  flex: 1;
  max-width: 200px;
  padding: 14px 20px;
  font-size: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.template-action-buttons .btn-send {
  background: #3498db;
  color: #fff;
}

.template-action-buttons .btn-send:hover {
  background: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-action-buttons .btn-clear {
  background: #e74c3c;
  color: #fff;
}

.template-action-buttons .btn-clear:hover {
  background: #c0392b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-action-buttons .btn-clear-all {
  background: #dc3545;
  color: #fff;
}

.template-action-buttons .btn-clear-all:hover {
  background: #c0392b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 편집 모달 */
.template-edit-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.template-edit-modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

/* 모달 슬라이드 애니메이션은 animations.css로 이동 */

.template-edit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef;
}

.template-edit-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.template-edit-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #6c757d;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.template-edit-modal-close:hover {
  background: #f8f9fa;
  color: #495057;
}

.template-edit-modal-body {
  padding: 24px;
}

.edit-form-group {
  margin-bottom: 20px;
}

.edit-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #2c3e50;
}

.edit-form-group input,
.edit-form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.edit-form-group input:focus,
.edit-form-group textarea:focus {
  outline: none;
  border-color: #3498db;
}

.edit-form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.edit-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.edit-modal-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-modal-buttons .btn-cancel {
  background: #6c757d;
  color: white;
}

.edit-modal-buttons .btn-cancel:hover {
  background: #5a6268;
}

.edit-modal-buttons .btn-save {
  background: #3498db;
  color: white;
}

.edit-modal-buttons .btn-save:hover {
  background: #2980b9;
}

/* ========================================
   Template Storage Styles
   ======================================== */

/* 템플릿 보관함 레이아웃 */
.template-storage-layout {
  display: flex;
  flex-direction: column;
}

/* 템플릿 스토리지 헤더 */
.template-storage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 10px;
  gap: 20px;
}

/* 페이지 제목 스타일 */
.page-title {
  flex: 1;
}

.page-title h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
}

/* 하단 컨트롤 영역 */
.template-bottom-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
  gap: 20px;
}

/* 템플릿 카드 스타일 */
.template-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  cursor: pointer;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.template-preview {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.template-card:hover .preview-image {
  transform: scale(1.05);
}

.preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.template-card:hover .preview-overlay {
  opacity: 1;
}

.btn-preview-template {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-preview-template:hover {
  background: #fff;
  transform: scale(1.05);
}

.template-info {
  padding: 20px;
}

.template-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.4;
}

.template-url {
  font-size: 12px;
  color: #666;
  margin-bottom: 12px;
  word-break: break-all;
}

.template-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #999;
}

.template-category {
  padding: 4px 8px;
  background: #f8f9fa;
  border-radius: 12px;
  font-size: 11px;
  color: #666;
}

.template-date {
  color: #999;
}

.template-actions {
  display: flex;
  gap: 8px;
  padding: 15px 20px;
  border-top: 1px solid #f1f3f4;
}

.btn-edit,
.btn-delete {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-edit {
  background: #3498db;
  color: #fff;
}

.btn-edit:hover {
  background: #2980b9;
}

.btn-delete {
  background: #e74c3c;
  color: #fff;
}

.btn-delete:hover {
  background: #c0392b;
}

/* 반응형 디자인은 responsive.css로 이동 */

/* 이미지 요소 스타일 */
/* 요소 헤더 스타일 */
.element-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.element-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.element-delete-btn {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.element-delete-btn i {
  font-size: 12px;
}

.image-element-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* 이미지 요소 입력 영역 */

.image-info-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.youtube-title-section {
  display: flex;
  gap: 10px;
  align-items: center;
}

.image-action-section {
  margin-top: 10px;
}

.image-upload-container {
  display: flex;
  gap: 20px;
}

.image-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  height: 250px; /* 고정 높이 설정 */
  min-height: 250px; /* 최소 높이 보장 */
  position: relative; /* 이미지 포지셔닝을 위한 상대 위치 */
  overflow: hidden; /* 이미지가 컨테이너를 벗어나지 않도록 */
  width: 50%;
}

.image-upload-area i {
  font-size: 32px;
  color: #6c757d;
  margin-bottom: 10px;
}

.image-upload-area span {
  color: #6c757d;
  font-size: 14px;
}

.image-upload-area.has-image i,
.image-upload-area.has-image span {
  display: none;
}

.image-upload-area.has-image {
  padding: 0; /* 이미지가 있을 때는 패딩 제거 */
  border: none; /* 이미지가 있을 때는 테두리 제거 */
  background: transparent; /* 이미지가 있을 때는 배경 제거 */
}

.image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 이미지가 컨테이너에 맞게 조정되면서 비율 유지 */
  border-radius: 6px;
  margin-bottom: 10px;
  position: absolute; /* 절대 위치로 컨테이너 전체를 채움 */
  top: 0;
  left: 0;
  z-index: 1; /* 이미지를 뒤로 보내기 */
}

.btn-image-action {
  padding: 8px 16px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s ease;
  position: relative; /* 상대 위치 설정 */
  z-index: 2; /* 버튼을 이미지 위에 표시 */
  margin-top: 10px; /* 이미지와 버튼 사이 간격 */
}

.btn-image-action:hover {
  background: #2980b9;
}

.image-title-section label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.image-title-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.image-title-field:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.image-action-section label {
  display: block;
  font-weight: 500;
  color: #333;
}

.image-action-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 10px;
  transition: border-color 0.2s ease;
}

.image-action-select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.image-action-value {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.image-action-value:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 이미지 미리보기 */
.image-element-preview {
  text-align: center;
}

.image-preview-title {
  font-size: 14px;
  color: #666;
  text-align: center;
}

/* 이미지 요소 placeholder */
.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  text-align: center;
  color: #6c757d;
}

.image-placeholder:hover {
  border-color: #28a745;
  background: #f0fff0;
}

.image-placeholder i {
  font-size: 32px;
  margin-bottom: 15px;
  opacity: 0.6;
  color: #28a745;
}

.image-placeholder p {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 500;
}

.image-placeholder small {
  font-size: 12px;
  opacity: 0.8;
}

/* 연락처 요소 스타일 */
.contact-inputs {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.contact-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.contact-row:last-child {
  margin-bottom: 0;
}

.contact-input-group {
  flex: 1;
  align-items: center;
}

.contact-input-group label {
  font-weight: 600;
  color: #495057;
  font-size: 13px;
}

.contact-input-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.contact-input-group input:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 연락처 미리보기 - 디지털 명함 스타일 */
.contact-preview {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px;
  position: relative;
  overflow: hidden;
  min-height: 230px;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-item i,
.contact-item img.contact-icon {
  font-size: 16px;
  color: #007bff;
  width: 20px;
  height: 20px;
  text-align: center;
  object-fit: contain;
  flex-shrink: 0;
}

.contact-item a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

/* 명함 레이아웃 스타일 */
.contact-name {
  position: absolute;
  top: 40px;
  left: 30px;
  z-index: 10;
  width: 125px;
}

.contact-name h3 {
  margin: 0;
  color: #1f2937;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  word-wrap: break-word;
}

.contact-icons-section {
  position: absolute;
  bottom: 40px;
  right: 0px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 180px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  width: 100%;
  max-width: 180px;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-value {
  color: #1f2937;
  font-weight: 600;
  font-size: 11px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  flex: 1;
  max-width: 140px;
  overflow: hidden;
  text-overflow: hidden;
  white-space: nowrap;
}

/* 빈 상태 스타일 */
.contact-element-preview.empty-placeholder .contact-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  color: #999;
  font-style: italic;
}

.contact-element-preview.empty-placeholder .contact-preview::before {
  content: '연락처 정보를 입력하세요';
}

/* 연락처 요소 placeholder */
.contact-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  text-align: center;
  color: #6c757d;
}

.contact-placeholder:hover {
  border-color: #17a2b8;
  background: #f0f9ff;
}

.contact-placeholder i {
  font-size: 32px;
  margin-bottom: 15px;
  opacity: 0.6;
  color: #17a2b8;
}

.contact-placeholder p {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 500;
}

.contact-placeholder small {
  font-size: 12px;
  opacity: 0.8;
}

/* 유튜브 요소 입력 영역 */
.youtube-edit-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.youtube-link-section {
  display: flex;
}

/* 유튜브 제목 섹션 */

.youtube-title-section label {
  font-weight: 500;
  font-size: 14px;
  color: #333;
}

.youtube-title-field {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.youtube-title-field:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* URL 필드와 첨부 버튼을 한 줄에 배치 */
.youtube-url-field,
.map-location-field {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  width: 100%;
  margin-right: 10px;
}

.youtube-url-field:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.youtube-attach-btn,
.map-attach-btn {
  padding: 10px 20px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.youtube-attach-btn:active {
  transform: translateY(1px);
}

.youtube-attach-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.youtube-status-message {
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}

.youtube-status-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.youtube-status-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* YouTube placeholder and embed styles for preview area only */
.youtube-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  text-align: center;
  color: #6c757d;
}

.youtube-placeholder:hover {
  border-color: #ff0000;
  background: #fff5f5;
}

.youtube-placeholder.error {
  border-color: #ffc107;
  background: #fffbf0;
}

.youtube-placeholder i {
  font-size: 32px;
  margin-bottom: 15px;
  opacity: 0.6;
}

.youtube-placeholder p {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 500;
}

.youtube-placeholder small {
  font-size: 12px;
  opacity: 0.8;
}

.youtube-embed-preview {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.youtube-embed-preview iframe {
  width: 100%;
  height: 300px;
  border: none;
}

/* YouTube element in preview */
.youtube-element-preview {
  text-align: center;
}

.template-preview-phone-content .youtube-element-preview iframe {
  width: 100%;
  height: 180px;
  border-radius: 8px;
}

/* 지도 요소 입력 영역 */
.map-edit-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.map-title-section label,
.map-location-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.map-title-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.map-title-field:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 지도 위치 입력과 첨부 버튼을 한 줄에 배치 */
.map-location-section {
  display: flex;
}

.map-location-field:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 지도 미리보기 */
.map-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.map-preview i {
  font-size: 32px;
  color: #007bff;
  margin-bottom: 15px;
}

.map-preview p {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  text-align: center;
  color: #6c757d;
}

.map-placeholder i {
  font-size: 32px;
  color: #007bff;
  margin-bottom: 15px;
  opacity: 0.6;
}

.map-placeholder p {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 500;
}

.map-placeholder small {
  font-size: 12px;
  opacity: 0.8;
}

/* 예약 요소 입력 영역 */

.reservation-edit-section {
  margin-bottom: 15px;
}

.reservation-edit-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.reservation-title-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 15px;
  transition: border-color 0.2s ease;
}

.reservation-title-field:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.reservation-description-field {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s ease;
}

.reservation-description-field:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 예약 미리보기 */

.reservation-preview {
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.reservation-preview i {
  font-size: 32px;
  color: #28a745;
  margin-bottom: 15px;
}

.reservation-preview h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.reservation-preview p {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.reservation-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  text-align: center;
  color: #6c757d;
}

.reservation-placeholder i {
  font-size: 32px;
  color: #28a745;
  margin-bottom: 15px;
  opacity: 0.6;
}

.reservation-placeholder p {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 500;
}

.reservation-placeholder small {
  font-size: 12px;
  opacity: 0.8;
}

/* #previewContent 내부의 placeholder hover 스타일 제거 */
#previewContent .text-placeholder:hover,
#previewContent .image-placeholder:hover,
#previewContent .contact-placeholder:hover,
#previewContent .youtube-placeholder:hover,
#previewContent .map-placeholder:hover {
  border-color: #dee2e6;
  background: #f8f9fa;
}

/* YouTube Preview Title/Description Styles */
.template-title-preview {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  text-align: center;
}

/* Map Preview Title Styles */
.map-preview-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #007bff;
}

/* 카카오맵 관련 스타일 */
.map-placeholder-attached {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  text-align: center;
  color: #6c757d;
  min-height: 200px;
}

.map-placeholder-attached i {
  font-size: 32px;
  color: #007bff;
  margin-bottom: 15px;
  opacity: 0.6;
}

.map-placeholder-attached p {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 500;
}

.map-placeholder-attached small {
  font-size: 12px;
  opacity: 0.8;
  line-height: 1.4;
}

/* 주소 검색 모달 스타일 */
.address-search-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.address-search-modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

.address-search-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef;
}

.address-search-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.address-search-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #6c757d;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.address-search-modal-close:hover {
  background: #f8f9fa;
  color: #495057;
}

.address-search-modal-body {
  padding: 24px;
}

.search-input-section {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.address-search-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.address-search-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.address-search-btn {
  padding: 12px 20px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.address-search-btn:hover {
  background: #2980b9;
}

.search-results-section {
  max-height: 400px;
  overflow-y: auto;
}

.address-search-results {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #f8f9fa;
}

.search-placeholder,
.search-loading,
.search-no-results,
.search-error {
  padding: 20px;
  text-align: center;
  color: #6c757d;
  margin: 0;
}

.search-loading {
  color: #3498db;
}

.search-no-results {
  color: #e74c3c;
}

.search-error {
  color: #e74c3c;
}

.search-results-list {
  max-height: 350px;
  overflow-y: auto;
}

.search-result-item {
  padding: 15px 20px;
  border-bottom: 1px solid #e9ecef;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: #e3f2fd;
}

.result-name {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 5px;
  font-size: 14px;
}

.result-address {
  color: #6c757d;
  font-size: 13px;
  line-height: 1.4;
}

/* 지도 요소 버튼 스타일 수정 */
.map-location-section {
  display: flex;
}

.map-location-field {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.map-location-field:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.map-search-btn {
  padding: 10px 16px;
  background: #17a2b8;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.map-search-btn:hover {
  background: #138496;
}

/* 상세주소 섹션 스타일 */

.map-detail-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.map-detail-field:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 주소 정보 표시 스타일 개선 */
.map-address-info {
  margin-top: 10px;
  font-size: 13px;
  text-align: left;
}

.main-address {
  font-weight: 600;
}

.address-details {
  display: flex;
  gap: 5px;
  align-items: center;
}

/* 지도 placeholder에 상세주소 표시 */
.detail-info {
  color: #6c757d;
  font-size: 13px;
  margin: 5px 0;
  font-style: italic;
}

/* 예약 요소 스타일 */

.reservation-edit-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.reservation-service-section,
.reservation-fields-section,
.reservation-button-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reservation-service-section label,
.reservation-fields-section label,
.reservation-button-section label {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 5px;
}

.reservation-description-field,
.reservation-button-text {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.reservation-field textarea {
  resize: none;
}

.reservation-description-field {
  resize: none;
  min-height: 60px;
  max-height: 120px; /* 5줄 제한 (24px * 5줄) */
  overflow-y: hidden;
}

.reservation-field-group {
  width: 100%;
  display: flex;
  gap: 15px;
}

.reservation-field-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.reservation-field-item:hover {
  background: #e9ecef;
}

.reservation-field-checkbox {
  margin: 0;
  cursor: pointer;
}

.reservation-field-item label {
  font-size: 13px;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  margin: 0;
}

/* 예약 미리보기 스타일 */
.reservation-element-preview {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.reservation-header {
  margin-bottom: 10px;
}

.reservation-header i {
  margin-bottom: 12px;
}

.reservation-header h4 {
  color: #2c3e50;
  margin: 12px 0 8px 0;
}

.reservation-header p {
  color: #6c757d;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.reservation-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.reservation-field-row {
  display: flex;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.reservation-field-row .reservation-field {
  flex: 1;
  min-width: 0;
}

/* 하나의 필드만 있을 때 전체 너비 차지 */
.reservation-field-row .reservation-field:only-child {
  flex: 1;
  width: 100%;
}

.reservation-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.reservation-field label {
  font-weight: 600;
  font-size: 14px;
  color: #495057;
}

.reservation-date-input,
.reservation-time-select,
.reservation-name-input,
.reservation-phone-input,
.reservation-memo-input {
  padding: 10px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s ease;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.reservation-date-input:focus,
.reservation-time-select:focus,
.reservation-name-input:focus,
.reservation-phone-input:focus,
.reservation-memo-input:focus {
  outline: none;
  border-color: #28a745;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.reservation-submit-btn {
  margin-top: 8px;
  padding: 10px 20px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  align-self: flex-end;
  width: auto;
  min-width: 100px;
}

/* 예약 placeholder 스타일 */
.reservation-element-preview.empty-placeholder .reservation-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: #999;
  font-style: italic;
}

.reservation-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  text-align: center;
  color: #6c757d;
}

.reservation-placeholder i {
  margin-bottom: 15px;
  opacity: 0.6;
}

.reservation-placeholder p {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 500;
}

.reservation-placeholder small {
  font-size: 12px;
  opacity: 0.8;
}

/* ========================================
   Template Storage Page Styles
   ======================================== */

/* Storage Template Preview */
.storage-template-preview {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.storage-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.storage-template-preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  color: #6c757d;
  font-size: 14px;
}

/* storage-template-category 스타일 제거됨 (사용하지 않음) */

.storage-template-date {
  color: #666;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  flex: 1;
}

/* Storage Template Actions */
.storage-template-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.storage-btn-edit,
.storage-btn-delete {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 70px;
}

.storage-btn-edit {
  background: #3498db;
  color: #fff;
}

.storage-btn-edit:hover {
  background: #2980b9;
}

.storage-btn-delete {
  background: #e74c3c;
  color: #fff;
}

.storage-btn-delete:hover {
  background: #c0392b;
}

/* 중복된 storage-header 관련 스타일 제거됨 */

/* template-filter-select 스타일 제거됨 (사용하지 않음) */

/* Template Grid for Storage Page - 중복 제거됨 */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 20px;
  color: #adb5bd;
}

.empty-state h3 {
  margin: 0 0 10px 0;
  font-size: 20px;
  color: #495057;
}

.empty-state p {
  margin: 0 0 30px 0;
  font-size: 16px;
}

.btn-create-template {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #28a745;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.btn-create-template:hover {
  background: #218838;
  color: white;
  text-decoration: none;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  height: 80%;
}

.delete-modal {
  max-width: 400px;
  height: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
  margin: 0;
}

.close {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #000;
}

.modal-body {
  padding: 20px;
}

.preview-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.preview-info {
  margin-bottom: 15px;
}

.preview-info h4 {
  margin: 0 0 5px 0;
  color: #333;
}

.preview-info p {
  margin: 0;
  color: #6c757d;
  font-size: 14px;
}

.preview-frame-container {
  flex: 1;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  overflow: hidden;
  background: white;
}

.template-preview-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  background: white;
}

.delete-warning {
  color: #dc3545;
  font-size: 14px;
  margin: 10px 0 20px 0;
}

.delete-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-cancel,
.btn-confirm-delete {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-cancel {
  background: #6c757d;
  color: white;
}

.btn-cancel:hover {
  background: #5a6268;
}

.btn-confirm-delete {
  background: #dc3545;
  color: white;
}

.btn-confirm-delete:hover {
  background: #c82333;
}

/* Storage Modal Styles */
.storage-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.storage-modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  height: 80%;
}

.storage-delete-modal {
  max-width: 400px;
  height: auto;
}

.storage-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #dee2e6;
}

.storage-modal-header h3 {
  margin: 0;
}

.storage-close {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.storage-close:hover {
  color: #000;
}

.storage-modal-body {
  padding: 20px;
}

.storage-delete-warning {
  color: #dc3545;
  font-size: 14px;
  margin: 10px 0 20px 0;
}

.storage-delete-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.storage-btn-cancel,
.storage-btn-confirm-delete {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.storage-btn-cancel {
  background: #6c757d;
  color: white;
}

.storage-btn-cancel:hover {
  background: #5a6268;
}

.storage-btn-confirm-delete {
  background: #dc3545;
  color: white;
}

.storage-btn-confirm-delete:hover {
  background: #c82333;
}
