/* 단가 관리 페이지 전용 스타일 (admin_common.css 위에서 동작) */

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #2541b2;
    background-color: rgba(74, 107, 255, 0.05);
}

.tab-btn.active {
    color: #2541b2;
    border-bottom-color: #2541b2;
    background-color: rgba(74, 107, 255, 0.1);
}

/* 탭 콘텐츠 영역 */
#tab-content-area {
    min-height: 400px;
    position: relative;
}

/* 로딩 스피너 */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(74, 107, 255, 0.2);
    border-radius: 50%;
    border-top-color: #4a6bff;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 준비 중 페이지 스타일 */
.coming-soon {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin: 20px 0;
}

.coming-soon-icon {
    margin-bottom: 20px;
    color: #4a6bff;
}

.coming-soon h2 {
    color: #2541b2;
    margin-bottom: 15px;
    font-size: 24px;
}

.coming-soon p {
    color: #6c757d;
    margin-bottom: 10px;
    font-size: 16px;
}

/* SweetAlert2 커스텀 스타일 */
.swal2-popup {
    font-family: 'Noto Sans KR', sans-serif;
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 0.5em;
    width: auto !important;
    min-width: 20em;
    max-width: 90% !important;
}

.swal2-title {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    padding: 0.5em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swal2-content {
    font-size: 0.85rem;
    padding: 0.3em;
}

.swal2-confirm {
    background-color: #4a6bff !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
    padding: 0.5em 1em !important;
}

.swal2-cancel {
    border-radius: 4px !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
    padding: 0.5em 1em !important;
}

.swal2-icon {
    width: 3em !important;
    height: 3em !important;
    margin: 0.5em auto !important;
    font-size: 0.8em !important;
}

.swal2-close {
    font-size: 1.5em !important;
}

.swal2-timer-progress-bar {
    height: 0.2em !important;
}

/* 토스트 스타일 */
.swal2-toast {
    max-width: none !important;
    width: auto !important;
    padding: 0.5em !important;
}

.swal2-toast .swal2-title {
    font-size: 0.9rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.swal2-toast .swal2-icon {
    width: 1.5em !important;
    height: 1.5em !important;
    margin: 0 0.5em 0 0 !important;
}

.swal2-toast .swal2-icon .swal2-icon-content {
    font-size: 0.9em !important;
}

/* admin-content 내부 폼 패딩 */
.admin-content #pricingForm {
    max-width: 1800px;
    margin: 0 auto;
    padding: 10px 15px 30px;
}

/* 관리자 페이지 레이아웃 - 가로 배열 */
.admin-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: space-between;
}

.admin-grid section {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    font-size: 13px;
    flex: 1;
    min-width: 300px;
    max-width: calc(20% - 15px); /* 5개 섹션을 한 줄에 배치 */
}

/* 섹션별 스타일 */
.section-basic {
    border-top: 3px solid #4a6bff;
}

.section-material {
    border-top: 3px solid #2ecc71;
}

.section-design {
    border-top: 3px solid #e74c3c;
}

.section-post {
    border-top: 3px solid #f39c12;
}

.section-discount {
    border-top: 3px solid #9b59b6;
}

