/**
 * ============================================================
 * DASHBOARD MAIN STYLES
 * ============================================================
 *
 * 역할: ba.ro 대시보드 통합 스타일시트
 *
 * 📑 목차 (Table of Contents):
 *    0. RESPONSIVE BREAKPOINTS (NEW - 2025-11-09)
 *    1. Base Layout (Container, Grid)
 *    2. Sidebar & Navigation (Menu, Logo, Account)
 *    3. Image Link Preview (Large cards, Thumbnails)
 *    4. Profile Settings - EXTRACTED (→ 4-features-profile-settings.css)
 *    5. Preview System
 *       5.1 Background Image Mode
 *       5.2 PRO Badge Toggle
 *       5.3 Profile Style Toggle
 *       5.4 YouTube Embed
 *       5.5 Mobile Preview (Littlelink Frame)
 *    6. Browser Compatibility (Fallbacks)
 *    7. Fonts (MaruBuri @font-face)
 *    8. Background Upload UI (Filters, Preview)
 *    9. Links Management (Accordion, Special links)
 *
 * 의존성:
 *   - 1-foundation-variables.css (필수)
 *   - 1-foundation-reset.css (필수)
 *
 * 분리됨:
 *   - 3-components-brands.css (214 lines, Phase 2)
 *   - 3-components-modals.css (387 lines, Phase 3)
 *   - 4-features-links-accordion.css (563 lines, Phase 4)
 *   - 4-features-design-controls.css (219 lines, Phase 5)
 *   - 4-features-profile-settings.css (453 lines, Phase 6)
 *
 * Last Updated: 2025-11-10 (Profile Settings 분리 - Phase 6 완료)
 * ============================================================
 */



/* ============================================================
   1. BASE LAYOUT
   ============================================================ */

.container {
    display: flex;
    min-height: 100vh;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================================
   2. SIDEBAR & NAVIGATION
   ============================================================ */

.sidebar {
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
    text-align: center;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--light-text);
    text-align: center;
    margin-bottom: 30px;
}

.menu-item {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-item:hover {
    background: var(--secondary-color);
    border-color: var(--border-color);
}

.menu-item.active {
    background: var(--primary-color);
    color: white;
}

/* 계정 관리 버튼 */
.sidebar-bottom {
    margin-top: auto;
}

.account-btn {
    width: 100%;
    padding: 12px 15px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.account-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* URL 생성 영역 스타일 - 깔끔한 카드 형태 */
.url-section {
    background: white;
    border-radius: 0;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.url-display {
    background: #C46686;
    padding: 32px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.url-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0;
    background: transparent;
    text-decoration: none;
    transition: all 0.3s ease;
}

.url-link:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.url-icon {
    width: 24px;
    height: 24px;
    color: #1a1a1a;
    flex-shrink: 0;
}

.url-prefix,
.url-slug {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
}

.url-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    background: #fff0f7;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-hover);
    background: white;
}

.url-status {
    padding: 16px 32px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    text-align: left;
    display: none;
}

.url-status.success {
    display: block;
    background: white;
    color: #1a1a1a;
    border: none;
}

.url-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.url-status.loading {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.url-status.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 10px;
    font-weight: 500;
}

.url-status.warning::before {
    content: "⚠️ ";
    margin-right: 8px;
}

.generated-url {
    display: inline-block;
    background: white;
    padding: 8px 15px;
    border-radius: 6px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 16px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
}

.copy-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* 메인 컨텐츠 영역 */
.main-content {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    background: white;
    border-radius: 0;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

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

h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 22px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

input[type="text"],
input[type="url"],
input[type="file"],
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
}

.color-option.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 46, 122, 0.5);
}

.btn {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
}

.btn-success:hover {
    background: #27ae60;
}

/* 🔥 아코디언 시스템으로 이동 - dashboard.html에서 관리 */
/* .link-item 스타일은 dashboard.html 내부 <style>에 정의됨 */

.link-drag-handle {
    cursor: move;
    color: #999;
    font-weight: bold;
    margin-right: 10px;
    user-select: none;
    padding: 8px 5px;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 16px;
    line-height: 1;
    touch-action: none;  /* 🔥 Dragula 모바일 필수 */
    opacity: 0.6;
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 1;  /* 🔥 모바일 미리보기보다 낮게 */
}

.link-drag-handle:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
}

.link-drag-handle:active {
    cursor: grabbing;
    background: rgba(0, 0, 0, 0.15);
    color: var(--primary-color);
}

/* Dragula 드래그 스타일은 내장 CSS 사용 */

.link-content {
    display: flex;
    align-items: center;
    flex: 1;
}

.link-info h4 {
    margin-bottom: 5px;
    color: var(--text-color);
}

.link-info small {
    color: var(--light-text);
}

.link-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.3s;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 통계 페이지 스타일 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--secondary-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.stat-title {
    font-size: 14px;
    color: var(--light-text);
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--light-text);
}

.stats-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
}

.no-data {
    text-align: center;
    color: var(--light-text);
    padding: 40px;
    background: var(--secondary-color);
    border-radius: 8px;
}

