:root {
    --primary: #6c5ce7;
    --accent: #fd79a8;
    --bg: #f0f2f5;
}

/* Vueの初期化前にテンプレートが表示されるのを防ぐ */
[v-cloak] {
    display: none !important;
}

html {
    height: 100vh;
}

body {
    background-color: var(--bg);
    margin: 0;
    font-family: 'Hiragino Kaku Gothic ProN', sans-serif;
    overflow: hidden; /* クラウド内で完結させる */
    height: 100%;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* クラウドコンテナ */
.cloud-container {
    position: relative;
    width: 100vw;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    perspective: 1000px;
    pointer-events: none;
}

/* 共通カードスタイル */
.card {
    position: absolute;
    background: white;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    cursor: pointer;
    max-width: 200px;
    word-wrap: break-word;
    pointer-events: auto;
    transition: box-shadow 0.3s, transform 0.3s, background-color 0.3s;
}

.card:hover {
    box-shadow: 0 15px 40px rgba(108, 92, 231, 0.3);
    transform: scale(1.15); /* 少しだけ大きくして強調 */
    border: 2px solid var(--primary); /* 枠線をつけて目立たせる */
}

/* 議題のカードサイズを明示的に固定 */
.main-topic {
    position: absolute;
    max-width: 300px;
    background: white;
    padding: 20px;
    border: 3px solid var(--primary);
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.2);
    pointer-events: auto;
}

.main-topic h2 { font-size: 1.4rem; margin: 10px 0; }

.no-news {
    position: absolute;
    background: white;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    max-width: 400px;
    word-wrap: break-word;
    pointer-events: auto;
    transition: box-shadow 0.3s, transform 0.3s, background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
}

/* コメントカード */
.comment-card {
    max-width: 350px;
    height: auto;
    padding: 7px 16px;
    font-size: 0.9rem;
    border: 1px solid #eee;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}
.comment-card p {
    margin: 0;
    white-space: nowrap;     /* 改行を禁止 */
    overflow: hidden;        /* はみ出た部分を隠す */
    text-overflow: ellipsis; /* 「...」を表示 */
    width: 100%;
    padding-bottom: 2px;
}

.comment-card.is_reply {
    border-left: 4px solid var(--accent);
}

/* モーダル */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 24px;
    position: relative;
    animation: popIn 0.3s ease-out;
}

.modal-actions-comment {
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: 3px;
}

.modal-actions-reply {
    display: flex;
    flex-direction: row;
    gap: 3px;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ポップなタブ */
.tabs {
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 8px;
    background: white;
}

.tabs button {
    border: none;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: bold;
    color: #666;
    transition: 0.3s;
}

.tabs button.active {
    background: var(--primary);
    color: white;
}

/* FAB (フローティングボタン) */
.fab {
    position: fixed;
    bottom: 30px; right: 30px;
    width: 60px; height: 60px;
    border-radius: 30px;
    background: var(--primary);
    color: white;
    font-size: 30px;
    border: none;
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.4);
    cursor: pointer;
}

/* 閉じるボタンのスタイルがなかったので追加 */
.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

/* モーダル内のフォーム調整 */
.reply-form textarea {
    width: 100%;
    height: 100px;
    border-radius: 12px;
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 10px;
    font-family: inherit;
    box-sizing: border-box;
    resize: vertical;
}

.reply-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
}

.reply-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Z-indexの整理 */
.modal-overlay {
    z-index: 10000; /* 最前面 */
}
.card-wrapper:hover {
    z-index: 9999 !important; /* 2番目 */
}
.main-topic {
    z-index: 9998; /* 3番目 */
}
.fab {
    z-index: 9998; /* 3番目 */
}

/* 配置用のラッパー */
.card-wrapper {
    position: absolute;
    /* transitionをallではなくtransformに限定し、新登場時のみふわっとさせる */
    transition: transform 3.6s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

/* モーダル内の返信一覧 */
.replies-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.replies-list h4 {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 10px;
}

.reply-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 7px;
    border-radius: 8px;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.reply-item p {
    margin: 0;
    font-size: 0.85rem;
    color: #333;
}

.reply-stats {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}

.no-replies {
    font-size: 0.8rem;
    color: #aaa;
    text-align: center;
}

/* ポップアップ（モーダル）内は全文表示 */
.modal-comment-text {
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow: visible;
    text-overflow: clip;
    margin-bottom: 20px;
    margin-right: 18px;
    word-wrap: break-word;   /* 長い単語での改行を許可 */
}

/* Google Icons の調整 */
.material-symbols-outlined {
    vertical-align: middle;
    font-size: 20px;
}

.icon-small { font-size: 18px !important; margin-right: 2px; }
.icon-extra-small { font-size: 16px !important; margin-right: 1px; }

/* いいねボタンのデザインをリニューアル */
.btn-like {
    background: #ff7675; /* かわいい赤ピンク系 */
    color: white;
    border: none;
    padding: 4px 7px;
    border-radius: 9px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
}

.btn-like:hover {
    background: #d63031;
    transform: scale(1.05);
}

.btn-like:active {
    transform: scale(0.95);
}

.btn-report {
    background: #999;
    color: white;
    border: none;
    padding: 4px 5px;
    border-radius: 8px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    white-space: nowrap;
}

.btn-report span {
    margin: 0;
}

.btn-report:hover {
    transform: scale(1.05);
    background: #777;
}

.comment-container {
    display: flex; 
    justify-content: space-between;
    align-items: center;
}

.modal-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-confirm-action {
    background: #ff7675;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

.btn-cancel-action {
    background: #eee;
    color: #666;
    border: none;
    padding: 12px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}


/* カード内の統計情報コンテナ */
.card-stats {
    display: flex;
    gap: 7px;
    font-size: 0.8rem;
    color: #666;
}

.stat-item {
    display: flex;
    align-items: center;
}

/* 新規投稿時の強調アニメーション */
@keyframes highlight-pulse {
    0% { transform: scale(1.2); border-color: var(--primary); box-shadow: 0 0 20px var(--primary); }
    50% { transform: scale(1.2); border-color: var(--primary); box-shadow: 0 0 30px var(--primary); }
    100% { transform: scale(1); border-color: #eee; box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
}

.new-post-highlight {
    animation: highlight-pulse 3s ease-out;
    z-index: 10002 !important; /* 他のどのカードよりも手前に表示 */
    border-width: 2px !important;
}

/* footer */
footer {
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background-color: white;
    height: 40px; 
    font-size: 13px;
    gap: 20px;
}

.legal-footer a {
    color: #666;
    text-decoration: none;
}
.legal-footer a:hover {
    text-decoration: underline;
}