.admin-grid section:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.admin-grid h2 {
    color: #2541b2;
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.section-basic h2 { color: #4a6bff; }
.section-material h2 { color: #2ecc71; }
.section-design h2 { color: #e74c3c; }
.section-post h2 { color: #f39c12; }
.section-discount h2 { color: #9b59b6; }

/* 테이블 기본 설정 */
.admin-grid table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

/* 테이블 셀 공통 스타일 */
.admin-grid th,
.admin-grid td {
    padding: 6px 5px;
    border: 1px solid #e9ecef;
    vertical-align: middle;
}

.admin-grid th {
    background: #f1f4f9;
    font-weight: 600;
    color: #495057;
    text-align: center;
    font-size: 12px;
}

.section-basic th { background-color: #e8efff; }
.section-material th { background-color: #e8f8e8; }
.section-design th { background-color: #fde8e8; }
.section-post th { background-color: #fff5e8; }
.section-discount th { background-color: #f5e8ff; }

.admin-grid tr:nth-child(even) {
    background-color: #f8f9fa;
}

.admin-grid tr:hover {
    background-color: #e9f0ff;
}

.section-basic tr:hover { background-color: #e8efff; }
.section-material tr:hover { background-color: #e8f8e8; }
.section-design tr:hover { background-color: #fde8e8; }
.section-post tr:hover { background-color: #fff5e8; }
.section-discount tr:hover { background-color: #f5e8ff; }

/* 단가 열과 저장된 단가 열 고정 너비 설정 */
.admin-grid table td:nth-child(2),
.admin-grid table th:nth-child(2),
.admin-grid table td:last-child,
.admin-grid table th:last-child {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

/* 금액 오른쪽 정렬 */
.admin-grid table td:nth-child(2),
.admin-grid table td:last-child {
    text-align: right;
}

/* 입력 필드 스타일 */
.admin-grid input[type="text"] {
    width: 100%;
    padding: 4px 6px;
    font-size: 13px;
    text-align: right;
    border: 1px solid #ced4da;
    border-radius: 4px;
    height: 28px;
    box-sizing: border-box;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.admin-grid input[type="text"]:focus {
    border-color: #4a6bff;
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.25);
    outline: none;
}

.section-basic input[type="text"]:focus { border-color: #4a6bff; box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.25); }
.section-material input[type="text"]:focus { border-color: #2ecc71; box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.25); }
.section-design input[type="text"]:focus { border-color: #e74c3c; box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.25); }
.section-post input[type="text"]:focus { border-color: #f39c12; box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.25); }
.section-discount input[type="text"]:focus { border-color: #9b59b6; box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.25); }

.admin-grid input[type="text"]:hover {
    border-color: #adb5bd;
}

/* DB 단가 스타일 - 숫자와 단위 사이 공백 추가 */
.admin-grid .saved-price {
    color: #6c757d;
    font-size: 12px;
    font-weight: 500;
    background-color: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
}

.admin-grid .saved-price:empty::after {
    content: "-";
    color: #adb5bd;
}

/* 저장 버튼 스타일 */
#saveAllPricing {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4a6bff, #2541b2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#saveAllPricing:hover {
    background: linear-gradient(135deg, #5a77ff, #3551c2);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#saveAllPricing:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#saveAllPricing:disabled {
    background: linear-gradient(135deg, #a0aec0, #718096);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 할인 입력 스타일 */
.discount-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.discount-input input {
    width: 60px;
}

.discount-input .unit {
    color: #495057;
    font-size: 12px;
    font-weight: 500;
}

/* 스크롤바 스타일 */
.admin-grid table::-webkit-scrollbar {
    width: 8px;
}

.admin-grid table::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.admin-grid table::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.admin-grid table::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 반응형 디자인 */
@media (max-width: 1600px) {
    .admin-grid section {
        max-width: calc(25% - 15px); /* 4개 섹션을 한 줄에 배치 */
    }
}

@media (max-width: 1200px) {
    .admin-grid section {
        max-width: calc(33.333% - 15px); /* 3개 섹션을 한 줄에 배치 */
    }
}

@media (max-width: 768px) {
    .admin-grid section {
        max-width: 100%; /* 모바일에서는 1열로 변경 */
    }
    
    .admin-grid table {
        font-size: 12px;
    }
    
    .admin-grid th,
    .admin-grid td {
        padding: 5px 4px;
    }
    
    .admin-grid input[type="text"] {
        padding: 4px 6px;
        height: 28px;
    }
    
    #saveAllPricing {
        padding: 12px;
        font-size: 16px;
    }
}

/* 값 변경 표시 */
.admin-grid input[type="text"].changed {
    background-color: #fff3cd;
    border-color: #ffc107;
}

/* 툴팁 스타일 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 180px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 4px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -90px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 작은 팝업 스타일 */
.small-popup {
    width: auto !important;
    min-width: 20em !important;
    max-width: 90% !important;
    font-size: 0.8rem !important;
    padding: 0.5em !important;
}

.small-title {
    font-size: 1rem !important;
    padding: 0.5em !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.small-content {
    font-size: 0.85rem !important;
    padding: 0.3em !important;
    white-space: normal !important;
}

.small-button {
    font-size: 0.8rem !important;
    padding: 0.5em 1em !important;
}

#gwan, #ri {
    cursor: text;
    user-select: none;
}