.summary-stats {
    background: var(--secondary-color);
    border-radius: 8px;
    padding: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--text-color);
    font-weight: 600;
}

.summary-value {
    color: var(--primary-color);
    font-weight: bold;
}

.link-stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--secondary-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.link-stat-info h4 {
    margin-bottom: 5px;
    color: var(--text-color);
    font-size: 16px;
}

.link-stat-info small {
    color: var(--light-text);
}

.link-stat-clicks {
    text-align: right;
}

.click-count {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.click-label {
    font-size: 12px;
    color: var(--light-text);
}

/* 🔥 v4.1: PC 프리뷰 프레임 (배경 담당, 모바일과 동일한 구조) */
.pc-screen {
    position: relative; /* ::before 기준점 */
    width: 100%;
    max-width: 375px; /* 🔥 iPhone SE 크기로 제한 */
    height: 90vh; /* 🔥 고정 높이 (스크롤 작동 위해 필수) */
    max-height: 700px;
    align-self: flex-start;
    margin-right: 25px;
    margin-top: 30px;
    border-radius: 30px;
    background: white;
    border: 8px solid #4d4d4d; /* 🔥 핸드폰 목업 스타일 검은 테두리 (명도 30% 증가) */
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(77, 77, 77, 0.3), /* 번지는 효과 */
        0 0 40px rgba(77, 77, 77, 0.15); /* 외부 글로우 */
    overflow: hidden; /* 내부 요소가 둥근 모서리를 넘어가지 않도록 */

    /* CSS 변수 초기값 */
    --pc-bg-image: none;
    --pc-bg-filter: none;
}

/* 🔥 v4.1: PC 프리뷰 배경 레이어 (콘텐츠와 분리) */
.pc-screen.has-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1; /* 콘텐츠(z-index: 2)보다 아래 */

    background-image: var(--pc-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: var(--pc-bg-filter);
}

/* 오른쪽 미리보기 영역 (스크롤 컨테이너) */
.preview-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative; /* z-index 적용 */
    z-index: 2; /* 배경 레이어보다 위 */
}

/* PC 프리뷰용 스타일 오버라이드 (.pc-screen 내부일 때) */
.pc-screen .preview-wrapper {
    max-width: none; /* pc-screen이 제어 */
    max-height: none; /* pc-screen이 제어 */
    border-radius: 0; /* pc-screen이 제어 */
    box-shadow: none; /* pc-screen이 제어 */
    background: transparent; /* pc-screen::before가 제어 */
    margin: 0; /* 여백 제거 */
}

/* 스크롤바 숨김 */
.preview-wrapper::-webkit-scrollbar {
    display: none;
}

.preview-wrapper {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.preview-container {
    width: 360px;
    padding: 20px;
}

.preview-header {
    text-align: center;
    margin: 40px 20px 20px 20px;
}

.preview-profile {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    display: block;
    border: none;
    background: transparent; /* 🔥 PNG 투명도 유지 */
}

.preview-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-color);
}

.preview-bio {
    font-size: 18px; /* 14px → 18px (약 30% 증가) */
    color: var(--light-text);
    margin-bottom: 15px;
}

.preview-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-link {
    padding: 12px;
    background: var(--secondary-color);
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
    word-break: break-word;
    overflow-wrap: break-word;
    min-height: 44px;
}

.preview-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* 🔥 v4.1: PC 프리뷰 배경 활성화 시 링크 스타일 */
.pc-screen.has-background .preview-link {
    background-color: rgba(244, 244, 245, 0.95) !important; /* 반투명 배경 */
}

.pc-screen.has-background .preview-link:hover {
    background-color: var(--primary-color) !important;
    color: white;
}

/* 🔥 배경 타입 선택 */
.bg-type-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.type-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.type-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.type-option span {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
}

.type-option:hover span {
    color: #333;
}

.type-option input[type="radio"]:checked + span {
    color: var(--primary-color, #3b82f6);
    font-weight: 600;
}

/* 배경 섹션 전환 애니메이션 */
#bg-color-section,
#bg-image-section {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

/* 🔥 ba.ro 링크 버튼 기본 스타일 (brands.css 아이콘과 함께 사용) */
.button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: var(--radius-md, 8px);  /* CSS 변수 사용 */
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-size-base, 15px);
    transition: var(--transition-base, all 0.3s ease);  /* 흔들림 방지 */
    border: none;
    cursor: pointer;
    
    /* 기본 색상 (JavaScript로 오버라이드됨) */
    background: var(--secondary-color, #f4f4f5);
    color: var(--text-color, #1a1a1a);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 모바일 전용 요소들 */
.mobile-preview-btn {
    display: none;  /* 🔥 기본은 숨김 */
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    background: #1a1a1a;  /* 🔥 클로드 블랙 */
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s;
    align-items: center;
    gap: 8px;
}

.mobile-preview-btn i {
    width: 20px;
    height: 20px;
}

.mobile-preview-btn:hover {
    background: #2a2a2a;  /* 🔥 호버 시 약간 밝게 */
    transform: translateX(-50%) translateY(-2px);
}

.mobile-preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7); /* 🔥 30% 더 어둡게 (0.4 → 0.7) */
    z-index: 999;
    padding: 0;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center; /* 🔥 수평 중앙 정렬 */
    justify-content: center; /* 🔥 수직 중앙 정렬 */
}

