/* ============================================
   1. 레이아웃 & 컨테이너
   ============================================ */
.group-list-section { display: flex; flex-direction: column; gap: 30px; }
.option-group { background: #f8f9fa; border: 2px solid #e0e0e0; border-radius: 12px; padding: 20px; }
.group-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.group-items { display: flex; flex-direction: column; gap: 15px; margin-bottom: 15px; }
.registered-items { margin-bottom: 20px; }
.group-select-wrapper { display: flex; gap: 10px; align-items: flex-end; }
.group-select-wrapper .form-group { flex: 1; margin: 0; }

/* ============================================
   2. 폼 & 입력 요소
   ============================================ */
.item-register-form { background: #fff; color: #333;  border-radius: 12px;}
.register-form-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.register-form-header h4 { font-size: 16px; font-weight: 600; color: #333; margin: 0; }
.item-register-form .form-group label { color: #000; font-weight: 500; }
.item-register-form input[type="file"],
.item-register-form input[type="text"],
.item-register-form input[type="number"] { background: white; }
.item-register-form .image-preview { background: #fff; border-radius: 8px; }
.group-name-input { flex: 1; padding: 12px 15px; font-size: 16px; font-weight: 600; border: 2px solid #ddd; border-radius: 8px; background: white; }
.group-name-input:focus { outline: none; border-color: #4A90E2; }

/* ============================================
   3. 테이블
   ============================================ */
.item-table { overflow-x: auto; }
.item-table table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; }
.item-table th { background: #f8f9fa; padding: 12px; text-align: left; font-size: 13px; font-weight: 600; border-bottom: 2px solid #e0e0e0; }
.item-table td { padding: 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.item-table tbody tr:hover { background: #f8f9fa; }

/* ============================================
   4. 버튼
   ============================================ */
.add-group-btn-top { padding: 10px 20px; background: #003380ff; color: white; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }
.add-group-btn-top:hover { background: #004499; }
.add-group-btn { padding: 10px 16px; background: #003380ff; color: white; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; white-space: nowrap; height: 44px; transition: all 0.3s; }
.add-group-btn:hover { background: #004499; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3); }
.add-group-btn i { margin-right: 4px; }
.register-item-btn { padding: 10px 20px; background: #00ca65; color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.register-item-btn:hover { background: #14c58a; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.register-item-btn i { margin-right: 5px; }
.remove-group-btn { padding: 10px 20px; background: #ff6b6b; color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.remove-group-btn:hover { background: #ff5252; }
.edit-item-btn,
.delete-item-btn { padding: 6px 12px; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; margin: 0 2px; }
.edit-item-btn { background: #ffc107; color: white; }
.edit-item-btn:hover { background: #e0a800; }
.delete-item-btn { background: #dc3545; color: white; }
.delete-item-btn:hover { background: #c82333; }
.save-item-btn,
.cancel-edit-btn { padding: 6px 12px; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; margin: 0 2px; }
.save-item-btn { background: #28a745; color: white; }
.save-item-btn:hover { background: #218838; }
.cancel-edit-btn { background: #6c757d; color: white; }
.cancel-edit-btn:hover { background: #5a6268; }
.btn-ghost { padding: 10px 20px; background: transparent; color: #666; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.btn-ghost:hover { background: #f5f5f5; border-color: #999; color: #333; }
.btn-primary { padding: 10px 20px; background: #003380ff; color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-primary:hover { background: #004499; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3); }

/* ============================================
   5. 모달 & 팝업
   ============================================ */
.modal-overlay,
.popup-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 10000; animation: fadeIn 0.2s; }
.modal-card { background: white; border-radius: 16px; width: 90%; max-width: 480px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); animation: slideUp 0.3s; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #e0e0e0; }
.modal-header strong { font-size: 18px; font-weight: 600; color: #333; }
.modal-x { width: 32px; height: 32px; border: none; background: #f5f5f5; border-radius: 50%; font-size: 20px; color: #666; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.modal-x:hover { background: #e0e0e0; color: #333; transform: rotate(90deg); }
.modal-body { padding: 24px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid #e0e0e0; background: #f8f9fa; border-radius: 0 0 16px 16px; }
.popup-box { width: 360px; background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.popup-box input,
.popup-box textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; }
.popup-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================
   6. 탭
   ============================================ */
.detail-tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #e0e0e0; }
.tab-btn { flex: 1; padding: 12px 20px; background: none; border: none; border-bottom: 3px solid transparent; font-size: 14px; cursor: pointer; transition: all 0.3s; color: #666; }
.tab-btn:hover { color: #333; background: #f5f5f5; }
.tab-btn.active { color: #4A90E2; border-bottom-color: #4A90E2; font-weight: 600; }
.tab-content { animation: fadeIn 0.3s; }

/* ============================================
   7. 템플릿 & 미리보기
   ============================================ */
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 10px; }
.template-item { cursor: pointer; text-align: center; }
.template-preview { width: 100%; aspect-ratio: 1; border: 2px solid #ddd; border-radius: 12px; display: flex; align-items: center; justify-content: center; transition: all 0.3s; position: relative; overflow: hidden; }
.template-item:hover .template-preview { border-color: #4A90E2; transform: translateY(-5px); box-shadow: 0 5px 15px rgba(74, 144, 226, 0.2); }
.template-item input[type="radio"] { margin-top: 8px; }
.template-item input[type="radio"]:checked + .template-preview,
.template-item .template-preview:has(+ input[type="radio"]:checked) { border-color: #4A90E2; border-width: 3px; }
.simple-template { background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%); }
.modern-template { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.cute-template { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.template-label { font-size: 16px; font-weight: 600; color: #333; padding: 8px 16px; background: rgba(255,255,255,0.9); border-radius: 20px; }
.modern-template .template-label,
.cute-template .template-label { color: #fff; background: rgba(0,0,0,0.2); }
.color-picker-group { display: flex; align-items: center; gap: 10px; }
.color-picker-group input[type="color"] { width: 60px; height: 40px; border: 1px solid #ddd; border-radius: 8px; cursor: pointer; }
#colorHex { font-family: 'Courier New', monospace; font-size: 14px; color: #666; }
.preview-info-btn { width: 100%; padding: 12px; background: #003380ff; color: white; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; margin-top: 15px; transition: background 0.3s; }
.preview-info-btn:hover { background: #004499; }
.auto-info-preview { margin-top: 20px; padding: 20px; background: #f8f9fa; border-radius: 12px; text-align: center; }
.auto-info-preview canvas { max-width: 100%; border: 1px solid #ddd; border-radius: 8px; margin: 15px 0; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
/* .auto-info-preview button { padding: 10px 30px; background: #28a745; color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; }
.auto-info-preview button:hover { background: #218838; } */
.grid-template {background: 
        linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: #f8f8f8;
}

/* ============================================
   8. 인라인 편집 모드
   ============================================ */
.editing-row td { background: #fffacd !important; padding: 8px !important; }
.editing-row input[type="text"],
.editing-row input[type="number"],
.editing-row select { width: 100%; padding: 6px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
.editing-row input[type="file"] { font-size: 12px; }
.editing-row .edit-preview-img { max-width: 60px; max-height: 60px; object-fit: cover; border-radius: 4px; margin-bottom: 5px; }

/* ============================================
   9. 임시저장
   ============================================ */
.temp-save-section { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.temp-save-btn,
.temp-load-btn,
.temp-clear-btn { padding: 12px 30px; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.temp-save-btn { background: #17a2b8; color: white; }
.temp-save-btn:hover { background: #138496; transform: translateY(-2px); }
.temp-load-btn { background: #6c757d; color: white; }
.temp-load-btn:hover { background: #5a6268; transform: translateY(-2px); }
.temp-clear-btn { background: #dc3545; color: white; }
.temp-clear-btn:hover { background: #c82333; transform: translateY(-2px); }
.temp-save-indicator { display: inline-block; padding: 4px 12px; background: #d4edda; color: #155724; border-radius: 4px; font-size: 12px; margin-left: 10px; }

/* ============================================
   10. 애니메이션
   ============================================ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }


@media (max-width:768px){
/* 인포 버튼 모바일 */
   .info-action-buttons {
      flex-direction: row;
      gap: 8px;
   }
   .info-download-btn,
   .info-use-btn {
      width: 100%;
      font-size: 12px;
      padding: 10px;
   }
   .info-download-btn:hover,
   .info-use-btn:hover {
      transform: none;
   }
   /* 임시저장 버튼 모바일 */
   .temp-save-section {
      flex-direction: row;
      gap: 8px;
      margin: 16px 0;
      padding: 0 10px;
   }
   .temp-save-btn,
   .temp-load-btn,
   .temp-clear-btn {
      width: 100%;
      padding: 12px;
      font-size: 12px;
   }
   
   .temp-save-btn:hover,
   .temp-load-btn:hover,
   .temp-clear-btn:hover {
      transform: none;
   }

   .temp-save-indicator {
      display: block;
      text-align: center;
      margin: 10px 0 0 0;
      padding: 8px;
      font-size: 11px;
   }
}
