/* static/css/style.css - エンプティステートデザイン追加版 */

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #fff; height: 100vh; display: flex; overflow: hidden; }

/* 1. 左サイドバー */
.left-sidebar { 
    width: 275px; 
    border-right: 1px solid #eff3f4; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    flex-shrink: 0; 
    padding: 0 10px; 
    height: 100%; 
}

.sidebar-header { padding: 15px 10px; font-size: 1.5em; font-weight: bold; color: #1d9bf0; flex-shrink: 0; }
.nav-menu { padding: 5px 0; flex-shrink: 0; }
.nav-item { padding: 12px 20px; font-size: 1.3em; cursor: pointer; border-radius: 30px; margin: 5px 0; transition: 0.2s; display: flex; gap: 15px; align-items: center; color: #0f1419; width: fit-content; }
.nav-item:hover { background: #e8f5fe; }
.nav-item.active { font-weight: bold; }
.nav-item i { width: 25px; text-align: center; }

/* トピック一覧エリア */
.sidebar-topic-area {
    margin-top: 20px; 
    padding-left: 20px; 
    flex: 1; 
    overflow-y: auto; 
    min-height: 0; 
    margin-bottom: 10px;
}

/* トピック作成ボタン */
.create-btn-sidebar { 
    background: #1d9bf0; 
    color: white; 
    font-weight: bold; 
    font-size: 1.1em; 
    padding: 15px 0; 
    border-radius: 30px; 
    text-align: center; 
    text-decoration: none; 
    margin-top: 10px; 
    margin-bottom: 20px; 
    width: 90%; 
    box-shadow: 0 4px 10px rgba(29, 155, 240, 0.3); 
    display: block; 
    border: none; 
    cursor: pointer; 
    font-family: inherit; 
    flex-shrink: 0; 
    align-self: center; 
}
.create-btn-sidebar:hover { background: #1a8cd8; }

.topic-item { padding: 10px 0; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: 0.2s; }
.topic-item:hover { background: #f7f9f9; }
.topic-item.active { border-right: 3px solid #1d9bf0; background: #f0f7ff; }

/* 2. 中央カラム */
.main-content { flex: 1; display: flex; flex-direction: column; position: relative; border-right: 1px solid #eff3f4; min-width: 0; }
#discussion-container { display: none; flex-direction: column !important; height: 100%; width: 100%; }
.topic-header { flex-shrink: 0; width: 100%; border-bottom: 1px solid #eff3f4; background: rgba(255,255,255,0.95); z-index: 10; backdrop-filter: blur(5px); }
#d-title { padding: 20px 16px; margin: 0; font-size: 1.8em; font-weight: 800; color: #0f1419; line-height: 1.3; }
#back-nav:hover { text-decoration: underline; }

/* 投票エリア */
.vote-graph-container { display: flex; width: 100%; padding: 10px 16px; gap: 10px; border-top: 1px solid #eff3f4; border-bottom: 1px solid #eff3f4; }
.vote-option-box { flex: 1; border: 2px solid transparent; border-radius: 12px; padding: 10px 15px; cursor: pointer; background: #f7f9f9; transition: all 0.2s ease; display: flex; flex-direction: column; justify-content: center; }
.vote-option-box:hover { background: #eff3f4; }
.vote-info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: bold; color: #536471; font-size: 1.1em; }
.vote-progress-bg { width: 100%; height: 12px; background: #e1e8ed; border-radius: 6px; overflow: hidden; }
.vote-progress-fill { height: 100%; width: 50%; border-radius: 6px; transition: width 0.5s ease; }
.fill-a { background: #f91880; }
.box-a.active-vote { background: #fff5f8; border-color: #f91880; }
.box-a.active-vote .vote-label-name, .box-a.active-vote .vote-percent { color: #f91880; }
.fill-b { background: #1d9bf0; }
.box-b.active-vote { background: #f0f7ff; border-color: #1d9bf0; }
.box-b.active-vote .vote-label-name, .box-b.active-vote .vote-percent { color: #1d9bf0; }
.vote-check { display: none; margin: 0 5px; }
.active-vote .vote-check { display: inline-block; }
.vote-option-box.inactive-vote { opacity: 0.5; }

/* タイムライン */
.split-view { flex: 1; display: flex; flex-direction: row; overflow: hidden; width: 100%; }
.split-column { flex: 1; display: flex; flex-direction: column; border-right: 1px solid #eff3f4; min-width: 0; position: relative; background: #fff; }
.split-column:last-child { border-right: none; }

/* 右サイドバー */
.right-sidebar { width: 350px; padding: 10px 20px; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; flex-shrink: 0; }
.search-box { background: #eff3f4; border-radius: 20px; padding: 10px 15px; display: flex; align-items: center; gap: 10px; color: #536471; }
.search-box input { border: none; background: transparent; outline: none; width: 100%; }

/* コメント */
.chat-scroll { flex: 1; overflow-y: auto; padding-bottom: 100px; padding: 0; }
:root { --line-pos: 35px; --line-color: #cfd9de; --focus-border: 2px; }
.comment-box { border-bottom: 1px solid #eff3f4; margin-bottom: 10px; }
.comment, .sub-comment { padding: 15px; display: flex; gap: 10px; position: relative; cursor: pointer; border-radius: 8px; }
.comment:hover, .sub-comment:hover { background: #f7f9f9; }
.comment img, .sub-comment img { position: relative; z-index: 2; background-color: #fff; box-shadow: 0 0 0 4px #fff; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot-a { background-color: #f91880; } .dot-b { background-color: #1d9bf0; }
.side-a-border { border-left: 3px solid #e74c3c; } .side-b-border { border-left: 3px solid #3498db; }
.ancestor-comment::before { content: ''; position: absolute; top: 0; bottom: 0; left: var(--line-pos); width: 2px; background-color: var(--line-color); z-index: 1; transform: translateX(-50%); }
#chat-list-thread > .ancestor-comment:first-child::before { top: 30px; }
.focused-comment { background-color: #fff !important; cursor: default !important; }
.focused-comment::before { content: ''; position: absolute; top: -2px; height: 100%; left: var(--line-pos); width: 2px; background-color: var(--line-color); z-index: 1; transform: translateX(-50%); }
.replies-container { margin-left: var(--line-pos); padding-left: 0; border-left: 2px solid var(--line-color); }
.sub-comment::before { content: ''; position: absolute; top: 25px; left: 0; width: 15px; height: 2px; background-color: var(--line-color); }

/* プロフィール */
.profile-header-area { border-bottom: 1px solid #eff3f4; }
.profile-cover { height: 150px; background-color: #cfd9de; background-size: cover; background-position: center; }
.profile-info { padding: 16px; position: relative; margin-top: -50px; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; border: 4px solid white; background: white; object-fit: cover; }
.edit-profile-btn { margin-top: 50px; background: white; border: 1px solid #cfd9de; font-weight: bold; border-radius: 20px; padding: 8px 16px; cursor: pointer; color: #0f1419; transition: 0.2s; }
.edit-profile-btn:hover { background: #eff3f4; }
.profile-name { font-size: 1.4em; font-weight: bold; margin-top: 5px; color: #0f1419; }
.profile-bio { margin: 10px 0; color: #536471; font-size: 0.95em; line-height: 1.4; white-space: pre-wrap; }
.profile-stats { display: flex; gap: 20px; font-size: 0.95em; color: #536471; margin-bottom: 5px; }
.profile-tabs { display: flex; margin-top: 10px; }
.p-tab { flex: 1; text-align: center; padding: 15px; font-weight: bold; color: #536471; cursor: pointer; transition: 0.2s; }
.p-tab:hover { background: #eff3f4; }
.p-tab.active { color: #0f1419; border-bottom: 4px solid #1d9bf0; }
#profile-back-btn:hover { background-color: rgba(0, 0, 0, 0.1); }

/* 投稿ボタン */
.fab-post-column { position: absolute; bottom: 20px; right: 20px; width: 55px; height: 55px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); cursor: pointer; border: none; z-index: 100; color: white; transition: transform 0.2s; }
.fab-post-column:hover { transform: scale(1.1); }
.fab-a { background: #f91880; } .fab-b { background: #1d9bf0; }

/* モーダル */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.modal-content { width: 600px; max-height: 90vh; background: white; border-radius: 16px; display: flex; flex-direction: column; margin: 0 auto; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.modal-header { padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: none; }
.close-btn { font-size: 1.5em; cursor: pointer; padding: 10px; }
.modal-body { flex: 1; padding: 0 20px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; }
.modal-body textarea { width: 100%; flex: 1; min-height: 150px; border: none; padding: 10px 0; font-family: sans-serif; font-size: 1.2em; resize: none; outline: none; }
.reply-preview-box { background: #fff; border-left: 3px solid #ccc; padding: 10px; margin-bottom: 15px; color: #666; font-size: 0.9em; }
.modal-input { width: 100%; padding: 12px; border: 1px solid #cfd9de; border-radius: 4px; font-size: 1em; outline: none; transition: 0.2s; font-family: inherit; }
.modal-input:focus { border-color: #1d9bf0; box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2); }

/* プロフィール編集モーダル用 */
.edit-cover-area { height: 150px; background: #cfd9de; position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.edit-cover-area:hover { opacity: 0.9; }
.edit-icon-area { width: 100px; height: 100px; border-radius: 50%; border: 4px solid white; position: absolute; top: -50px; left: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; background: white; }
.edit-icon-area:hover .camera-icon { opacity: 1; }
.camera-icon { position: absolute; color: white; background: rgba(0,0,0,0.3); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.2em; pointer-events: none; }
.input-label { font-size: 0.9em; color: #536471; font-weight: bold; margin-bottom: 5px; display: block; }
.edit-input { width: 100%; padding: 10px; border: 1px solid #cfd9de; border-radius: 4px; font-size: 1.1em; outline: none; font-family: inherit; }
.edit-input:focus { border-color: #1d9bf0; box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2); }

/* いいねボタン */
.liked { animation: pop 0.3s ease; }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.like-btn-area:hover { background-color: rgba(249, 24, 128, 0.1); border-radius: 50%; transition: 0.2s; }

/* ★追加: 未選択時のエンプティステート */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #536471;
    animation: fadeIn 0.5s ease;
}

.empty-icon {
    font-size: 5em;
    color: #e1e8ed;
    margin-bottom: 20px;
}

.empty-state-container h2 {
    font-size: 2em;
    margin: 0 0 10px 0;
    color: #0f1419;
    font-family: 'Arial', sans-serif;
}

.empty-state-container p {
    font-size: 1.1em;
    line-height: 1.6;
    color: #536471;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* レスポンシブ */
@media (max-width: 1200px) { .right-sidebar { display: none; } #global-search-view { right: 0; } }
@media (max-width: 1000px) { .left-sidebar { width: 80px; } .nav-item span, .sidebar-header, .create-btn-sidebar, .sidebar-topic-area { display: none; } .nav-item { justify-content: center; padding: 15px; } .nav-item i { font-size: 1.5em; width: auto; } #global-search-view { left: 80px; } }
@media (max-width: 768px) { .split-view { flex-direction: column; } .split-column { height: 50%; border-right: none; border-bottom: 1px solid #eee; } .left-sidebar { display: none; } #global-search-view { left: 0; } }