/* 🔥 Option B: 활성 상태 (인라인 스타일 제거) */
.mobile-preview-overlay.active {
    display: flex;  /* 활성화 시 표시 */
}

/* 🔥 버튼 숨김 클래스 */
.mobile-preview-btn.hidden {
    display: none;
}

/* 바이오 컨테이너 스타일 - 480px에 맞춰 조정 */
.bio-container {
    background: #f8f6f3;
    border-radius: 30px;
    padding: 40px 32px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 1px rgba(180, 170, 160, 0.15);
    text-align: center;
    position: relative;
    border: 1px solid rgba(200, 190, 180, 0.2);
    margin: 0 auto;
}

/* ✅ 중복 스타일 제거됨: .close-preview-btn은 Line 2295에서 .preview-footer .close-preview-btn으로 정의됨 */

/* ============================================================
   3. IMAGE LINK PREVIEW
   ============================================================ */

/* 큰 이미지 카드 스타일 */
.image-link-card.large {
    width: 100%;
    background: transparent;  /* ✅ 투명하게 변경 (모서리 흰색 제거) */
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    /* 🔥 border-radius는 JavaScript에서 동적 적용 (인라인 스타일) */
}

.image-link-card.large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.image-link-top {
    width: 100%;
    /* 🔥 height 제거 - aspect-ratio로 동적 계산 */
    overflow: hidden;
    background: #f5f5f5;
}

.image-link-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-link-card.large:hover .image-link-top img {
    transform: scale(1.05);
}

.image-link-bottom {
    display: block;
    padding: 16px;
    background: white;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease;
    /* 🔥 border-top 제거: 이미지와 텍스트 사이 흰 공백 제거 */
}

.image-link-bottom:hover {
    background: #fafafa;
}

/* 썸네일 이미지 버튼 스타일 */
.image-link-thumbnail {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    text-decoration: none;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.image-link-thumbnail:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.thumbnail-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.image-link-thumbnail span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }

    .tab-content {
        padding: 15px;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

#croppie-container {
    width: 100%;
    min-height: auto; /* 400px → auto: 280×280 크기에 맞춤 */
    background: #fafafa;
    border-radius: 8px;
    padding: 20px;
    /* overflow: hidden 제거 - 슬라이더 보이게 */
}

/* 🔥 Croppie 기본 스타일 오버라이드 */
.croppie-container {
    width: 100%;
    height: auto !important;
}

.croppie-container .cr-boundary {
    background: #fafafa;
    margin: 0 auto;
}

.croppie-container .cr-slider-wrap {
    margin: 20px auto;  /* 원래대로 복구 */
    width: 85%;
    text-align: center;
}

.croppie-container .cr-slider {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.croppie-container .cr-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.croppie-container .cr-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* 크롭 컨트롤 버튼 */
.crop-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.crop-control-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.crop-control-btn:hover {
    background: var(--secondary-color);
    border-color: var(--primary-color);
}

.crop-control-btn:active {
    transform: scale(0.95);
}

.crop-control-btn i {
    width: 20px;
    height: 20px;
    color: var(--text-color);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .crop-modal-container {
        max-width: 100%;
    }

    .crop-modal-body {
        min-height: 300px;
    }

    #croppie-container {
        min-height: 280px;
    }
}

@media (max-width: 480px) {
    .crop-modal-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .crop-modal-body {
        padding: 16px;
        min-height: calc(100vh - 160px);
    }

    #croppie-container {
        min-height: 250px;
    }

    .croppie-container .cr-slider-wrap {
        width: 90%;
    }
}

/* ============================================================
   4. PROFILE SETTINGS - EXTRACTED
   ============================================================
   ✅ Moved to: 4-features-profile-settings.css (453 lines)
   */

/* ============================================================
   5. PREVIEW SYSTEM
   ============================================================ */

/* ──────────────────────────────────────
   5.1 Background Image Mode
   ────────────────────────────────────── */

/* 🔥 배경 이미지 (컨테이너 전체를 꽉 채움) */
.profile-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* 전체 높이 */
    object-fit: cover;
    z-index: 0;
}

/* 🔥 그라데이션 오버레이 (사용자 배경색 + 투명도) */
.preview-header.background-mode::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    /* CSS 변수 사용 (JavaScript에서 동적 설정) */
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--preview-bg-color, #ffffff) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* 🔥 background 모드일 때 preview-header 설정 */
.preview-header.background-mode {
    position: relative;
    min-height: 400px; /* 충분한 높이 확보 (더 크게) */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* 컨텐츠를 하단에 배치 */
    padding: 0 20px 30px 20px; /* 좌우 여백 유지, 상단 0 */
    margin: -20px -20px 0 -20px !important; /* 부모의 padding + 상단 margin 완전 제거 */
}

