/**
 * Data Input 팝업 및 사이드바 버튼 스타일
 * (templates/group001/template01/css/mapplerlite.css 에서 분리)
 */

/* 데이터 입력 버튼 (좌측 패널) */
.left-panel .sidebar-data-input-wrap {
    padding: 16px 18px 14px;
    margin-top: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    border-bottom: 1px solid #e9ecef;
}
.left-panel .sidebar-data-input-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #5b6bf0 0%, #8b5cf6 100%);
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(91, 107, 240, 0.3);
    box-sizing: border-box;
}
.left-panel .sidebar-data-input-btn:hover {
    opacity: 0.95;
    box-shadow: 0 3px 10px rgba(91, 107, 240, 0.35);
    color: #fff;
}

/* ===== 데이터 입력 레이어 팝업 ===== */
/* 모바일 상단 제목(#mobile-site-title: 10001)보다 위에 표시 */
.data-input-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.data-input-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}
.data-input-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.data-input-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #2c3e50;
    color: #fff;
}
.data-input-modal-icon {
    font-size: 1.2rem;
}
.data-input-modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}
.data-input-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    padding: 4px;
    font-size: 1.2rem;
    line-height: 1;
}
.data-input-modal-close:hover {
    color: #fff;
}
.data-input-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.data-input-map-wrap {
    margin-bottom: 0;
}
.data-input-form .data-input-field-location {
    margin-top: 6px;
}
.data-input-map {
    position: relative;
    width: 100%;
    height: 220px;
    background: #e9ecef;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}
/* 지도 이동 시 기준이 되는 가운데 고정 포인트 (map_center_target.png) */
.data-input-map-center-pin {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}
.data-input-map-center-pin-img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
}
/* Data Input 지도: 현재 위치 찾기 버튼 (오른쪽 상단) */
.data-input-btn-current-location {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 11;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    color: #0d6efd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.data-input-btn-current-location:hover {
    background: #f0f4ff;
    color: #0a58ca;
}
.data-input-btn-current-location:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.data-input-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.data-input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.data-input-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #212529;
    margin: 0;
}
.data-input-label .required {
    color: #dc3545;
    margin-right: 2px;
}
.data-input-input {
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
    width: 100%;
}
.data-input-input.data-input-readonly {
    background: #f8f9fa;
    color: #6c757d;
}
.data-input-input.data-input-hidden {
    display: none;
}

/* 이미지 필드: 사진 첨부 (모바일 카메라/갤러리) */
.data-input-field-image .data-input-file {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px dashed #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #f8f9fa;
    cursor: pointer;
    box-sizing: border-box;
}
.data-input-field-image .data-input-file:hover {
    border-color: #5b6bf0;
    background: #f0f2ff;
}
.data-input-image-hint {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: #6c757d;
}
.data-input-image-limit-hint {
    margin: 2px 0 0;
    font-size: 0.7rem;
    color: #c92a2a;
}
.data-input-field-image .data-input-file:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.data-input-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.data-input-preview-item {
    position: relative;
    flex-shrink: 0;
}
.data-input-preview-img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}
.data-input-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.data-input-preview-remove:hover {
    background: #dc3545;
}
.data-input-preview-remove:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 1px;
}

/* 업로드 진행 단계: 팝업 내 오버레이(반투명, 조작 불가), 카드는 팝업 정중앙 고정 배치 */
.data-input-upload-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}
.data-input-upload-progress-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 20px 24px;
    width: calc(100% - 48px);
    max-width: calc(100% - 48px);
    box-sizing: border-box;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.data-input-upload-progress-overlay .data-input-upload-progress-title {
    margin: 0 0 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
}
.data-input-upload-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.data-input-step {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    font-size: 0.875rem;
    color: #6c757d;
}
.data-input-step-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #dee2e6;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}
.data-input-step-icon::before {
    content: '';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}
