/**
 * 픽콘 공통 CSS
 * 
 * 전역 스타일, 리셋, 공통 컴포넌트
 */

/* =====================================================
   1. 리셋 & 기본 설정
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #f5f5f5;
    -webkit-tap-highlight-color: transparent;
}

body.modal-open {
    overflow: hidden;
}

body.drawer-open {
    overflow: hidden;
    touch-action: none;
}

/* =====================================================
   2. 공통 헤더
   ===================================================== */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}

.top-header header {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 6px 0 12px;
    background-color: #5a86ff;
}

.back-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.header-spacer {
    flex: 1;
}

.header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
}

.header-logo img {
    height: 17px;
    vertical-align: middle;
}

.free-prints {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 5px;
    border-radius: 12px;
    color: white;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.free-prints svg {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    fill: white;
}

.header-howto-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    padding: 4px 4px;
    margin-left: 4px;
    -webkit-tap-highlight-color: transparent;
}

.header-howto-btn svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.header-shadow {
    height: 4px;
    background: linear-gradient(180deg, rgba(0,0,0,0.1), transparent);
}

/* =====================================================
   3. 드로어 메뉴 (공통)
   ===================================================== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 600;
    display: none;
}

.drawer-overlay.active {
    display: block;
}

.drawer {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background: white;
    z-index: 601;
    transition: left 0.3s ease;
    overflow: hidden;
    font-family: 'Noto Sans KR', sans-serif;
}

.drawer.active {
    left: 0;
}

.drawer-content-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.token-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 25px 20px;
    background-color: #f0f2f5;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.token-header > svg {
    width: 32px;
    height: 32px;
    fill: #5a86ff;
    margin-right: 15px;
}

.token-text-group {
    display: flex;
    flex-direction: column;
}

.token-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.token-value {
    font-size: 14px;
    color: #555;
    word-break: break-all;
    margin-top: 5px;
}

/* 카카오 로그인 - 로그인 전 */
.kakao-login-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.kakao-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    background-color: #FEE500;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #191919;
}

.kakao-login-btn .kakao-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 50%;
}

.kakao-login-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

/* 친구초대 프로모션 카드 */
.invite-promo {
    margin-top: 14px;
    padding: 14px;
    background: #F5F7FF;
    border: 1px solid #E3E8F8;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
}

.invite-promo svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* 칩(Chip) 공통 */
.invite-promo .chip {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: baseline;
    white-space: nowrap;
}

.invite-promo .chip-blue {
    background: #E8EEFF;
    border: 1px solid #C5D3F6;
    color: #3B6AE8;
}

.invite-promo .chip-accent {
    background: #FFF3E0;
    border: 1px solid #FFD9A8;
    color: #E67E22;
}

/* 첫 로그인 줄 */
.invite-promo-first {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    padding-bottom: 9px;
    border-bottom: 1px dashed #D5DBF0;
}

/* 본문 영역 */
.invite-promo-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 8px;
}

.invite-promo-line {
    font-size: 11px;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

/* 보조 안내 */
.invite-promo-sub {
    font-size: 10px;
    color: #aaa;
    margin: 0;
    padding-top: 7px;
    border-top: 1px dashed #D5DBF0;
}

/* 복사 버튼 */
.invite-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    height: 34px;
    margin-top: 12px;
    background: #5a86ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.invite-copy-btn:active {
    background: #4872e0;
}

/* 카카오 로그인 - 로그인 후 */
.kakao-user-info {
    display: flex;
    align-items: center;
    width: 100%;
}

.kakao-user-info .kakao-icon {
    width: 36px;
    height: 36px;
    margin-right: 12px;
    flex-shrink: 0;
    border-radius: 50%;
}