/* 🔥 background 모드일 때 원형 프로필 완전 제거 (공간 없앰) */
.preview-header.background-mode .preview-profile {
    display: none; /* 완전 제거 */
}

/* 🔥 v3.7: 이름과 소개글 섹션 (배경 모드용) */
.preview-text-section {
    text-align: center;
    padding: 0 20px 20px 20px; /* 상단 패딩 0 */
    margin-top: 0;
    display: none; /* 기본 숨김 */
}

/* 🔥 배경 모드일 때만 preview-text-section 표시 */
.preview-container.background-mode .preview-text-section,
.bio-container.background-mode .preview-text-section {
    display: block;
}

/* 🔥 썸네일 모드: 헤더 내부 텍스트 표시 */
.preview-name-inside,
.preview-bio-inside {
    display: block; /* 기본 표시 */
}

/* 🔥 배경 모드: 헤더 내부 텍스트 숨기고, 외부 텍스트 표시 */
.preview-container.background-mode .preview-name-inside,
.preview-container.background-mode .preview-bio-inside,
.bio-container.background-mode .preview-name-inside,
.bio-container.background-mode .preview-bio-inside {
    display: none;
}

/* 🔥 모바일 프리뷰: background 모드 margin 조정 */
#mobile-preview .preview-header.background-mode {
    margin: -40px -32px 0 -32px !important; /* bio-container의 padding (40px 32px) 상쇄 */
}

/* 🔥 모바일 프리뷰: 바이오 컨테이너 스타일 */
#mobile-preview .bio-container {
    border-radius: 30px; /* 🔥 통일된 radius (40px → 30px) */
    max-width: 384px; /* 480px의 80% (20% 감소) */
    overflow: hidden; /* 배경 이미지가 둥근 모서리 밖으로 안 나가게 */
}

/* ──────────────────────────────────────
   5.2 PRO Badge Toggle
   ────────────────────────────────────── */

/* PRO 사용자일 때 모든 PRO 배지, 유료/무료 표시 숨김 */
body.user-is-pro .pro-badge,
body.user-is-pro .pro-badge-large,
body.user-is-pro .style-desc,
body.user-is-pro .upload-hint {
    display: none !important;
}

/* PRO 사용자일 때 "반갑습니다 PRO" 텍스트도 "반갑습니다"만 표시 */
body.user-is-pro .font-preview .pro-badge {
    display: none !important;
}

/* PRO 사용자일 때 "Small (무료)" → "Small"로 표시 */
body.user-is-pro .size-preview {
    font-weight: 500;
}
/* ──────────────────────────────────────
   5.3 Profile Style Toggle Switch
   ────────────────────────────────────── */

/* 토글 섹션 레이블 */
.toggle-section-label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--color-text-primary);
}

/* 🔥 v3.7: 토글 스위치 제거 - 라디오 버튼으로 대체됨 */

/* ──────────────────────────────────────
   5.4 YouTube Embed
   ────────────────────────────────────── */

/* YouTube URL 입력 그룹 */
.youtube-url-input {
    flex: 1;
}

/* 정보 가져오기 버튼 */
.btn-fetch-youtube {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-fetch-youtube:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-fetch-youtube:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-fetch-youtube:active:not(:disabled) {
    transform: translateY(0);
}

/* 로딩 상태 */
.btn-fetch-youtube.loading {
    background: var(--primary-hover);
    cursor: wait;
}

.btn-fetch-youtube.loading i {
    animation: spin 1s linear infinite;
}

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

/* YouTube 썸네일 미리보기 */
.youtube-thumbnail-preview {
    margin-top: 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.youtube-thumbnail-preview img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.youtube-info {
    padding: 12px;
    background: #f8f9fa;
}

.youtube-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.youtube-author {
    font-size: 12px;
    color: var(--light-text);
    margin: 0;
}

/* YouTube 임베드 프리뷰 (공개 페이지용) */
.youtube-embed-preview {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.youtube-embed-preview iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: none;
    display: block;
    border-radius: 12px;
}

/* ──────────────────────────────────────
   5.5 Mobile Preview (Littlelink Frame)
   ────────────────────────────────────── */

/* 1. 모바일 프레임 (검은 베젤, iPhone 12 Pro 비율) */
.mobile-frame {
    width: 390px;
    max-width: calc(100vw - 40px);  /* 양옆 20px 여백 */
    aspect-ratio: 390 / 844;        /* iPhone 12 Pro 비율 유지 */
    max-height: calc(100vh - 40px); /* 상하 20px 여백 */
    background: #1a1a1a;            /* 검은 베젤 */
    border-radius: 40px;            /* 둥근 모서리 */
    padding: 10px;                  /* 화면과 베젤 사이 간격 */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); /* 강한 그림자 */
    transition: all 0.3s ease;      /* 부드러운 전환 */
}

/* 2. 화면 영역 (실제 콘텐츠가 표시되는 viewport) */
.mobile-screen {
    width: 100%;
    height: 100%;
    position: relative;             /* 자식 요소 위치 기준 */
    overflow: hidden;               /* 넘치는 콘텐츠 숨김 */
    border-radius: 30px;            /* 내부 화면 모서리 */
    background: var(--color-bg-secondary); /* 기본 배경 (썸네일 모드) */
}

/* 3. 페이지 배경 레이어 (고정, z-index: 0) */
.page-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;                     /* 가장 뒤 */
    pointer-events: none;           /* 클릭 이벤트 무시 */
    display: none;                  /* 기본 숨김 (JavaScript로 활성화) */
}

