/**
 * 수동 라벨 관리 탭 스타일
 */

.manual-label-management-container {
    padding: 25px;
    max-width: 1400px;
    /* margin: 0 auto; */
}

/* 헤더 섹션 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
    margin: 0;
    color: #343a40;
    font-weight: 600;
}

.section-header h2 i {
    color: #007bff;
    margin-right: 8px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* 벌크 라벨 버튼 */
.bulk-label-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.bulk-label-btn {
    padding: 6px 8px;
    border: 2px solid transparent;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-size: 12px;
}

.bulk-label-btn:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
    transform: translateY(-1px);
}

.bulk-label-btn:active {
    transform: translateY(0);
}

.bulk-label-btn .label-badge {
    font-size: 10px;
    padding: 6px 6px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* 필터 섹션 */
.filters-section {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: normal;
    justify-content: normal;
    align-items: end;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    align-items: flex-start;
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 150px;
}

.filter-group label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
    /* margin-bottom: 20px; */
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 체크박스 그룹 */
.checkbox-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    /* margin-bottom: 20px; */
    /* padding: 10px; */
    /* background: white; */
    /* border: 0px solid #dee2e6; */
    /* border-radius: 6px; */
    /* box-shadow: 0 1px 10px rgba(0, 0, 0, 0.15); */
}

.checkbox-item {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.checkbox-item:hover {
    background-color: #f8f9fa;
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #007bff;
    cursor: pointer;
}

.checkbox-item label {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    user-select: none;
}

.checkbox-item input:checked + label {
    color: #007bff;
    font-weight: 600;
}

/* 선택 정보 */
.selection-info {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 18px;
    background: #e3f2fd;
    border-radius: 8px;
    border: 1px solid #bbdefb;
}

#selection-count {
    font-weight: 600;
    color: #1976d2;
}

/* 아이템 그리드 */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
    gap: 10px;
    margin-bottom: 30px;
}

.item-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    cursor: pointer;
}

.item-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.item-card.selected {
    border-color: #007bff;
    background: #f8f9ff;
}

.item-checkbox {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
}

.item-checkbox input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    accent-color: #007bff;
}

.item-image {
    width: 100%;
    height: 105px;
    overflow: hidden;
    position: relative;
    /* background: #f8f9fa; */
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 4px;
}

.item-card:hover .item-image img {
    transform: scale(1.05);
}

.item-info {
    padding: 10px;
}

.item-name {
    font-size: 12px;
    font-weight: 600;
    color: #343a40;
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 10px;
    color: #6c757d;
}

.user-count {
    background: #e9ecef;
    padding: 2px 4px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 9px;
}

.created-date {
    font-weight: 400;
}

/* 라벨 배지 */
.item-labels {
    margin-bottom: 6px;
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    min-height: 16px;
    align-items: center;
}

.label-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 4px;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.label-new {
    background: #495057;
    color: white;
}

.label-hot {
    background: #343a40;
    color: white;
}

.label-popular {
    background: #6c757d;
    color: white;
}

.no-labels {
    color: #6c757d;
    font-size: 9px;
    font-style: italic;
}

/* 아이템 액션 */
.item-actions {
    display: flex;
    gap: 8px;
}

.item-actions .btn {
    flex: 1;
    font-size: 13px;
    padding: 8px 12px;
}

/* Buttons are defined in common.css; page-specific adjustments only here */

/* 로딩 및 빈 상태 */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 16px;
}

.loading i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* 모달 스타일 */
.modal-body .label-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.form-check:hover {
    background: #f8f9fa;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #007bff;
}

.form-check-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

