/**
 * Meicom Web Project - 共通スタイルシート（完全復旧・統合版）
 * 既存のデザインを維持しつつ、チャット機能のUIを最適化しました。
 */

/* --- 1. 基本リセット --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Noto Serif JP', serif;
    background-color: #ffffff;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* --- 2. アニメーション準備（GSAP用） --- */
/* フッター(.mast_foot)をここから除外することで、リンクが消えるのを防ぎます */
.mast_head, .semi_head, .animate_in, .button_container, .admin_panel, .admin_table_wrapper {
    opacity: 0;
    visibility: hidden;
}

/* --- 3. ヘッダー（タイトル） --- */
.mast_head {
    width: 100%;
    padding: 60px 20px 30px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.title_link {
    text-decoration: none;
    color: #000000;
    display: inline-block;
}

.base_title_link {
    font-size: 42px;
    font-weight: bold;
}

/* --- 4. メインコンテンツのレイアウト --- */
.mast_body {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center; /* 中の要素を中央揃えにする */
    padding: 20px;
    flex: 1;
}

/* 中央揃えを徹底するための設定 */
.mast_body > div {
    width: 100%;
    text-align: center;
}
.mast_body_type1 {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex: 1;
}
.mast_body > div {
    width: 100%;
    text-align: center;
}

h1.semi_head, div.semi_head {
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
}

/* ログアウト用ボタン（通常時は青、ホバーで赤） */
.btn_logout, 
.btn_logout:visited {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid #000000; /* 黒色の枠線 */
    background-color: #ffffff; /* 白背景 */
    color: #000000;            /* 黒色の文字 */
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}
.btn_logout:hover {
    border-color: #ef4444;     /* ホバーで赤枠 */
    background-color: #ef4444; /* ホバーで赤背景 */
    color: #ffffff;            /* ホバーで白文字 */
}

h2 {
    margin: 25px 0 15px;
    border-left: 4px solid #000;
    padding-left: 12px;
    width: 100%;
    text-align: left;
}

/* --- 5. 入会・継続ボタン（以前のデザインを完全復旧） --- */
.button_container {
    text-align: center; 
    width: 100%;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.entryButton, .continuationButton {
    display: inline-block;
    font-size: 20px;
    color: #000000;
    text-decoration: none;
    padding: 12px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: transparent;
    border: 1px solid #000000; /* 枠線を復活 */
    min-width: 200px;
}

.entryButton:hover, .continuationButton:hover {
    background-color: #000000;
    color: #ffffff;
}

.entry_form, .continuation_form {
    text-decoration: none;
}

/* --- 6. フォーム要素（共通） --- */
form {
    width: 100%;
    background: #fdfdfd;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    text-align: left;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}

/* フォーム内送信ボタン */
button[type="submit"], 
input[type="submit"] {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #000;
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

button[type="submit"]:hover,
input[type="submit"]:hover {
    background-color: #444;
}

/* --- 7. マイページ・通知・メッセージ装飾 --- */
.fee_states {
    width: 100%;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

/* 成功メッセージ */
h2.success {
    color: #2e7d32;
    background-color: #e8f5e9;
    padding: 15px 20px;
    border-left: 5px solid #4caf50;
    border-radius: 4px;
    margin: 20px 0;
    font-size: 22px;
}

/* 情報メッセージ */
p.info {
    color: #1565c0;
    background-color: #e3f2fd;
    padding: 12px 20px;
    border-left: 5px solid #2196f3;
    border-radius: 4px;
    margin: 10px 0;
}

/* マイページ用リンク（ホバーアニメーション） */
a.mypage_link {
    font-size: 20px;
    color: #000000;
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
    margin-top: 20px;
}

a.mypage_link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #000000;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease-out;
}

a.mypage_link:hover::after {
    transform: scaleX(1);
}

.btn_link {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #000;
    text-decoration: none;
    color: #000;
    margin: 10px 5px;
    transition: 0.3s;
}

.btn_link_chat {
    display: inline-block;
    padding: 10px;
    width: 240px;
    border: 1px solid #000;
    text-decoration: none;
    color: #000;
    margin: 10px 5px;
    transition: 0.3s;

}

.btn_link:hover {
    background: #000;
    color: #fff;
}

.btn_link_chat:hover {
    background: #000;
    color: #fff;
}

/* --- 8. チャット専用UI（他への干渉を防ぐため詳細度をアップ） --- */
.chat_container {
    width: 100%;
    max-width: 600px;
    background: #f0f2f5;
    height: calc(100vh - 220px);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.chat_history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left; /* チャット内は左揃え */
}

.bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.bubble_admin {
    align-self: flex-start;
    background-color: #ffffff;
    color: #333;
    border-bottom-left-radius: 4px;
}

.bubble_user {
    align-self: flex-end;
    background-color: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.chat_time { font-size: 10px; color: #999; margin-top: 4px; display: block; }
.bubble_user .chat_time { color: rgba(255, 255, 255, 0.8); }

/* 入力エリア：詳細な指定で100%幅を上書き */
form.chat_input_area {
    background: #fff;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #eee;
    margin: 0;
    border-radius: 0;
    border: none;
    width: 100%;
}

form.chat_input_area textarea {
    flex: 1;
    width: auto;
    min-width: 0;
    height: 45px;
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    background: #f9fafb;
    margin-bottom: 0;
}



form.chat_input_area button.chat_send_btn {
    width: 80px;      /* 幅を固定 */
    height: 45px;     /* 高さを固定 */
    flex-shrink: 0;   /* 潰れないように固定 */
    margin: 0;        /* フォームの共通マージンを解除 */
    padding: 0;
    font-size: 14px;
    border-radius: 22px;
    background-color: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- 9. フッター・管理画面 --- */
.mast_foot {
    width: 100%;
    text-align: center;
    padding: 40px 0;
    margin-top: auto;
    /* 常に表示 */
    opacity: 1 !important;
    visibility: visible !important;
}

.link_admin {
    font-size: 14px;
    color: #999;
    text-decoration: none;
    transition: 0.3s;
    border-bottom: 1px solid transparent;
}

.link_admin:hover {
    color: #333;
    border-bottom: 1px solid #333;
}

.admin_table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin_table th, .admin_table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.admin_table th { background-color: #f4f4f4; }

/* 銀行情報のデザイン調整（色合いを落とす） */
.bank_info {
    margin-top: 10px;
    padding: 15px;
    background: #d3d7db; /* より薄いグレー */
    border: 1px solid #e2e8f0; /* 境界線も細く薄く */
    border-radius: 8px;
    color: #475569; /* 文字色を少し明るいグレーへ */
    font-size: 0.9em;
    line-height: 1.6;
            
}
.bank_info p {
    margin: 4px 0;
    margin-left: 15px;
}

/* QRコード表示エリアのスタイル */
.qr_code {
    margin-top: 20px;
    width: 250px;
    padding: 20px;
    background: #fff; /* 背景を白にしてQRを読みやすく */
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.qr_code img {
    max-width: 200px; /* 適切なサイズに制限 */
    width: 100%;      /* スマホ対応 */
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
}

.qr_code p {
    font-size: 14px;
    color: #333;
    text-align: left; /* テキストは左揃えが読みやすい */
}