/* 페이지 배경 필터: 어둡게 */
.page-background[data-filter="dark"] {
    filter: brightness(0.7);
}

/* 🔥 v2.1: 페이지 배경 필터: 흐림 */
.page-background[data-filter="blur"] {
    filter: blur(10px);
}

/* 🔥 v2.1: 페이지 배경 활성화 시 콘텐츠 배경 투명 처리 */
/* ⚠️ 배경 이미지를 그대로 보여주기 위해 투명하게 설정 */
.mobile-screen:has(#page-background[style*="display: block"]) .bio-container {
    background: transparent !important;  /* 완전 투명 */
}

/* 🔥 v2.1: :has() 미지원 브라우저 대비 (Fallback) */
.mobile-screen.has-page-background .bio-container {
    background: transparent !important;
}

/* 4. 스크롤 가능한 콘텐츠 영역 (z-index: 1) */
.preview-scrollable {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;                   /* 🔥 전체 높이 사용 (푸터 공간 제거) */
    overflow-y: auto;               /* 세로 스크롤만 허용 */
    overflow-x: hidden;
    z-index: 1;                     /* 배경 위 */

    /* 스크롤바 숨김 (크로스 브라우저) */
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge */
}

.preview-scrollable::-webkit-scrollbar {
    display: none;                  /* Chrome/Safari/Opera */
}

/* 5. Bio Container 스타일 조정 */
.preview-scrollable .bio-container {
    background: transparent;        /* 배경 투명 (페이지 배경 보이게) */
    padding: 40px 20px 100px 20px;  /* 🔥 하단 100px: 버튼 공간 확보 */
    min-height: 100%;               /* 전체 높이 채우기 */
    box-shadow: none;               /* 그림자 제거 */
}

/* 6. 하단 고정 영역 (푸터 배경 제거, 공간만 유지) */
.preview-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;                   /* 🔥 고정 높이 제거 */
    padding: 20px;                  /* 🔥 패딩으로 여백 제어 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;        /* 🔥 배경 제거 */
    z-index: 1001;                  /* 최상단 */
}

