/* style.css (Twitter/X 完全再現版) */
:root {
    --color-primary: #1d9bf0; /* メインカラー(青) */
    --color-text-main: #0f1419;
    --color-text-gray: #536471;
    --color-border: #eff3f4;
    --color-bg-hover: rgba(15, 20, 25, 0.1);
    --color-like: #f91880;
    --color-repost: #00ba7c;
    --bg-card: #f7f9f9;
}
[data-theme="dark"] {
    --color-primary: #1d9bf0;
    --color-text-main: #e7e9ea;
    --color-text-gray: #71767b;
    --color-border: #2f3336;
    --color-bg-hover: rgba(231, 233, 234, 0.1);
    --bg-card: #16181c;
    background-color: #000000;
}

* { box-sizing: border-box; }
body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--color-text-main);
    overflow-y: scroll; /* 常にスクロールバーを表示してガタつき防止 */
}
a { text-decoration: none; color: inherit; }

/* --- レイアウト全体 --- */
.app-wrapper {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    max-width: 1300px;
    margin: 0 auto;
}

/* --- 左サイドバー (ナビゲーション) --- */
.left-sidebar {
    width: 88px; /* スマホ/タブレット用幅 */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0 10px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
@media (min-width: 1200px) {
    .left-sidebar { width: 275px; align-items: flex-start; }
}

.nav-logo {
    padding: 15px;
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    font-size: 28px; color: var(--color-primary);
}
.nav-logo:hover { background-color: var(--color-bg-hover); }

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 30px;
    transition: background-color 0.2s;
    margin-bottom: 4px;
    color: var(--color-text-main);
    font-size: 20px;
}
.nav-link:hover { background-color: var(--color-bg-hover); }
.nav-link i { width: 26px; text-align: center; margin-right: 0; }
.nav-link span { 
    display: none; 
    margin-left: 20px; 
    font-weight: normal; 
    font-size: 20px;
}
.nav-link.active { font-weight: bold; }
@media (min-width: 1200px) {
    .nav-link { padding: 12px 24px; }
    .nav-link i { margin-right: 0; }
    .nav-link span { display: inline; }
}

