/* 🎨 배민 가게소개 GIF 빌더 프리미엄 화이트 테마 */
.gif-builder-container {
    display: flex;
    gap: 36px;
    flex-wrap: wrap;
    margin-top: 15px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

.gif-control-panel {
    flex: 1;
    min-width: 500px;
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    color: #1e293b;
    box-shadow: 0 10px 35px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.gif-preview-panel {
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ✨ 상단 프리미엄 안내 배너 */
.membership-banner {
    background: linear-gradient(135deg, #eaf9f9 0%, #f0fdfa 100%);
    border: 1px solid #cffafe;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.banner-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #0f766e;
    display: flex;
    align-items: center;
    gap: 6px;
}

.banner-badge {
    background: #2ac1bc;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 99px;
    box-shadow: 0 2px 6px rgba(42, 193, 188, 0.2);
}

/* 탭 메뉴 디자인 */
.builder-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    border-bottom: 2px solid #f8fafc;
    padding-bottom: 16px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.builder-tabs::-webkit-scrollbar {
    display: none;
}

.builder-tab-btn {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 12px 20px;
    font-size: 0.88rem;
    font-weight: 800;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.builder-tab-btn:hover {
    color: #0f172a;
    border-color: #2ac1bc;
    background: #ffffff;
}

.builder-tab-btn.active {
    background: #2ac1bc;
    color: #ffffff;
    border-color: #2ac1bc;
    box-shadow: 0 4px 15px rgba(42, 193, 188, 0.25);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 2x2 격자 슬롯 업로더 */
.grid-slots-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.slot-card {
    background: #fdfdfd;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    padding: 24px 16px;
    text-align: center;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.slot-card:hover {
    border-color: #2ac1bc;
    background: #fcfefe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 193, 188, 0.05);
}

.slot-card-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #334155;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.upload-hint {
    font-size: 0.76rem;
    color: #94a3b8;
    margin-bottom: 8px;
    pointer-events: none;
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.thumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.thumb-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-thumb-remove {
    position: absolute;
    top: 0;
    right: 0;
    width: 18px;
    height: 18px;
    background: rgba(239, 68, 68, 0.95);
    color: #ffffff;
    border: none;
    border-radius: 0 0 0 8px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    z-index: 10;
    transition: background 0.15s;
}

.btn-thumb-remove:hover {
    background: #ef4444;
}

/* 단일 이미지 슬라이서 카드 */
.slicer-card {
    background: #fdfdfd;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    padding: 44px 20px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.slicer-card:hover {
    border-color: #2ac1bc;
    background: #fcfefe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 193, 188, 0.05);
}

.slicer-preview {
    max-width: 160px;
    max-height: 160px;
    margin: 20px auto 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* 🎛️ 프리미엄 세그먼트 컨트롤러 스타일 (라디오 버튼 커스텀) */
.segmented-control-group {
    background: #f8fafc;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 28px;
    border: 1px solid #e2e8f0;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-label {
    font-size: 0.88rem;
    font-weight: 800;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-value {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f766e;
}

/* 애플/배민 스타일 세그먼트 스위치 */
.segmented-switch {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    gap: 2px;
}

.segmented-switch input[type="radio"] {
    display: none;
}

.segmented-switch label {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #64748b;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 60px;
}

.segmented-switch input[type="radio"]:checked+label {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

/* 레인지 슬라이더 커스텀 */
.range-slider-container {
    width: 100%;
    margin-top: 10px;
}

.range-slider {
    width: 100%;
    height: 6px;
    border-radius: 99px;
    background: #e2e8f0;
    outline: none;
    accent-color: #2ac1bc;
    cursor: pointer;
}

/* 다운로드 메인 버튼 */
.submit-button {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
    background: #2ac1bc;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(42, 193, 188, 0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-button:hover:not(:disabled) {
    background: #23a6a1;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(42, 193, 188, 0.35);
}

.submit-button:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 📱 배달의민족 앱 정밀 시뮬레이터 목업 */
.baemin-phone-wrapper {
    width: 320px;
    height: 640px;
    background: #f4f4f4;
    border: 10px solid #111111;
    border-radius: 36px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.phone-speaker {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 55px;
    height: 5px;
    background: #222222;
    border-radius: 3px;
    z-index: 10;
}

.phone-camera {
    position: absolute;
    top: 10px;
    left: calc(50% + 38px);
    width: 7px;
    height: 7px;
    background: #222222;
    border-radius: 50%;
    z-index: 10;
}

.baemin-app-header {
    height: 52px;
    background: #2ac1bc;
    /* 배민 시그니처 민트색 */
    color: #ffffff;
    display: flex;
    align-items: center;
    padding: 12px 18px 0;
    font-size: 0.9rem;
    font-weight: 800;
}

.baemin-app-body {
    height: 568px;
    overflow-y: auto;
    background: #ffffff;
}

.shop-meta-card {
    padding: 16px;
    border-bottom: 8px solid #f6f6f6;
}

.shop-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 6px;
}

.shop-rating {
    font-size: 0.78rem;
    color: #ffbb00;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 700;
}

.shop-rating span {
    color: #64748b;
    font-weight: normal;
}

.baemin-sample-description {
    padding: 14px 18px;
    font-size: 0.76rem;
    color: #475569;
    line-height: 1.5;
    border-top: 1px solid #f1f5f9;
    margin-top: 14px;
}

.baemin-section-title {
    padding: 16px 18px 10px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #1e293b;
}

/* 1:1 가게 콘텐츠보드 4분할 격자 박스 */
.baemin-board-box {
    width: 284px;
    height: 284px;
    margin: 0 auto;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
    border: 2px solid #e2e8f0;
    box-sizing: border-box;
    position: relative;
}

.preview-slot {
    background: #fafafa;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    opacity: 0;
}

.preview-slot img.active {
    opacity: 1;
}

.preview-placeholder {
    font-size: 0.7rem;
    color: #cbd5e1;
    font-weight: 800;
    z-index: 1;
}

/* 로딩 애니메이션 스피너 */
.loader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-direction: column;
    gap: 18px;
}

.spinner {
    width: 52px;
    height: 52px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: #2ac1bc;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 올인원 미리보기 4분할 시뮬레이션용 CSS */
.preview-slot img.aio-piece-1 {
    width: 200% !important;
    height: 200% !important;
    max-width: none !important;
    max-height: none !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    object-fit: cover !important;
}

.preview-slot img.aio-piece-2 {
    width: 200% !important;
    height: 200% !important;
    max-width: none !important;
    max-height: none !important;
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    left: auto !important;
    bottom: auto !important;
    object-fit: cover !important;
}

.preview-slot img.aio-piece-3 {
    width: 200% !important;
    height: 200% !important;
    max-width: none !important;
    max-height: none !important;
    position: absolute !important;
    left: 0 !important;
    bottom: 0 !important;
    right: auto !important;
    top: auto !important;
    object-fit: cover !important;
}

.preview-slot img.aio-piece-4 {
    width: 200% !important;
    height: 200% !important;
    max-width: none !important;
    max-height: none !important;
    position: absolute !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    top: auto !important;
}

/* 실시간 미리보기 효과 트랜지션 CSS */
.preview-slot img.effect-normal {
    transition: none !important;
    opacity: 0;
    z-index: 1;
}

.preview-slot img.effect-normal.active {
    opacity: 1 !important;
    z-index: 2;
}

.preview-slot img.effect-fade {
    transition: opacity 0.35s ease-in-out !important;
    opacity: 0;
    z-index: 1;
}

.preview-slot img.effect-fade.active {
    opacity: 1 !important;
    z-index: 2;
}

.preview-slot img.effect-slide {
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1) !important;
    opacity: 1 !important;
    transform: translateX(-100%);
    z-index: 1;
}

.preview-slot img.effect-slide.active {
    transform: translateX(0) !important;
    z-index: 2;
}

.preview-slot img.effect-wipe {
    transition: clip-path 0.45s ease-in-out !important;
    opacity: 1 !important;
    clip-path: inset(0 0 100% 0);
    z-index: 1;
}

.preview-slot img.effect-wipe.active {
    clip-path: inset(0 0 0 0) !important;
    z-index: 2;
}

/* 📱 모바일 반응형 미디어 쿼리 */
@media (max-width: 1024px) {
    .gif-builder-container {
        flex-direction: column;
        gap: 28px;
        padding-left: 16px;
        padding-right: 16px;
        overflow: hidden;
        max-width: 100%;
    }

    .gif-control-panel {
        min-width: 100% !important;
        max-width: 100% !important;
        padding: 20px;
        box-sizing: border-box;
        overflow: hidden;
    }

    .gif-preview-panel {
        width: 100% !important;
        align-items: center;
        margin-top: 10px;
        overflow: hidden;
    }

    /* 📱 모바일 전용 버튼 텍스트 최적화 */
    .submit-button {
        padding: 14px 12px;
        font-size: 0.85rem;
        line-height: 1.4;
        word-break: keep-all;
        flex-wrap: wrap;
        text-align: center;
    }
}

/* 🛡️ 실시간 미리보기 이미지 불법 유출 방지용 투명 보안 실드 */
.baemin-board-box {
    position: relative;
}

.preview-shield {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: transparent;
    cursor: default;
}

/* 모바일 및 터치 기기에서 이미지 길게 터치 시 저장되는 팝업 억제 */
.preview-slot img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
    /* 이미지 마우스 이벤트 완전 차단 */
}

/* 📱 모바일/데스크톱 텍스트 분기 처리 */
.mobile-text {
    display: none;
}

.desktop-text {
    display: inline;
}

@media (max-width: 640px) {

    /* 모바일/데스크톱 텍스트 노출 조절 */
    .mobile-text {
        display: inline;
    }

    .desktop-text {
        display: none;
    }

    /* 모바일 3분할 그리드 탭 개선 (가로 스크롤 제거) */
    .builder-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        overflow-x: visible;
        white-space: normal;
        border-bottom: none;
        padding-bottom: 10px;
    }

    .builder-tab-btn {
        flex-direction: column;
        padding: 12px 4px;
        font-size: 0.72rem;
        gap: 6px;
        border-radius: 12px;
        text-align: center;
        justify-content: center;
        width: 100%;
        white-space: normal;
    }

    .builder-tab-btn span {
        white-space: normal;
        word-break: keep-all;
        line-height: 1.2;
    }

    .builder-tab-btn i {
        width: 18px;
        height: 18px;
    }

    /* 컨트롤 행 및 스위치 모바일 세로 배치 (가로 스크롤 방지) */
    .control-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .control-label {
        font-size: 0.82rem;
    }

    .segmented-switch {
        width: 100%;
        box-sizing: border-box;
    }

    .segmented-switch label {
        flex: 1;
        min-width: 0;
        padding: 8px 2px;
        font-size: 0.75rem;
    }

    /* 2x2 격자 슬롯 간격 및 패딩 조절 */
    .grid-slots-container {
        gap: 10px;
        margin-bottom: 20px;
    }

    .slot-card {
        padding: 16px 8px;
    }

    .slot-card-title {
        font-size: 0.78rem;
        gap: 4px;
    }

    .upload-hint {
        font-size: 0.7rem;
    }

    /* 다운로드 버튼 텍스트 크기 조절 */
    .submit-button {
        padding: 12px 10px;
        font-size: 0.8rem;
        gap: 6px;
    }

}

/* 🔒 비회원 및 일반회원용 슬롯 잠금 효과 */
.membership-locked,
.member-locked {
    position: relative;
    opacity: 0.85;
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
}

.membership-locked:hover,
.member-locked:hover {
    opacity: 1;
    border-color: #2ac1bc !important;
    background: #f0fdfa !important;
    transform: translateY(-2px);
}

/* 비회원용 멤버십 전용 배지만 우측 상단에 노출 */
.membership-locked::after {
    content: '🔒 회원 전용';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0f766e;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 99px;
    box-shadow: 0 2px 6px rgba(15, 118, 110, 0.25);
    z-index: 10;
    pointer-events: none;
    transition: all 0.25s ease;
}

.membership-locked:hover::after {
    background: #2ac1bc;
    box-shadow: 0 4px 10px rgba(42, 193, 188, 0.3);
}