/* 7. 닫기 버튼 (독립 레이어) */
.preview-footer .close-preview-btn {
    width: auto;                    /* 🔥 자동 너비 */
    min-width: 100px;               /* 🔥 최소 너비 */
    padding: 0 24px;                /* 🔥 좌우 패딩 */
    height: 44px;                   /* 🔥 50px → 44px */
    background: #1a1a1a;            /* Claude 블랙 */
    color: #FFFFFF;
    border: none;
    border-radius: 22px;            /* 🔥 완전한 라운드 (height의 절반) */
    font-size: 14px;                /* 🔥 15px → 14px */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* 🔥 그림자 강화 (독립성 강조) */

    /* 🔥 드래그 방지 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.preview-footer .close-preview-btn:hover {
    background: #333333;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

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

/* ============================================================
   6. BROWSER COMPATIBILITY
   ============================================================ */

/* :has() 미지원 브라우저를 위한 클래스 기반 대체 */
.mobile-screen.has-active-background .bio-container {
    background: transparent !important;
}

/* 배경 모드일 때 페이지 배경 강제 숨김 */
.mobile-screen[data-profile-style="background"] .page-background {
    display: none !important;
}

/* aspect-ratio 미지원 브라우저 대비 (IE, 구형 Safari) */
@supports not (aspect-ratio: 390 / 844) {
    .mobile-frame {
        height: 844px;              /* 고정 높이로 폴백 */
    }
}

/* ============================================================
   EXTRACTED FROM INLINE STYLES
   ============================================================
   The following sections were originally inline <style> tags
   in dashboard.html and have been extracted to this file.
   ============================================================ */

/* ============================================================
   7. FONTS
   ============================================================ */
        @font-face {
            font-family: 'MaruBuri';
            src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-ExtraLight.woff2') format('woff2');
            font-weight: 200;
            font-style: normal;
            font-display: swap;
        }
        @font-face {
            font-family: 'MaruBuri';
            src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Regular.woff2') format('woff2');
            font-weight: 400;
            font-style: normal;
            font-display: swap;
        }
        @font-face {
            font-family: 'MaruBuri';
            src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Bold.woff2') format('woff2');
            font-weight: 700;
            font-style: normal;
            font-display: swap;
        }

/* ============================================================
   8. BACKGROUND UPLOAD UI
   ============================================================ */

        /* 페이지 배경 이미지 업로드 박스 */
        .page-bg-image-upload {
            display: flex;
            flex-direction: column;
            gap: 16px;
            padding: 16px;
            background: #f9fafb;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
        }

        .upload-preview-box {
            width: 112px;      /* 9:16 = 112:200 */
            height: 200px;
            border-radius: 8px;
            overflow: hidden;
            border: 2px solid #e5e7eb;
            background: white;
            margin: 0 auto;
        }

        .page-bg-preview-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .upload-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
        }

        .btn-upload,
        .btn-delete {
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
        }

        .btn-upload {
            background: var(--primary-color);
            color: white;
        }

        .btn-upload:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }

        .btn-delete {
            background: #ef4444;
            color: white;
        }

        .btn-delete:hover {
            background: #dc2626;
        }

        /* 🔥 가로 배치 컨테이너 */
        .page-bg-horizontal-layout {
            display: flex;
            gap: 20px;
            align-items: flex-start;
        }

        /* 이미지 업로드 영역 */
        .page-bg-horizontal-layout .page-bg-image-upload {
            flex-shrink: 0;
        }

        /* 필터 영역 */
        .page-bg-horizontal-layout .page-bg-filters {
            flex: 1;
            margin-top: 0;
        }

        /* 모바일: 가로 배치 유지 */
        @media (max-width: 600px) {
            .page-bg-horizontal-layout {
                gap: 16px;
            }
        }

        /* 3개 필터 선택 시스템 */
        .page-bg-filters {
            margin-top: 16px;
        }

        .filter-label {
            display: block;
            font-weight: 500;
            margin-bottom: 12px;
            color: #9ca3af;
        }

        .filter-options {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        @media (max-width: 600px) {
            .filter-options {
                gap: 8px;
            }
        }

        .filter-option {
            cursor: pointer;
        }

        .filter-option input[type="radio"] {
            position: absolute;
            opacity: 0;
        }

        .filter-preview-box {
            position: relative;
            width: 100%;
            height: 70px;
            border-radius: 8px;
            border: 2px solid #e5e7eb;
            overflow: hidden;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            /* 체크무늬 배경 */
            background-image: linear-gradient(45deg, #ddd 25%, transparent 25%),
                linear-gradient(-45deg, #ddd 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #ddd 75%),
                linear-gradient(-45deg, transparent 75%, #ddd 75%);
            background-size: 20px 20px;
            background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
        }

        .filter-preview-box span {
            position: relative;
            z-index: 2;
            font-size: 11px;
            font-weight: 600;
            color: #333;
            text-align: center;
            padding: 4px 8px;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 4px;
        }

        .filter-option input[type="radio"]:checked + .filter-preview-box {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(255, 46, 122, 0.2);
            transform: translateY(-2px);
        }

        .filter-option:hover .filter-preview-box {
            border-color: #999;
        }

        /* 필터 효과 (::before 오버레이) */
        .filter-none::before {
            content: none;
        }

        .filter-dark::before {
            content: '';
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1;
        }

        .filter-blur::before {
            content: '';
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            backdrop-filter: blur(10px);
            z-index: 1;
        }

        .sidebar-bottom {
            margin-top: auto;
            padding: 20px 0;
        }

        .account-btn {
            width: 100%;
            padding: 12px 16px;
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 8px;
            color: #495057;
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .account-btn:hover {
            background: #e9ecef;
            color: #343a40;
            transform: translateY(-1px);
        }

        .url-input:disabled {
            background-color: #f8f9fa !important;
            color: #6c757d !important;
            cursor: not-allowed;
            border-color: #dee2e6;
        }

        .plan-info {
            background: #f8f9fa;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 24px;
            border: 1px solid #e9ecef;
        }

        .plan-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            border-radius: 20px;
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 12px;
        }

        .plan-badge.free {
            background: #e7f3ff;
            color: #0066cc;
            border: 1px solid #b3d9ff;
        }

        .plan-badge.pro {
            background: #f0e6ff;
            color: #6b46c1;
            border: 1px solid #d1c7f0;
        }

        .upgrade-btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 12px 20px;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 14px;
        }

        .upgrade-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
        }

        .csv-download-btn {
            background: #28a745;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-left: auto;
        }

        .csv-download-btn:hover {
            background: #218838;
            transform: translateY(-1px);
        }

        .section-title {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .upgrade-features {
            margin: 20px 0;
        }

        .feature-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid #f1f3f4;
        }

        .feature-item:last-child {
            border-bottom: none;
        }

        .feature-icon {
            font-size: 20px;
            width: 24px;
            text-align: center;
        }

        .feature-text strong {
            display: block;
            font-weight: 600;
            margin-bottom: 4px;
        }

        .feature-text small {
            color: #6c757d;
            font-size: 13px;
        }

        .upgrade-price {
            text-align: center;
            margin: 24px 0;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 8px;
        }

        .upgrade-price .price {
            font-size: 28px;
            font-weight: 700;
            color: #2c3e50;
            display: block;
            margin-bottom: 8px;
        }

        .upgrade-price small {
            color: #e74c3c;
            font-weight: 600;
            background: #ffe6e6;
            padding: 4px 8px;
            border-radius: 12px;
        }

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

        .modal-btn-upgrade:hover {
            background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
        }

        /* 기존 스타일 유지하면서 추가 개선 */
        .url-status.info {
            background: #d1ecf1;
            color: #0c5460;
            border: 1px solid #bee5eb;
        }

        .url-status.info .btn {
            background: #17a2b8;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 4px;
            margin-top: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .url-status.info .btn:hover {
            background: #138496;
            transform: translateY(-1px);
        }

        /* 페이지 배경색 피커 */
        .page-bg-picker {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 10px;
            margin-bottom: 8px;
        }

        .bg-preset {
            position: relative;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .bg-preset .bg-preview {
            width: 100%;
            height: 50px;
            border-radius: 8px;
            border: 1px solid rgba(0, 0, 0, 0.15); /* 🔥 흰색/연한 색 테두리 보임 */
            transition: all 0.2s ease;
        }

        .bg-preset:hover .bg-preview {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .bg-preset.selected .bg-preview {
            border-color: #3b82f6;
            box-shadow: 0 0 0 1px #3b82f6;
        }

        /* 🔥 바이오 페이지 배경/텍스트 색상 픽커 강제 스타일 */
        #design-tab .color-picker {
            display: flex !important;
            gap: 10px !important;
            flex-wrap: wrap !important;
            margin-top: 8px !important;
        }

        #design-tab .color-option {
            width: 40px !important;
            height: 40px !important;
            border-radius: 50% !important;
            cursor: pointer !important;
            border: 3px solid white !important;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.2) !important;
            transition: transform 0.3s !important;
        }

        #design-tab .color-option:hover {
            transform: scale(1.1) !important;
        }

        #design-tab .color-option.selected {
            border-color: var(--primary-color) !important;
            box-shadow: 0 0 10px rgba(255, 46, 122, 0.5) !important;
        }