.nav-post-btn {
    margin-top: 20px;
    background-color: var(--color-primary);
    color: white;
    border-radius: 50%;
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background-color 0.2s;
    border: none; cursor: pointer;
}
.nav-post-btn span { display: none; }
.nav-post-btn:hover { background-color: #1a8cd8; }
@media (min-width: 1200px) {
    .nav-post-btn { width: 90%; height: 52px; border-radius: 30px; }
    .nav-post-btn i { display: none; }
    .nav-post-btn span { display: inline; font-weight: bold; font-size: 17px; }
}

/* --- 中央メインコンテンツ --- */
.main-content {
    width: 600px;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    flex-shrink: 0;
}

.main-header {
    position: sticky; top: 0; z-index: 10;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: 10px 16px;
    cursor: pointer;
}
[data-theme="dark"] .main-header { background-color: rgba(0, 0, 0, 0.85); }
.main-header h2 { margin: 0; font-size: 20px; font-weight: 700; }

/* 投稿フォーム */
.tweet-box {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    display: flex; gap: 12px;
}
.user-icon {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
    background-color: #ccc;
}
.tweet-area { flex: 1; }
.tweet-area textarea {
    width: 100%; border: none; outline: none;
    font-size: 20px; font-family: inherit; resize: none;
    background: transparent; color: var(--color-text-main);
    min-height: 50px; margin-top: 10px;
}
.tweet-actions {
    display: flex; justify-content: space-between; align-items: center; margin-top: 10px; border-top: 1px solid var(--color-border); padding-top: 10px;
}
.tweet-icons i {
    color: var(--color-primary); font-size: 18px; padding: 8px;
    border-radius: 50%; cursor: pointer; transition: 0.2s; margin-right: 5px;
}
.tweet-icons i:hover { background-color: var(--color-bg-hover); }
.tweet-btn {
    background-color: var(--color-primary); color: white;
    border: none; border-radius: 20px; padding: 8px 16px;
    font-weight: bold; font-size: 15px; cursor: pointer;
    opacity: 1; transition: 0.2s;
}
.tweet-btn:disabled { opacity: 0.5; cursor: default; }

/* タイムラインの投稿 */
.tweet {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    display: flex; gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.tweet:hover { background-color: rgba(0,0,0,0.03); }
[data-theme="dark"] .tweet:hover { background-color: rgba(255,255,255,0.03); }

.tweet-content { flex: 1; min-width: 0; }
.tweet-header { display: flex; align-items: baseline; margin-bottom: 2px; }
.tweet-name { font-weight: bold; color: var(--color-text-main); margin-right: 5px; }
.tweet-user, .tweet-time { color: var(--color-text-gray); font-size: 15px; }
.tweet-text { font-size: 15px; margin: 0 0 10px 0; word-wrap: break-word; line-height: 1.5; }
.tweet-img { width: 100%; border-radius: 16px; border: 1px solid var(--color-border); margin-top: 10px; }

/* アクションボタン */
.tweet-footer {
    display: flex; justify-content: space-between; max-width: 425px; margin-top: 5px;
}
.t-btn {
    display: flex; align-items: center; gap: 5px;
    background: none; border: none; cursor: pointer;
    color: var(--color-text-gray); font-size: 13px;
    padding: 0; group;
}
.t-icon {
    padding: 8px; border-radius: 50%; transition: 0.2s; display: flex; align-items: center; justify-content: center;
}
.t-btn:hover .t-icon.reply { background-color: rgba(29, 155, 240, 0.1); color: var(--color-primary); }
.t-btn:hover .t-icon.repost { background-color: rgba(0, 186, 124, 0.1); color: var(--color-repost); }
.t-btn:hover .t-icon.like { background-color: rgba(249, 24, 128, 0.1); color: var(--color-like); }
.t-btn span { transition: 0.2s; }
.t-btn:hover span { color: inherit; }

.reposted { color: var(--color-repost); }
.liked { color: var(--color-like); }

/* --- 右サイドバー --- */
.right-sidebar {
    width: 350px;
    padding: 12px 0 0 30px;
    display: none;
}
@media (min-width: 1000px) { .right-sidebar { display: block; } }

/* 検索バー */
.search-box {
    position: sticky; top: 5px; z-index: 5;
    background-color: var(--bg-card);
    border-radius: 9999px;
    padding: 10px 20px;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px;
}
[data-theme="dark"] .search-box { border: 1px solid var(--color-border); }
.search-box i { color: var(--color-text-gray); }
.search-box input {
    border: none; background: transparent; outline: none;
    font-size: 15px; color: var(--color-text-main); width: 100%; margin: 0; padding: 0;
}

/* トレンドカード */
.sidebar-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid transparent;
}
[data-theme="dark"] .sidebar-card { border: 1px solid var(--color-border); }

.card-header {
    padding: 12px 16px;
    font-size: 20px; font-weight: 800;
}
.trend-item {
    padding: 12px 16px;
    display: block;
    transition: 0.2s;
    cursor: pointer;
}
.trend-item:hover { background-color: rgba(0,0,0,0.03); }
[data-theme="dark"] .trend-item:hover { background-color: rgba(255,255,255,0.03); }

.trend-meta { font-size: 13px; color: var(--color-text-gray); }
.trend-name { font-size: 15px; font-weight: bold; display: block; margin: 2px 0; }

/* おすすめユーザー */
.user-item {
    padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
    transition: 0.2s; cursor: pointer;
}
.user-item:hover { background-color: rgba(0,0,0,0.03); }
.u-info { display: flex; gap: 10px; align-items: center; }
.u-name strong { display: block; font-size: 15px; }
.u-name small { color: var(--color-text-gray); }
.follow-btn-sm {
    background-color: #0f1419; color: white;
    border: none; padding: 6px 16px; border-radius: 20px;
    font-weight: bold; font-size: 14px; cursor: pointer;
}
[data-theme="dark"] .follow-btn-sm { background-color: #eff3f4; color: #0f1419; }