* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Noto Sans KR', sans-serif;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); */
    max-width: 950px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 700;
}

.barcode-section {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.barcode-display {
    flex: 1;
    text-align: center;
    padding: 30px;
    border-radius: 10px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    user-select: all;
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
    cursor: pointer;
    position: relative;
}

.barcode-display::before {
    content: '클릭 시 선택';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.barcode-display::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.barcode-display:hover::before,
.barcode-display:hover::after {
    opacity: 1;
}

.barcode-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.barcode-container #barcode {
    cursor: pointer;
}

#barcode {
    width: 400px;
    height: 170px;
    object-fit: contain;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    cursor: text;
}

.barcode-navigation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    background: white;
    color: #667eea;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: scale(1.1);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.barcode-index {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
}

.barcode-indicators {
    position: absolute;
    left: -30px;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 20px;
}

.indicator-dot {
    width: 20px;
    height: 10px;
    border-radius: 15%;
    background: #d0d0d0;
    cursor: pointer;
    transition: all 0.3s;
}

.indicator-dot:hover {
    background: #999;
    transform: scale(1.2);
}

.indicator-dot.active {
    background: #ff0000;
    transform: scale(1.3);
}

.barcode-caption {
    margin-top: 10px;
    font-size: 18px;
    color: #000;
    font-weight: 500;
    user-select: text;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.barcode-memo {
    margin-top: 5px;
    font-size: 25px;
    color: #667eea;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    background: #f8f9ff;
    border: 1px solid #e0e7ff;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.barcode-memo:empty {
    display: none;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
 
.input-group label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.input-with-button {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-button input[type="text"],
.input-with-button textarea {
    flex: 1;
    padding: 12px 60px 12px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 20px;
    transition: border-color 0.3s;
    font-family: 'Roboto', 'Noto Sans KR', sans-serif;
    resize: none;
    overflow-y: auto;
    min-height: 200px;
    max-height: 800px;
}

.input-group input[type="text"],
.input-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: 'Roboto', 'Noto Sans KR', sans-serif;
}

.input-group-sub {
    display: flex;
    justify-content: space-between;
}

.input-group-sub .flex-end .auto-btn {
    margin-left: 20px;
}

.auto-btn {
    /* position: absolute; */
    /* right: 5px;
    top: 20px; */
    transform: translateY(-50%);
    background: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    margin-top: 12px;
    padding: 4px 8px;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Roboto', 'Noto Sans KR', sans-serif;
    font-weight: 500;
}

.auto-btn:hover {
    background: #e0e0e0;
}

.auto-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.input-group input[type="text"]:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Roboto', 'Noto Sans KR', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #667eea);
    transform: translateY(-2px);
}

.settings {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

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

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.setting-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.setting-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.setting-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.setting-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.color-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.color-settings .input-group {
    position: relative;
}

.color-settings input[type="text"] {
    padding-right: 50px;
}

.color-settings input[type="color"] {
    position: absolute;
    right: 5px;
    top: 35px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .color-settings {
        grid-template-columns: 1fr;
    }
    
    .barcode-navigation {
        position: static;
        transform: none;
        flex-direction: row;
        margin-top: 20px;
    }
}

/* 메모 버튼 그룹 스타일 */
.memo-group {
    margin-bottom: 20px;
}

.memo-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.memo-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.memo-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Roboto', 'Noto Sans KR', sans-serif;
}

.memo-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.memo-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.memo-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: 'Roboto', 'Noto Sans KR', sans-serif;
}

.memo-input:focus {
    outline: none;
    border-color: #667eea;
}

.memo-input.active {
    border-color: #667eea;
    background: #f8f9ff;
}

/* 고급 설정 토글 버튼 스타일 */
.advanced-toggle-btn {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Roboto', 'Noto Sans KR', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.advanced-toggle-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.advanced-toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.toggle-icon {
    font-size: 14px;
    transition: transform 0.3s;
}

.advanced-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

/* 고급 설정 섹션 스타일 */
.advanced-settings {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.advanced-settings.show {
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
}

@media print {
    @page {
        size: landscape;
        margin: 0.5in;
    }
    
    /* 브라우저 기본 헤더/푸터 제거 */
    @page {
        margin: 0;
    }
    
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body {
        background: white;
        padding: 0;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        max-width: 100%;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    h1,
    .controls,
    .toast {
        display: none !important;
    }
    
    .barcode-display {
        background: white;
        border-radius: 0;
        padding: 20px;
        margin: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    #barcode {
        width: 500px !important;
        height: 200px !important;
        max-width: 100%;
        object-fit: contain;
    }
}