/* ============================================================
   9. LINKS MANAGEMENT
   ============================================================ */

        /* 링크 관리 헤더 (h2 + 특별 링크 버튼) */
        .links-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .links-header h2 {
            margin: 0;
        }

        .btn-special-link {
            background: linear-gradient(135deg, #6A9BCC 0%, #435c75 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s ease;
        }

        .btn-special-link:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(106, 155, 204, 0.4);
        }

        /* 빠른 링크 추가 폼 */
        .quick-link-form {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 12px;
            margin-bottom: 24px;
            border: 1px solid #e0e0e0;
        }

        .quick-link-form .form-group {
            margin-bottom: 16px;
        }

        .quick-link-form .form-group:last-of-type {
            margin-bottom: 16px;
        }

        .quick-link-form .btn-primary {
            width: 100%;
        }

        /* 특별 링크 모달 */
        .special-link-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

        .special-link-modal {
            background: white;
            border-radius: 16px;
            max-width: 600px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 24px;
            border-bottom: 1px solid #e0e0e0;
        }

        .modal-header h3 {
            margin: 0;
            font-size: 20px;
            font-weight: 700;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 28px;
            color: #999;
            cursor: pointer;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s;
        }

        .modal-close:hover {
            background: #f0f0f0;
            color: #333;
        }

        .modal-body {
            padding: 24px;
        }

        .link-type-options {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .link-type-option {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px;
            border: 2px solid #e0e0e0;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .link-type-option:hover {
            border-color: var(--primary-color);
            background: #fff5f8;
            transform: translateX(4px);
            box-shadow: 0 2px 8px rgba(255, 46, 122, 0.1);
        }

        .link-type-icon {
            font-size: 28px;
            flex-shrink: 0;
        }

        .link-type-content {
            flex: 1;
            min-width: 0;
        }

        .link-type-title {
            font-size: 16px;
            font-weight: 700;
            margin-bottom: 4px;
            color: #333;
        }

        .link-type-desc {
            font-size: 13px;
            color: #666;
            line-height: 1.4;
        }

        /* 모바일 반응형 */
        @media (max-width: 768px) {
            .link-add-buttons {
                flex-direction: column;
            }

            .special-link-modal {
                width: 95%;
                max-height: 90vh;
            }
        }

/* ============================================================
   0. RESPONSIVE BREAKPOINTS (NEW STRUCTURE)
   ============================================================

   전략: 2단계 시스템 (1200px 기준)
   - Linktree + 업계 표준 기반
   - max-width: 1300px 제한 고려
   - 1200px 이하는 3단 레이아웃이 너무 좁아짐 (사이드바 250 + 편집 + 프리뷰 375 = 여유 없음)

   브레이크포인트:
   - ~1199px: 모바일 + 태블릿 + 소형 데스크탑 (프리뷰 숨김, 버튼 사용)
   - 1200px~: 데스크탑 (듀얼뷰: 사이드바 + 편집 + 프리뷰)

   참고: 기존 미디어 쿼리는 하단에 유지 (Phase 3에서 제거 예정)
   ============================================================ */

/* 💻 데스크탑 (1200px~) - 듀얼뷰 (3단 레이아웃) */
@media (min-width: 1200px) {
    /* ===== Tier 1: 핵심 레이아웃 ===== */

    /* 사이드바: 고정 너비 */
    .sidebar {
        width: 250px;
        flex-shrink: 0;
    }

    /* 메인 콘텐츠: 유연한 너비 */
    .main-content {
        flex: 1;
        min-width: 0; /* flexbox overflow 방지 */
    }

    /* 프리뷰: 표시 (375px 고정) */
    .preview-wrapper {
        display: block;
        width: 375px;
        flex-shrink: 0;
    }

    /* PC 프리뷰 화면: 표시 */
    .pc-screen {
        display: block;
    }

    /* 🔥 Option B: 모바일 프리뷰 버튼/오버레이 숨김 (active 상태여도) */
    .mobile-preview-btn,
    .mobile-preview-btn.hidden,
    .mobile-preview-overlay,
    .mobile-preview-overlay.active {
        display: none;  /* PC에서는 항상 숨김 (!important 불필요) */
    }

    /* 모바일 프레임: 숨김 */
    .mobile-frame {
        display: none;
    }
}

/* 📱 모바일 + 태블릿 + 소형 데스크탑 (~1199px) - 단일뷰 */
@media (max-width: 1199px) {
    /* ===== Tier 1: 핵심 레이아웃 ===== */

    /* 프리뷰: 숨김 (버튼으로 팝업 형태) */
    .preview-wrapper {
        display: none;
    }

    /* PC 프리뷰 화면: 숨김 */
    .pc-screen {
        display: none;
    }

    /* 모바일 프리뷰 버튼: 표시 */
    .mobile-preview-btn {
        display: flex;  /* 🔥 flex로 변경 (아이콘 정렬) */
    }

    /* 메인 콘텐츠: 중앙 정렬 */
    .main-content {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
    }
}

/* 📱 모바일 전용 (~768px) */
@media (max-width: 768px) {
    /* ===== Tier 2: 모바일 레이아웃 ===== */

    /* 컨테이너: 세로 스택 */
    .container {
        flex-direction: column;
    }

    /* 사이드바: 가로 메뉴바로 전환 */
    .sidebar {
        width: 100%;
        padding: 5px 8px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        overflow-x: auto;
        white-space: nowrap;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid var(--border-color);
    }

    /* 로고: 숨김 */
    .logo,
    .logo-subtitle {
        display: none;
    }

    /* 메뉴 아이템: 세로 정렬 */
    .menu-item {
        flex: 1;
        flex-shrink: 0;
        padding: 8px 6px;
        margin: 0 2px;
        border-radius: 12px;
        white-space: nowrap;
        font-size: 11px;
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .menu-item i {
        width: 20px;
        height: 20px;
    }

    .menu-item strong {
        font-weight: 500;
    }

    .menu-item:first-child {
        margin-left: 0;
    }

    .menu-item:last-child {
        margin-right: 0;
    }

    /* 사이드바 하단 */
    .sidebar-bottom {
        padding: 0;
        margin: 0 2px;
        flex: 1;
    }

    /* 계정 버튼 */
    .account-btn {
        padding: 8px 6px;
        font-size: 11px;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }

    .account-btn i {
        width: 20px;
        height: 20px;
    }

    /* 메인 콘텐츠: 작은 패딩 */
    .main-content {
        padding: 15px;
    }

    /* URL 디스플레이 */
    .url-display {
        padding: 24px 20px;
    }

    .url-link {
        white-space: nowrap;
        overflow: hidden;
        gap: 2px;
    }

    .url-icon {
        width: 30px;
        height: 30px;
    }

    .url-prefix,
    .url-slug {
        font-size: 24px;
        font-weight: 700;
    }

    .url-status {
        font-size: 14px;
        font-weight: 700;
        padding: 16px 20px;
    }

    /* 통계 그리드: 2열 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 24px;
    }

    /* 이미지 크롭 모달 */
    .crop-modal-container {
        max-width: 100%;
    }

    .crop-modal-body {
        min-height: 300px;
    }

    #croppie-container {
        min-height: 280px;
    }
}

/* 🔧 초소형 모바일 (~480px) */
@media (max-width: 480px) {
    /* ===== Tier 3: 세부 조정 ===== */

    /* 메인 콘텐츠: 더 작은 패딩 */
    .main-content {
        padding: 10px;
    }

    /* 탭 콘텐츠 */
    .tab-content {
        padding: 15px;
    }

    /* 폼: 16px 폰트 (iOS 줌 방지) */
    .form-group input,
    .form-group textarea {
        font-size: 16px;
    }

    /* 통계 그리드: 1열 */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* 이미지 크롭 모달: 전체 화면 */
    .crop-modal-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .crop-modal-body {
        padding: 16px;
        min-height: calc(100vh - 160px);
    }

    #croppie-container {
        min-height: 250px;
    }

    .croppie-container .cr-slider-wrap {
        width: 90%;
    }
}

/* ⚙️ 세부 조정: 프로필 이미지 업로드 (~600px) */
@media (max-width: 600px) {
    .profile-image-uploads {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .profile-style-picker {
        grid-template-columns: 1fr;
    }

    .title-size-picker {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .size-option {
        padding: 16px 12px;
        min-height: 70px;
    }

    .upload-preview {
        width: 100px;
        height: 100px;
    }

    .style-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}