/* body 스타일 제거 (글로벌 style.css와 충돌) */
/* body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
} */

/* 바코드 전용 컨테이너 클래스명 변경 */
.barcode-wrapper {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 20px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.barcode-container {
    flex: 2;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    position: relative;
}

.controls-container {
    flex: 1;
    padding: 20px;
    border-right: 1px solid #ddd;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

select, input, textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

textarea {
    height: 100px;
    resize: vertical;
}

/* 버튼 스타일 범위 제한 - 삭제 버튼 제외 */
.barcode-wrapper button:not(.remove-barcode) {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 10px;
}

.barcode-wrapper button:not(.remove-barcode):hover {
    background-color: #45a049;
}

.error {
    color: red;
    margin-top: 10px;
}

.barcode-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 40px;
    padding: 10px;
    width: 100%;
}

.barcode-item {
    border: 1px solid #ddd;
    padding: 15px 10px;
    text-align: center;
    position: relative;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: move;
    user-select: none;
    transition: all 0.2s ease;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.barcode-item.dragging {
    opacity: 0.7;
    background-color: #e3f2fd;
    border: 2px solid #2196F3;
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.barcode-item.drag-over {
    background-color: #bbdefb;
    border: 2px dashed #1976D2;
    transform: translateY(2px);
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.6);
    transition: all 0.3s ease;
}

.barcode-item svg {
    max-width: 100%;
    height: auto;
    width: 100% !important;
    height: 80px !important;
    display: block;
    margin: 0 auto;
    margin-top: 10px;
}

/* SVG 내부 바코드 요소 높이 조정 */
.barcode-item svg rect,
.barcode-item svg g {
    height: 100% !important;
}

/* 바코드 내부의 텍스트 숨김 처리 (추가 안전장치) */
.barcode-item svg text {
    display: none !important;
}

.barcode-number {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 12px;
    color: #666;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 5;
}

.barcode-value {
    margin-top: 15px;
    font-size: 12px;
    word-break: break-all;
    height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    position: relative;
    bottom: 0;
}

.remove-barcode {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    background: #ff3333 !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    z-index: 10 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}

.remove-barcode::before {
    content: '×';
    font-size: 16px;
    line-height: 1;
}

.remove-barcode:hover {
    background: #cc0000 !important;
    transform: scale(1.1) !important;
}

.barcode-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.print-button {
    background-color: #00A9FF !important;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 18px;
    box-shadow: none;
}

.print-button:hover {
    background-color: #0095E5 !important;
    transform: scale(1.05);
}

@media print {
    .barcode-controls {
        display: none;
    }
    .controls-container {
        display: none;
    }
    .barcode-container {
        border: none;
        padding: 0;
    }
    .barcode-item {
        break-inside: avoid;
    }
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .barcode-wrapper {
        flex-direction: column;
    }
    
    .controls-container {
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding-bottom: 20px;
        width: 100%;
    }
    
    .barcode-container {
        width: 100%;
        margin-top: 20px;
    }
    
    .barcode-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .barcode-grid {
        grid-template-columns: 1fr;
        padding: 5px;
        gap: 15px;
    }
    
    .barcode-wrapper {
        padding: 15px;
    }
    
    .controls-container, .barcode-container {
        padding: 15px;
    }
    
    .action-buttons {
        display: flex;
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
}

/* 바코드 페이지의 container 스타일 재정의 */
.barcode-page .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* 헤더 container는 global 스타일 유지 */
.barcode-page header .container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.barcode-page h1 {
    padding: 0 20px;
    margin: 20px 0;
    text-align: center;
    font-size: 1.8rem;
    color: #333;
}

/* 액션 버튼 스타일 */
.action-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 10px;
    color: white;
    transition: background-color 0.3s, transform 0.2s;
}

.add-button {
    background-color: #4CAF50;
}

.add-button:hover {
    background-color: #45a049;
}

.generate-button {
    background-color: #2196F3;
}

.generate-button:hover {
    background-color: #0b7dda;
}

.clear-button {
    background-color: #f44336;
}

.clear-button:hover {
    background-color: #d32f2f;
}

.action-button:active {
    transform: scale(0.98);
} 