/* 고객 수집 정보 탭 관련 CSS */

/* 기본 입력 필드 스타일 */
.collection_input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.collection_input:focus {
    outline: none;
    border-color: var(--main-color);
    box-shadow: 0 0 0 2px rgba(var(--sub-color-rgb), 0.25);
}

/* datalist 화살표 완전히 숨기기 */
.collection_input[list] {
    height: 38px !important;
    line-height: 38px !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* 모든 브라우저에서 datalist 화살표 숨기기 */
.collection_input[list]::-webkit-calendar-picker-indicator {
    display: none !important;
    -webkit-appearance: none !important;
}

.collection_input[list]::-webkit-inner-spin-button,
.collection_input[list]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

/* Firefox용 datalist 드롭다운 화살표 숨기기 */
.collection_input[list]::-moz-list-bullet {
    display: none !important;
}

/* IE/Edge용 datalist 화살표 숨기기 */
.collection_input[list]::-ms-expand {
    display: none !important;
}

/* 기본 브라우저 스타일 제거 */
.collection_input[list] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* 입력 필드 컨테이너 */
.css_collection {
    display: flex;
    justify-content: flex-end !important;
    width: 100%;
}

/* 필드 행 스타일 */
.collection_field {
    margin-bottom: 12px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.collection_field:last-child {
    border-bottom: none;
}

/* 체크박스 스타일 - 개선된 버전 */
.field-checkbox {
    width: 20px !important;
    height: 20px !important;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0 !important;
    position: relative;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid var(--main-color);
    border-radius: 4px;
    background-color: white;
    display: inline-block !important;
    vertical-align: middle;
}

.field-checkbox:checked {
    background-color: var(--main-color);
    border-color: var(--main-color);
}

.field-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.field-checkbox:hover {
    border-color: var(--sub-color);
    box-shadow: 0 0 0 2px rgba(var(--sub-color-rgb), 0.25);
}

.field-checkbox:focus {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

/* 라벨 스타일 */
.collection_field .col_gr {
    width: 120px;
    flex-shrink: 0;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

/* 전체적용 버튼 스타일 */
.apply-all-btn {
    padding: 8px 16px;
    background: var(--main-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.apply-all-btn:hover {
    background: var(--sub-color) !important;
    transform: translateY(-1px);
}

.apply-all-btn:disabled {
    background: #888 !important;
    cursor: not-allowed !important;
    transform: none;
}

/* 컨트롤 영역 스타일 */
.collection-controls {
    padding: 12px;
    background: #fafafa;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #eaeaea;
}

.collection-controls > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.collection-controls .description {
    font-size: 12px;
    color: #666;
    flex: 1;
}

/* 탭 스타일 */
.collection-tabs {
    display: flex !important;
    border-bottom: 1px solid #ddd !important;
    margin-bottom: 15px !important;
    overflow-x: auto;
}

.collection-tab {
    background: #f8f8f8 !important;
    border: 1px solid #ddd !important;
    border-bottom: none !important;
    margin-right: 2px !important;
    border-radius: 4px 4px 0 0 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    padding: 12px 18px !important;
    display: inline-block !important;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    position: relative;
}

.collection-tab.active {
    background: var(--main-color) !important;
    border: 1px solid var(--sub-color) !important;
    border-bottom: none !important;
    color: white !important;
    font-weight: bold !important;
    font-size: 14px !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(var(--sub-color-rgb), 0.15) !important;
    z-index: 10 !important;
}

.collection-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--sub-color);
    border-radius: 0 0 1px 1px;
}

.collection-tab:hover:not(.active) {
    background: #f0f0f0 !important;
    color: #555 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* 탭 컨텐츠 스타일 */
.collection-tab-content {
    display: none !important;
    padding: 15px 0;
}

.collection-tab-content.active {
    display: block !important;
}

.collection-tab-contents {
    background: white;
    border-radius: 0 0 6px 6px;
    padding: 0 15px 15px 15px;
}

/* 오류 하이라이트 스타일 */
.collection_input.error-highlight {
    border: 2px solid #ff4444 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 5px rgba(255, 68, 68, 0.3) !important;
}

/* 고객 수집 정보 메인 컨테이너 */
.customer-collection-info {
    background: #fff;
    font-size: 10pt;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.customer-collection-info h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: bold;
    color: #000;
}

.customer-collection-info .description {
    font-size: 13px;
    color: #666;
    margin-bottom: 0;
}

/* 모바일 대응 */
@media (max-width: 1023px) {
    .customer-collection-info {
        max-height: 450px;
        overflow-y: auto;
        margin-bottom: 16px !important;
    }
    
    .collection-tab-contents {
        max-height: 300px;
        overflow-y: auto;
        padding: 0 10px 15px 10px !important;
    }
    
    .collection-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding: 0 10px;
        scrollbar-width: thin;
    }
    
    .collection-tab {
        display: inline-block;
        min-width: 80px;
        text-align: center;
        font-size: 12px;
        padding: 8px 12px !important;
    }
    
    /* 스크롤바 스타일 */
    .customer-collection-info::-webkit-scrollbar,
    .collection-tab-contents::-webkit-scrollbar,
    .collection-tabs::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    
    .customer-collection-info::-webkit-scrollbar-track,
    .collection-tab-contents::-webkit-scrollbar-track,
    .collection-tabs::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .customer-collection-info::-webkit-scrollbar-thumb,
    .collection-tab-contents::-webkit-scrollbar-thumb,
    .collection-tabs::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }
    
    .customer-collection-info::-webkit-scrollbar-thumb:hover,
    .collection-tab-contents::-webkit-scrollbar-thumb:hover,
    .collection-tabs::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
    
    /* 모바일에서 입력 필드 터치 개선 */
    .collection_input {
        min-height: 44px;
        font-size: 16px; /* iOS에서 줌 방지 */
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .collection_field {
        margin-bottom: 15px;
        padding: 10px 0;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    .collection_field .col_gr {
        font-size: 14px !important;
        margin-bottom: 0 !important;
        display: block !important;
        width: 120px !important;
        flex-shrink: 0 !important;
    }
    
    .css_collection {
        width: 100% !important;
        justify-content: stretch !important;
    }
    
    .collection-controls {
        padding: 10px !important;
    }
    
    .collection-controls > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .field-checkbox {
        width: 20px !important;
        height: 20px !important;
    }
}

/* 체크박스와 라벨 정렬 개선 */
.collection_field {
    align-items: flex-start;
}

.field-checkbox {
    margin-top: 2px; /* 라벨 텍스트와 수직 정렬 */
}

/* 선택된 필드 강조 */
.collection_field:has(.field-checkbox:checked) {
    background-color: rgba(var(--sub-color-rgb), 0.05);
    border-radius: 4px;
    padding: 12px 8px;
}

/* 애니메이션 효과 */
.collection-tab {
    transition: all 0.3s ease;
}

.collection_input {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.field-checkbox {
    transition: all 0.2s ease;
}

/* 입력 필드와 버튼이 함께 있는 컨테이너 (인라인) */
.input-with-button-inline {
    display: flex !important;
    gap: 4px !important;
    align-items: center !important;
    width: 100% !important;
}

/* 컴팩트 스캔 버튼 스타일 */
.scan-button-compact {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 4px 6px !important;
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
    background: #f8f8f8 !important;
    cursor: pointer !important;
    font-size: 11px !important;
    color: #666 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: auto !important;
}

.scan-button-compact:hover {
    background: #e8e8e8 !important;
    color: #444 !important;
}

.scan-button-compact svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0 !important;
}

/* 기존 스캔 버튼 스타일 유지 (호환성) */
.scan-button {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background: #f8f8f8 !important;
    cursor: pointer !important;
    font-size: 14px !important;
    color: #666 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-width: auto !important;
    height: auto !important;
}

.scan-button:hover {
    background: #e8e8e8 !important;
    color: #444 !important;
}

.scan-button svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
}

/* 모바일에서 컴팩트 버튼 대응 */
@media (max-width: 1023px) {
    .input-with-button-inline {
        gap: 3px !important;
    }
    
    .scan-button-compact {
        padding: 6px 4px !important;
        font-size: 10px !important;
        width: 45px !important;
        min-width: 45px !important;
        max-width: 45px !important;
    }
    
    .scan-button-compact svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    .collection_field {
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
    }
    
    .collection_field .col_gr {
        width: 100px !important;
        font-size: 13px !important;
    }
} 