/* 페이지네이션 */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .manual-label-management-container {
        padding: 15px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .filters-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    /* 모바일에서 체크박스 그룹 조정 */
    .checkbox-group {
        /* padding: 8px; */
        gap: 4px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .checkbox-item {
        padding: 4px 8px;
        gap: 4px;
    }
    
    .checkbox-item input[type="checkbox"],
    .checkbox-item input[type="radio"] {
        width: 14px;
        height: 14px;
    }
    
    .checkbox-item label {
        font-size: 12px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
    
    .bulk-label-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 6px 8px;
    }
    
    .bulk-label-btn {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .bulk-label-btn .label-badge {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    .selection-info {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .item-info {
        padding: 8px;
    }
    
    .item-meta {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
}

/* 애니메이션은 common.css에서 제공 - .fade-in 클래스 사용 */
.item-card {
    animation: fadeIn 0.3s ease;
}


/* 토스트 팝업 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    margin-bottom: 8px;
    min-width: 280px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--primary-600);
    color: #0f172a;
    background-color: var(--blue-light);
}

.toast.error {
    border-left-color: var(--danger-600);
    color: #0f172a;
    background-color: #fee2e2;
}

.toast.info {
    border-left-color: var(--primary-600);
    color: #0f172a;
    background-color: var(--blue-light);
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* 플로팅 버튼 */
.floating-buttons {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    background: white;
    padding: 15px 20px;
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
    z-index: 1000;
    gap: 12px;
    align-items: center;
}

/* 로딩 상태 */
.floating-bulk-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.floating-bulk-btn.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.floating-bulk-btn.loading .btn-text {
    opacity: 0;
}

.floating-buttons.show {
    display: flex;
    animation: slideUpFade 0.3s ease;
}

.floating-bulk-btn {
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.floating-bulk-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.floating-bulk-btn:active {
    transform: translateY(-1px);
}

.floating-bulk-btn.btn-new {
    background: #495057;
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.floating-bulk-btn.btn-new:hover {
    border-color: white;
    background: #343a40;
}

.floating-bulk-btn.btn-hot {
    background: #343a40;
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.floating-bulk-btn.btn-hot:hover {
    border-color: white;
    background: #212529;
}

.floating-bulk-btn.btn-popular {
    background: #6c757d;
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.floating-bulk-btn.btn-popular:hover {
    border-color: white;
    background: #495057;
}

.floating-bulk-btn.btn-remove {
    background: #adb5bd;
    color: #212529;
    border-color: rgba(33, 37, 41, 0.3);
    font-size: 13px;
}

.floating-bulk-btn.btn-remove:hover {
    border-color: #212529;
    background: #6c757d;
    color: white;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 모바일에서 플로팅 버튼 조정 */
@media (max-width: 768px) {
    .floating-buttons {
        bottom: 20px;
        left: 20px;
        right: 20px;
        transform: none;
        border-radius: 15px;
        padding: 12px 15px;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .floating-bulk-btn {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 15px;
    }
    
    .floating-bulk-btn.btn-remove {
        font-size: 11px;
        flex-basis: 100%;
        justify-content: center;
        margin-top: 4px;
    }
}

/* 프로그레스 오버레이 */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.progress-modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.progress-header {
    text-align: center;
    margin-bottom: 20px;
}

.progress-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.progress-overall {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-overall-bar {
    height: 100%;
    background: #007bff;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.progress-items {
    max-height: 300px;
    overflow-y: auto;
}

.progress-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #ddd;
    transition: all 0.3s ease;
}

.progress-item.processing {
    border-left-color: #007bff;
    background: #e3f2fd;
}

.progress-item.success {
    border-left-color: #495057;
    background: #e9ecef;
}

.progress-item.error {
    border-left-color: #343a40;
    background: #dee2e6;
}

.progress-item-icon {
    margin-right: 10px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.progress-item.pending .progress-item-icon::before {
    content: "⏳";
}

.progress-item.processing .progress-item-icon::before {
    content: "🔄";
    animation: spin 1s linear infinite;
}

.progress-item.success .progress-item-icon::before {
    content: "✅";
}

.progress-item.error .progress-item-icon::before {
    content: "❌";
}

.progress-item-content {
    flex: 1;
}

.progress-item-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.progress-item-status {
    font-size: 12px;
    color: #666;
}

.progress-actions {
    text-align: center;
    margin-top: 20px;
}

.btn-close-progress {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.btn-close-progress:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-close-progress:active {
    transform: translateY(0);
}

/* spin 애니메이션은 common.css에서 제공 */

/* 바디 하단 패딩 추가 (플로팅 버튼 공간 확보) */
body.has-floating-buttons {
    padding-bottom: 120px;
}

@media (max-width: 768px) {
    body.has-floating-buttons {
        padding-bottom: 140px;
    }
}

/* 스크롤바는 common.css의 .common-scrollbar 클래스 사용 */