.banner-preview-container {
    text-align: center;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    max-width: 100%;
    padding: 10px;
}

/* 탭 네비게이션 스타일 */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    color: #6c757d;
    font-weight: 600;
    padding: 12px 20px;
    margin-right: 4px;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border: none;
    color: #667eea;
    background: #f8f9fa;
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tab-content {
    padding-top: 0;
}

.tab-pane {
    min-height: 400px;
    padding: 1rem 0;
}

/* 컴팩트 설정 스타일 */
.compact-settings {
    padding: 0 0.5rem;
}

.compact-settings .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.compact-settings .form-label-xs {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 3px;
}

.compact-settings .form-label-sm {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
}

.compact-settings .form-range-sm {
    height: 6px;
}

.compact-settings .range-value-sm {
    display: inline-block;
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.3);
}

.compact-settings .form-control-color-sm {
    width: 100%;
    height: 30px;
    border-radius: 4px;
    border: 2px solid #dee2e6;
}

.compact-settings .mb-1 {
    margin-bottom: 0.5rem !important;
}

.compact-settings .mb-2 {
    margin-bottom: 0.75rem !important;
}

.compact-settings .mb-3 {
    margin-bottom: 1rem !important;
}

/* 탭별 일관된 여백 - 활성 탭에만 적용 */
.tab-pane .row.mb-3:last-child {
    margin-bottom: 0 !important;
}

.tab-pane .mb-2 {
    margin-bottom: 0.75rem !important;
}

/* 각 탭 콘텐츠의 여백 통일 */
#text-content,
#size-content,
#background-content,
#frame-content {
    padding: 0;
    margin: 0;
}

/* 프레임 옵션 여백 조정 */
.frame-options .row {
    margin-bottom: 0;
}

/* 폼 요소들의 일관된 간격 */
.compact-settings .form-control,
.compact-settings .form-select,
.compact-settings .form-range {
    margin-bottom: 0.5rem;
}

/* 버튼 그룹 여백 */
.compact-settings .btn-group {
    margin-bottom: 0.5rem;
}

/* 반응형 탭 디자인 */
@media (max-width: 768px) {
    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 14px;
    }

    .nav-tabs .nav-link i {
        display: none;
    }

    .tab-pane {
        min-height: 300px;
        padding: 0.5rem 0;
    }

    .compact-settings {
        padding: 0 0.25rem;
    }

    .border-frame-selector, .image-frame-selector {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }

    #text-content,
    #size-content,
    #background-content,
    #frame-content {
        padding-top: 0;
        padding-bottom: 0;
    }
}

#bannerCanvas {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    width: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.template-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--bs-primary);
}

.template-preview {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.template-name {
    display: block;
    padding: 8px;
    text-align: center;
    background: #f8f9fa;
    color: #6c757d;
    font-weight: 500;
}

.form-control-color {
    width: 100%;
    height: 38px;
    border-radius: 6px;
}

.btn-group .btn-check:checked + .btn {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 12px;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0 !important;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
}

.btn-outline-success {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
}

.form-select,
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-select:focus,
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

/* 배경 이미지 미리보기 */
#backgroundImagePreview {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

#backgroundImageThumb {
    border: 2px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 슬라이더 스타일 개선 */
.form-range {
    height: 12px;
    background: #dee2e6;
    border-radius: 12px;
    outline: none;
    opacity: 1;
    transition: all 0.2s;
    cursor: pointer;
    border: 2px solid #adb5bd;
    position: relative;
}

.form-range:hover {
    border-color: #667eea;
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.3);
    background: #e9ecef;
}

.form-range::-webkit-slider-track {
    height: 12px;
    background: #dee2e6;
    border-radius: 12px;
    border: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 4px solid #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
    transition: all 0.2s ease;
    margin-top: -10px;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.8);
    border-color: #ffffff;
}

.form-range::-moz-range-track {
    height: 12px;
    background: #dee2e6;
    border-radius: 12px;
    border: 2px solid #adb5bd;
}

.form-range::-moz-range-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 4px solid #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
    transition: all 0.2s ease;
}

.form-range::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.8);
    border-color: #ffffff;
}

/* 컴팩트 설정용 작은 슬라이더 */
.compact-settings .form-range-sm {
    height: 8px;
    border: 1px solid #adb5bd;
}

.compact-settings .form-range-sm::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -6px;
    border: 2px solid #ffffff;
}

.compact-settings .form-range-sm::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
}

