/**
 * layout.css - 앱 컨테이너 / 상단 탭바 / 채팅 레이아웃 / 반응형
 * 사이드바+햄버거 구조를 상단 탭바로 대체한 새 구조 기준.
 */

.app-container {
    width: 95%;
    max-width: 900px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--bg); /* 콘텐츠 영역 기본 배경은 회색(--bg); 상단탭바/입력창/시트만 흰색(--surface) */
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    position: relative; /* 바텀시트(.sheet)/토스트(#toast-container)가 카드 안에서만 움직이도록 기준점 제공 */
}

/* 상단 탭바 (사이드바 대체) */
.topbar {
    display: flex;
    align-items: center;
    padding: 0 0.9rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.tab-btn {
    padding: 0.9rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn:hover {
    color: var(--text-primary);
}
.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 700;
    background: transparent;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 방 비우기 아이콘: 상단 탭바 오른쪽 그룹(새로고침/아바타)과 함께 묶이도록 여기서 먼저 밀어냄 */
#clear-room-2-btn {
    margin-left: auto;
}

.chat-history {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* ---------------- 반응형 모바일 ---------------- */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    .app-container {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        border: none;
    }
    .topbar {
        padding: 0 0.5rem;
    }
}
