/*
* [모듈명]: 새글 작성 모달 스타일
* [파일명]: sandbox_create_post.css
* [역할]: Threads 스타일의 새글 작성 오버레이 모달 디자인을 담당합니다.
* [주요 기능]:
* 1. 오버레이 배경 (블러 + 어두운 딤)
* 2. 모달 컨테이너 (하단 시트 슬라이드)
* 3. 스레드 라인 (아바타 아래 수직선)
* 4. textarea 자동 높이 조절 영역
*/

/* ── 오버레이 배경 ── */
.create-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* 상단 배치 */
    padding-top: max(50px, env(safe-area-inset-top));
    /* 노치/상단바 여백 확보 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.create-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ── 모달 컨테이너 ── */
.create-modal {
    width: 96%;
    /* 모바일 좌우 여백 */
    max-width: 600px;
    max-height: 80dvh;
    background: #101010;
    border-radius: 20px;
    /* 전체 둥글게 */
    display: flex;
    flex-direction: column;
    transform: translateY(-30px);
    /* 위에서 아래로 */
    opacity: 0;
    /* 떨어지는 효과 극대화 */
    transition: all 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
    -webkit-transform: translateZ(0);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.create-overlay.open .create-modal {
    transform: translateY(0);
    opacity: 1;
}

/* ── 헤더 ── */
.create-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #2f3336;
    flex-shrink: 0;
}

/* [v15.7] 게시글 내 태그 스타일 */
.thread-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.thread-tag {
    font-size: 13px;
    font-weight: 600;
    color: var(--point-color);
    cursor: pointer;
}

.thread-tag:hover {
    text-decoration: underline;
}

.create-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #eff3f4;
    letter-spacing: -0.2px;
}

.create-btn-cancel {
    font-size: 14px;
    font-weight: 500;
    color: #eff3f4;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    -webkit-tap-highlight-color: transparent;
}

.create-btn-post {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: #1d9bf0;
    border: none;
    border-radius: 9999px;
    padding: 7px 18px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.create-btn-post:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.create-btn-post:not(:disabled):active {
    opacity: 0.8;
}

/* ── 카테고리 알약 칩 바 ── */
.create-category-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px 4px;
    background: #101010;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-bottom: 1px solid #2f3336;
    flex-shrink: 0;
}

.create-category-bar::-webkit-scrollbar {
    display: none;
}

.create-category-chip {
    flex-shrink: 0;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    color: #9BA3A0;
    background: #181818;
    border: 1px solid #2A2A2A;
    cursor: pointer;
    transition: all 0.2s ease;
}

.create-category-chip.active {
    background: #1D9BF0;
    color: #FFFFFF;
    border-color: #1D9BF0;
}

/* ── 본문 작성 영역 ── */
.create-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    overscroll-behavior: contain;
}

.create-thread-row {
    display: flex;
    gap: 12px;
    position: relative;
}

/* 아바타 영역 */
.create-avatar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

.create-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2f3336;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.create-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.create-avatar-placeholder {
    font-size: 18px;
    color: #9BA3A0;
}

/* 스레드 연결선 (사파리 끊김 방지: absolute 배치) */
.create-thread-line {
    position: absolute;
    top: 48px;
    left: 19px;
    bottom: 0;
    width: 2px;
    background: #2f3336;
    border-radius: 1px;
}

/* 텍스트 입력 영역 */
.create-content-col {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.create-nickname {
    font-size: 14px;
    font-weight: 700;
    color: #eff3f4;
    margin-bottom: 4px;
    line-height: 1.3;
}

.create-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 50dvh;
    background: transparent;
    border: none;
    outline: none;
    color: #eff3f4;
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.create-textarea::placeholder {
    color: #536471;
}

/* ── 하단 글자 수 영역 ── */
.create-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid #2f3336;
    flex-shrink: 0;
}

.create-char-info {
    font-size: 12px;
    color: #536471;
    transition: color 0.2s ease;
}

.create-char-info.warning {
    color: #f4212e;
}

/* 프로그레스 링 */
.create-progress-ring {
    width: 20px;
    height: 20px;
}

.create-progress-ring circle {
    fill: none;
    stroke-width: 2;
}

.create-progress-bg {
    stroke: #2f3336;
}

.create-progress-fill {
    stroke: #1d9bf0;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.15s ease, stroke 0.2s ease;
    transform: rotate(-90deg);
    transform-origin: center;
}

.create-progress-fill.warning {
    stroke: #ffd400;
}

.create-progress-fill.danger {
    stroke: #f4212e;
}

/* ── 반응형 (데스크톱) ── */
@media (min-width: 600px) {
    .create-overlay {
        align-items: center;
    }

    .create-modal {
        border-radius: 20px;
        max-height: 80dvh;
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    }

    .create-overlay.open .create-modal {
        transform: translateY(0);
    }
}

/* [v15.7] 새글 작성 모달 태그 바 */
.create-tag-bar {
    display: flex;
    overflow-x: auto;
    padding: 10px 16px;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.create-tag-bar.hidden {
    display: none;
}

.create-tag-bar::-webkit-scrollbar {
    display: none;
}

.create-tag-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    background: #151515;
    border: 1px solid #252525;
    transition: all 0.2s;
}

.create-tag-chip.active {
    color: #fff;
    background: #1d9bf0;
    border-color: #1d9bf0;
    box-shadow: 0 4px 12px rgba(29, 155, 240, 0.2);
}