/* 슬라이더 값 표시 개선 */
.range-value {
    display: inline-block;
    min-width: 45px;
    text-align: center;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6px 10px;
    border-radius: 8px;
    border: 2px solid #ffffff;
    font-size: 0.875rem;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* 프레임 선택 스타일 */
.frame-options {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.frame-options .form-label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.border-frame-selector, .image-frame-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    padding: 0.5rem 0;
}

.border-frame-option {
    position: relative;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 12px;
    padding: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.border-frame-option:hover {
    border-color: #667eea;
    background: #e7f1ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.border-frame-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #e7f1ff 0%, #f0f8ff 100%);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.border-frame-preview {
    width: 80px;
    height: 50px;
    background: #ffffff;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.border-frame-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    opacity: 0.1;
}

/* 각 프레임 스타일 */
.border-frame-preview.frame-none {
    border: none;
}

.border-frame-preview.frame-solid {
    border: 3px solid #667eea;
}

.border-frame-preview.frame-dashed {
    border: 3px dashed #667eea;
}

.border-frame-preview.frame-dotted {
    border: 3px dotted #667eea;
}

.border-frame-preview.frame-double {
    border: 6px double #667eea;
}

.border-frame-preview.frame-groove {
    border: 4px groove #667eea;
}

.border-frame-preview.frame-ridge {
    border: 4px ridge #667eea;
}

.border-frame-preview.frame-inset {
    border: 4px inset #667eea;
}

.border-frame-preview.frame-outset {
    border: 4px outset #667eea;
}

.border-frame-preview.frame-shadow {
    border: 2px solid #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* 이미지 프레임 옵션 스타일 */
.image-frame-option {
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 6px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-frame-preview {
    width: 70px;
    height: 40px;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.image-frame-name {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 500;
    color: #6c757d;
    background: rgba(255, 255, 255, 0.9);
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.1;
}

/* 각 이미지 프레임 스타일 */
.image-frame-preview.frame-vintage {
    background: linear-gradient(45deg, #8B4513, #D2B48C);
    border: 8px ridge #8B4513;
    box-shadow: inset 0 0 10px rgba(139, 69, 19, 0.5);
}

.image-frame-preview.frame-modern {
    background: linear-gradient(135deg, #2c3e50, #bdc3c7);
    border: 4px solid #34495e;
    box-shadow: 0 0 15px rgba(52, 73, 94, 0.3);
}

.image-frame-preview.frame-ornate {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: 6px groove #FFD700;
    box-shadow: inset 0 0 8px rgba(255, 215, 0, 0.6);
}

.image-frame-preview.frame-simple {
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
    border: 2px solid #95a5a6;
}

.image-frame-preview.frame-wooden {
    background: linear-gradient(45deg, #8B4513, #CD853F);
    border: 10px solid;
    border-image: linear-gradient(45deg, #8B4513, #CD853F) 1;
    box-shadow: inset 0 0 12px rgba(139, 69, 19, 0.4);
}

.image-frame-preview.frame-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 6px solid #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), inset 0 0 10px rgba(255, 215, 0, 0.3);
}

.image-frame-preview.frame-silver {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    border: 5px solid #C0C0C0;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.5);
}

.image-frame-preview.frame-polaroid {
    background: #ffffff;
    border: 15px solid #ffffff;
    border-bottom: 40px solid #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.border-frame-name {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 500;
    color: #6c757d;
    background: rgba(255, 255, 255, 0.9);
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.1;
}

/* 배경 타입 버튼 그룹 */
.btn-group .btn-check:checked + .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 파일 업로드 스타일 개선 */
input[type="file"] {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 12px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: #667eea;
    background: #e7f1ff;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .row {
        margin: 0 -10px;
    }

    .col-md-6,
    .col-md-3 {
        padding: 0 10px;
        margin-bottom: 20px;
    }

    .template-preview {
        height: 60px;
        font-size: 14px;
    }

    .banner-preview-container {
        min-height: 250px;
        padding: 10px;
    }

    #bannerCanvas {
        max-width: calc(100vw - 40px);
        max-height: 250px;
    }

    #backgroundImagePreview {
        text-align: center;
    }

    #backgroundImageThumb {
        max-width: 150px;
        max-height: 75px;
    }
}

@media (max-width: 480px) {
    .banner-preview-container {
        min-height: 200px;
        padding: 5px;
    }

    #bannerCanvas {
        max-width: calc(100vw - 30px);
        max-height: 200px;
    }
}

/* 로딩 스피너 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

/* 알림 스타일 */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}