.kakao-user-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.kakao-nickname {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.kakao-email {
    font-size: 12px;
    color: #777;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kakao-logout-btn {
    flex-shrink: 0;
    font-size: 12px;
    color: #999;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 8px;
}

/* 드로어 바로가기 (이용내역 / 무료 CoN) */
.drawer-quick-links {
    display: flex;
    align-items: stretch;
    margin-top: 14px;
    background: #fff;
    border: 1px solid #E3E8F8;
    border-radius: 10px;
    overflow: hidden;
}

.drawer-quick-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.drawer-quick-link:active {
    background: #F0F3FA;
}

.drawer-quick-link svg {
    width: 20px;
    height: 20px;
    color: #5a86ff;
    margin-bottom: 5px;
    flex-shrink: 0;
}

.drawer-quick-link-main {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.drawer-quick-link-sub {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
    line-height: 1.2;
}

.drawer-quick-link-divider {
    width: 1px;
    background: #E3E8F8;
    flex-shrink: 0;
}

/* CoN 단위 색상 (히스토리와 동일) */
.drawer-quick-links .con-unit {
    font-weight: 700;
    letter-spacing: -0.06em;
    display: inline-block;
}
.drawer-quick-links .con-c {
    color: inherit;
}
.drawer-quick-links .con-o {
    color: #4ade80;
}
.drawer-quick-links .con-n {
    color: #facc15;
}

.drawer-main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(to bottom, #d4e3f4, #f8f8f8);
}

.drawer-notification {
    width: 100%;
    max-width: 350px;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 40px 20px;
    position: relative;
}

.drawer-notification .bell-icon {
    width: 80px;
    height: 80px;
    background-color: #e6f0fa;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.drawer-notification .bell-icon img {
    width: 45px;
    height: 45px;
}

.drawer-notification .title {
    font-size: 22px;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1.3;
    margin-bottom: 10px;
}

.drawer-notification .pickcon-blue {
    color: #5aa9f1;
    font-weight: 700;
}

.drawer-notification .description {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 30px;
}

.phone-button {
    background-color: #5aa9f1;
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    padding: 15px 24px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.phone-button .phone-icon {
    display: flex;
    align-items: center;
}

.phone-button .phone-icon img {
    height: 24px;
    width: auto;
    display: block;
}

.phone-button .phone-label {
    display: inline-block;
}

.company-info-button {
    color: #7a8ba8;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid #d0d8e4;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    letter-spacing: 0.3px;
}

.company-info-button svg {
    flex-shrink: 0;
    opacity: 0.6;
}

/* =====================================================
   3-1. 사업자 정보 바텀시트
   ===================================================== */
.company-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 5000;
    display: none;
}

.company-sheet-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.company-sheet {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* → common.css 공통 헤더(.top-header) 사용 */

.company-sheet-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 60px 24px 24px;
    background: #f5f7fa;
    gap: 0;
    overflow-y: auto;
}

.company-info-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    padding: 14px 20px;
    background: #fff;
    border-bottom: 1px solid #f0f1f4;
}

.company-info-row:first-child {
    border-radius: 12px 12px 0 0;
}

.company-info-row:last-child {
    border-radius: 0 0 12px 12px;
    border-bottom: none;
}

.company-info-row span {
    display: block;
}

.company-info-title {
    color: #5a86ff;
    font-weight: 600;
    font-size: 13px;
    min-width: 100px;
    flex-shrink: 0;
}

.company-info-row > span:last-child {
    color: #3a3f4a;
    font-size: 13px;
    line-height: 1.5;
}

.company-sheet-footer {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 20px 24px 32px;
    background: #f5f7fa;
    text-align: center;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.terms-btn {
    display: block;
    background: #fff;
    padding: 12px;
    border-radius: 10px;
    width: 100%;
    border: 1px solid #dde1e8;
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 500;
    transition: background 0.15s;
}

.terms-btn:active {
    background: #edf0f5;
}

.copyright {
    display: block;
    font-size: 11px;
    color: #b0b5c0;
    margin-top: 8px;
    letter-spacing: 0.2px;
}

/* =====================================================
   3-2. 약관 바텀시트
   ===================================================== */
.terms-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 510;
    display: none;
}

.terms-sheet-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.terms-sheet {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* → common.css 공통 헤더(.top-header) 사용 */

.terms-sheet-body {
    flex: 1;
    display: flex;
    background: #fff;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 5%;
    padding-top: calc(48px + 5%);
}

.terms-sheet-body h3,
.terms-sheet-body h4 {
    padding: 5px 0;
}

.terms-sheet-body span {
    display: block;
}

/* =====================================================
   4. 바텀시트 (공통)
   ===================================================== */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 400;
    display: none;
}

.bottom-sheet-overlay.active {
    display: block;
}

.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;
    background: white;
    border-radius: 16px 16px 0 0;
    z-index: 401;
    transition: bottom 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.bottom-sheet.active {
    bottom: 0;
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 12px auto;
}

.bottom-sheet-content {
    padding: 20px;
}

.bottom-sheet-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

/* =====================================================
   5. 파일 업로드 영역 (공통)
   ===================================================== */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.file-upload-area:hover {
    border-color: #5a86ff;
}

.file-upload-area svg {
    width: 48px;
    height: 48px;
    fill: #5a86ff;
    margin-bottom: 12px;
}

.file-upload-area p {
    color: #666;
    font-size: 14px;
}

.file-upload-area .hint {
    color: #999;
    font-size: 12px;
    margin-top: 8px;
}

#fileInput {
    display: none;
}

/* =====================================================
   6. YouTube 오버레이 (공통)
   ===================================================== */
.youtube-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.youtube-overlay.active {
    display: flex;
}

.youtube-container {
    position: relative;
    width: 90vw;
    max-width: 800px;
}

.youtube-close {
    position: absolute;
    top: -40px;
    right: 0;
    cursor: pointer;
}

.youtube-iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
}

/* =====================================================
   PC 레이아웃 — 가로 400px 고정 + 가운데 정렬
   ===================================================== */
@media (min-width: 450px) {
    html {
        background-color: #e8e8e8;
    }

    body {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
        position: relative;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
        min-height: 100vh;
        overflow-x: hidden;
    }

    .top-header {
        width: 400px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .bottom-sheet-overlay {
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
    }

    .bottom-sheet {
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
    }

    .bottom-sheet.active {
        bottom: 0;
    }

    .drawer-overlay {
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
    }

    .drawer {
        left: -300px;
        transition: left 0.3s ease;
    }

    .drawer.active {
        left: calc(50% - 200px);
    }

    .drawer-overlay.active {
        display: block;
    }

    .company-sheet-overlay,
    .terms-sheet-overlay {
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
    }

    .youtube-overlay {
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
    }
}
