:root {
    --bg-main: #131314;
    --bg-sidebar: #1e1f20;
    --bg-surface: #1e1f20;
    --bg-input: #1e1f20; 
    --text-main: #e3e3e3;
    --text-sub: #c4c7c5;
    --accent: #8ab4f8; /* 제미나이 다크모드용 연한 블루 */
    --hover-bg: #2d2f31;
    --border-color: #444746;
    --font-family: 'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-family); background-color: var(--bg-main); color: var(--text-main); height: 100vh; overflow: hidden; }

.app-container { display: flex; height: 100vh; width: 100vw; }

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-x: hidden; /* 축소 시 텍스트가 삐져나오거나 깨지는 현상 방지 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 사이드바 접힘 상태 (아이콘만 표시) */
.sidebar.collapsed {
    width: 72px;
    padding: 16px 8px;
}

/* 복잡한 애니메이션 대신 확실하게 숨김 처리 */
.sidebar.collapsed span, 
.sidebar.collapsed .section-title,
.sidebar.collapsed .new-chat-btn span {
    display: none;
}

.sidebar-header { margin-bottom: 30px; }
.menu-toggle { background: none; border: none; color: var(--text-main); font-size: 20px; cursor: pointer; padding: 18px; border-radius: 50%; }
.menu-toggle:hover { background-color: var(--hover-bg); }

.new-chat-btn {
    margin-top: 20px;
    background-color: #1a1b1c; 
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: 16px; /* Material 3 스타일 */
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    width: fit-content;
    font-weight: 500;
    transition: background 0.2s;
}

/* 버튼 내부 아이콘과 텍스트가 축소 시 겹치지 않도록 설정 */
.new-chat-btn i, 
.new-chat-btn span {
    flex-shrink: 0;
}

.sidebar.collapsed .new-chat-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    margin-left: 4px;
}

.new-chat-btn:hover { background-color: var(--hover-bg); }

.sidebar-content { flex: 1; overflow-y: auto; }
.section-title { font-size: 13px; font-weight: 600; margin: 24px 0 12px 12px; color: var(--text-main); }

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 24px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap; /* 텍스트 줄바꿈 방지 */
    overflow: hidden;
}

/* 아이콘이 축소 과정에서 작아지지 않도록 고정 */
.history-item i {
    flex-shrink: 0;
}

.sidebar .history-item {
	margin-left: 5px;
	margin-bottom: 5px;
}

.sidebar.collapsed .history-item {
    width: 40px;
    height: 40px;
	margin-left: 8px;
    padding: 0;
    justify-content: center;
}

.sidebar .history-item i {
    margin: 0;
    font-size: 18px;
}

.history-item:hover { background-color: var(--hover-bg); }
.history-item.active { background-color: #d3e3fd; color: #041e49; }

/* Sidebar Footer */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 10px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 24px;
    text-decoration: none;
    color: var(--text-main); /* 텍스트 색상 */
    white-space: nowrap; /* 텍스트 줄바꿈 방지 */
    overflow: hidden; /* 넘치는 텍스트 숨김 */
    font-size: 14px;
}

/* 푸터 아이콘 고정 */
.nav-item i {
    flex-shrink: 0;
}

.sidebar.collapsed .nav-item {
    width: 40px;
    height: 40px;
	margin-left: 8px;
    padding: 0;
    justify-content: center;
}

.nav-item:hover { background-color: var(--hover-bg); }
.nav-item i { width: 20px; text-align: center; font-size: 16px; }

/* Main Content */
.main-wrapper { flex: 1; display: flex; flex-direction: column; position: relative; }

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 24px;
}
.app-brand { font-size: 20px; font-weight: 500; cursor: pointer; }
.user-profile { width: 32px; height: 32px; background: #9b72cb; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; }

.chat-viewport { flex: 1; overflow-y: auto; padding: 20px 5%; display: flex; flex-direction: column; align-items: center; }

/* Input Area */
.input-area { padding-bottom: 24px; }
.input-container { max-width: 820px; margin: 0 auto; width: 90%; }

.input-wrapper {
    background-color: var(--bg-input);
    border-radius: 28px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.input-wrapper textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 16px;
    padding: 12px 0;
    outline: none;
    resize: none;
    max-height: 200px;
}

.input-actions { display: flex; gap: 4px; }
.action-btn { background: none; border: none; color: var(--text-main); font-size: 18px; padding: 10px; border-radius: 50%; cursor: pointer; }
.action-btn:hover { background-color: var(--hover-bg); }

.send-btn { background: none; border: none; color: var(--accent); font-size: 18px; padding: 10px; cursor: pointer; }

.disclaimer { font-size: 12px; color: var(--text-sub); text-align: center; margin-top: 12px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -280px; z-index: 1000; height: 100%; }
    .sidebar.open { left: 0; }
    .input-container { width: 95%; }
}