.data-input-step[data-state="active"] .data-input-step-icon {
    background: #5b6bf0;
    color: #fff;
    animation: data-input-step-pulse 1s ease-in-out infinite;
}
.data-input-step[data-state="active"] {
    color: #2c3e50;
    font-weight: 500;
}
.data-input-step[data-state="done"] .data-input-step-icon {
    background: #198754;
    color: #fff;
}
.data-input-step[data-state="done"] .data-input-step-icon::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 11px;
}
.data-input-step[data-state="error"] .data-input-step-icon {
    background: #dc3545;
    color: #fff;
}
.data-input-step[data-state="error"] .data-input-step-icon::before {
    content: '\f00d';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 11px;
}
.data-input-step[data-state="error"] {
    color: #dc3545;
}
@keyframes data-input-step-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.data-input-step-label {
    flex: 1;
    min-width: 0;
}
.data-input-step-detail {
    width: 100%;
    font-size: 0.8rem;
    color: #868e96;
    margin-left: 32px;
    padding-left: 0;
}
.data-input-step[data-state="active"] .data-input-step-detail,
.data-input-step[data-state="error"] .data-input-step-detail {
    color: #495057;
}
.data-input-step[data-state="error"] .data-input-step-detail {
    color: #dc3545;
}

.data-input-upload-progress-close-wrap {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}
.data-input-upload-progress-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.data-input-upload-progress-close-btn:hover {
    background: #dee2e6;
    color: #2c3e50;
}

.data-input-select {
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
    width: 100%;
    background: #fff;
    cursor: pointer;
}
/* 커스텀 셀렉트 (옵션에 아이콘 표시) */
.data-input-custom-select {
    position: relative;
    width: 100%;
}
.data-input-custom-select-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
}
.data-input-custom-select-trigger:hover {
    border-color: #adb5bd;
}
.data-input-custom-select-trigger .data-input-cat-icon,
.data-input-custom-select-trigger .cat-dot {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}
.data-input-custom-select-trigger .cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.data-input-custom-select-trigger::after {
    content: '';
    margin-left: auto;
    border: 5px solid transparent;
    border-top-color: #495057;
    width: 0;
    height: 0;
}
/* 카테고리 레이어 팝업 (스크롤 없이 그리드로 한눈에 선택) */
.data-input-category-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    padding: 16px;
    box-sizing: border-box;
}
.data-input-category-layer[hidden] {
    display: none !important;
}
.data-input-category-layer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}
.data-input-category-popup {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 420px;
    width: 100%;
    min-height: 420px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.data-input-category-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-shrink: 0;
}
.data-input-category-popup-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}
.data-input-category-popup-close {
    background: none;
    border: none;
    padding: 4px;
    color: #6c757d;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.data-input-category-popup-close:hover {
    color: #212529;
}
.data-input-category-popup-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.data-input-category-popup-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
    width: 100%;
    box-sizing: border-box;
}
.data-input-category-popup-option:hover {
    border-color: #5b6bf0;
    background: #f0f2ff;
}
.data-input-category-popup-option .data-input-cat-icon,
.data-input-category-popup-option .cat-dot {
    flex-shrink: 0;
}
.data-input-category-popup-option .data-input-cat-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.data-input-category-popup-option .cat-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}
.data-input-category-popup-option span:last-child {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}
.data-input-category-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.data-input-category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    background: #fff;
    transition: background 0.2s, border-color 0.2s;
}
.data-input-category-item:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}
.data-input-category-item.selected {
    border-color: #5b6bf0;
    background: #f0f2ff;
}
.data-input-category-item .cat-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.data-input-category-item .data-input-cat-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}
.data-input-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}
.data-input-btn-close,
.data-input-btn-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #dee2e6;
    background: #fff;
    transition: background 0.2s, color 0.2s;
}
.data-input-btn-close {
    color: #dc3545;
    border-color: #dc3545;
}
.data-input-btn-close:hover {
    background: #dc3545;
    color: #fff;
}
.data-input-btn-save {
    color: #198754;
    border-color: #198754;
}
.data-input-btn-save:hover {
    background: #198754;
    color: #fff;
}
