/* --- Modern Reset Settings --- */

/* 1. 全要素のボックスモデルを統一（崩れ防止の基本） */
*, *::before, *::after {
    box-sizing: border-box;
}

/* 2. デフォルトの余白をリセット */
body, h1, h2, p, ul, figure {
    margin: 0;
    padding: 0;
}

/* 3. スマホでのテキストサイズ自動調整を防止（iPhoneでの意図しない拡大防止） */
html {
    -webkit-text-size-adjust: 100%;
}

/* 4. 画像がはみ出さないように設定 */
img {
    max-width: 100%;
    display: block;
}

/* 5. フォーム要素のフォントを継承（ボタンの文字が小さくなるのを防ぐ） */
input, button, textarea, select {
    font: inherit;
    /* iPhoneでのデフォルトの丸みを消し、CSSでの制御を優先させる */
    -webkit-appearance: none;
    appearance: none;
}

/* 6. タップした時の青いハイライトを消す（お好みで。よりアプリっぽくなります） */
* {
    -webkit-tap-highlight-color: transparent;
}

/* --- ここから下にあなたの既存のスタイルを書く --- */

body {
    /* 背景画像の設定 */
    background-image: url('../images/sakura-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    /* --- 変更ポイント1: 黒を重ねるのをやめ、白を薄く重ねてふんわりさせる --- */
    background-color: rgba(255, 255, 255, 0.4); 
    background-blend-mode: lighten; /* 画像を明るく、透明感のある印象に */

    /* --- 変更ポイント2: 文字色を優しいダークグレーに --- */
    color: #5a5a5a; 
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

h1 {
    /* --- 変更ポイント3: サクラに合う可愛らしいピンク --- */
    color: #ff8fb1; 
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8); /* 文字の周りを白く光らせて可読性アップ */
}

h2 {
    color: #ff8fb1; 
    border-bottom: 1px solid #ff8fb1;
    margin-bottom: 10px;
}

a {
    color: #ff8fb1;
    font-weight: bold;
}

.header-container {
    padding: 1rem;
    
    /* 背景とエフェクト */
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(255, 143, 177, 0.2);

    /* --- スマホ重視のサイズ設定 --- */
    width: 100%;
    max-width: 425px;
    box-sizing: border-box;

    margin: 0 auto;
    margin-bottom: 10px;
}

.main-container {
    padding: 1.5rem 1rem;
    
    /* 背景とエフェクト */
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(255, 143, 177, 0.2);

    /* --- スマホ重視のサイズ設定 --- */
    width: 100%;
    max-width: 425px;
    box-sizing: border-box;

    margin: 0 auto;
    margin-bottom: 10px;
}

.footer-container {
    text-align: center;
    padding: 1rem;
    
    /* 背景とエフェクト */
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(255, 143, 177, 0.2);

    /* --- スマホ重視のサイズ設定 --- */
    width: 100%;
    max-width: 425px;
    box-sizing: border-box;

    margin: 0 auto;
    font-size: small;
}

/* --- ハンバーガーメニューのスタイル --- */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-content a {
    text-decoration: none;
}

.hamburger-menu-container {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1100;
}

.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #ff8fb1;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
    transition: all 0.3s ease;
}

.hamburger-menu span {
    width: 24px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 10px;
    margin: 3px 0;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

.hamburger-menu:hover {
    background-color: #ff75a0;
    transform: scale(1.05);
}

.nav-menu {
    display: none;
    position: fixed;
    top: 70px;
    right: 10px;
    flex-direction: column;
    gap: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 143, 177, 0.3);
    border-radius: 10px;
    padding: 1rem;
    width: 90%;
    max-width: 300px;
    box-shadow: 0 8px 32px rgba(255, 143, 177, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-menu.active {
    display: flex;
}

.nav-menu a,
.nav-menu .logout-button {
    color: #ff8fb1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 143, 177, 0.1);
    text-align: center;
    display: block;
}

.nav-menu a:last-child,
.nav-menu .logout-button:last-child {
    border-bottom: none;
}

.nav-menu a:hover,
.nav-menu .logout-button:hover {
    color: #ff6fa5;
}

.logout-form {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
}

.logout-form:has(+ .delete-account-link) {
    border-bottom: 1px solid rgba(255, 143, 177, 0.1);
    padding: 0.8rem 0;
}

.logout-button {
    background: none;
    border: none;
    color: #ff8fb1;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    padding: 0.8rem 0;
    font-size: 1rem;
    width: 100%;
    display: block;
}

.delete-account-link {
    color: #999;
    font-size: 0.8rem;
}

/* 入力グループのレイアウト */
.form-group {
    text-align: left;
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #5a5a5a;
    font-size: 0.9rem;
}

/* 入力フォーム自体のデザイン */
.form-group input:not([type="checkbox"]) {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(255, 143, 177, 0.3);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #ff8fb1;
    box-shadow: 0 0 8px rgba(255, 143, 177, 0.3);
}

/* チェックボックスが横に伸びるのを防ぐ */
.form-group input[type="checkbox"] {
    width: 18px !important;  /* サイズを固定 */
    height: 18px !important;
    margin: 0 8px 0 0;
    cursor: pointer;
    background-color: transparent !important; /* 背景色を解除 */
    border: 1px solid #ccc !important;        /* 標準的な枠線に */
    appearance: auto;                          /* ブラウザ標準の見た目に戻す */
    -webkit-appearance: checkbox;
    display: inline-block;                     /* 確実にインライン表示 */
}

.form-group label[for$="-clear_id"] {
    display: inline-block !important; /* blockを解除して横に並べる */
    width: auto !important;
    margin-bottom: 0;
    vertical-align: middle;
    cursor: pointer;
}

/* セレクトボックスのデザイン */
.form-group select {
    width: 100%;
    padding: 0.8rem;
    padding-right: 2.5rem; /* 矢印アイコンと被らないための余白 */
    border: 1px solid rgba(255, 143, 177, 0.3);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    color: #333;
    transition: border-color 0.3s, box-shadow 0.3s;
    
    /* ブラウザ標準の矢印を消す */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    
    /* カスタムの矢印アイコン（ピンク色） */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ff8fb1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    cursor: pointer;
}

/* フォーカス時のデザイン（inputと統一） */
.form-group select:focus {
    outline: none;
    border-color: #ff8fb1;
    box-shadow: 0 0 8px rgba(255, 143, 177, 0.3);
}

/* プレースホルダー（最初の無効な選択肢）がある場合の文字色調整 */
.form-group select:invalid,
.form-group select option[value=""][disabled] {
    color: #999;
}

/* 選択肢（option）自体のデザイン */
.form-group select option {
    background-color: #fff;
    color: #333;
}

/* ヘルプテキストとエラー */
.help-text {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.3rem;
}

.error-text {
    color: #ff4d4d;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.pink-button {
    width: 100%;
    padding: 1rem;
    background-color: #ff8fb1;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 143, 177, 0.4);
    transition: transform 0.2s, background-color 0.2s;
}

.pink-button:active {
    transform: scale(0.98);
    background-color: #ff7aa3;
}

.delete-button {
    width: 100%;
    padding: 1rem;
    background-color: #ff8fb1;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 143, 177, 0.4);
    transition: transform 0.2s, background-color 0.2s;
    margin: 20px 0;
}

.delete-button:active {
    transform: scale(0.98);
    background-color: #ff7aa3;
}

.form-footer {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border: 1px solid #28a745;
    color: #155724;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: bold;
}

/* トグルスイッチの土台 */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

/* 本物のチェックボックスを隠す */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* スライダー（背景部分） */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

/* スライダー（動く白い丸の部分） */
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* ON（True）の時の背景色 - サクラピンク */
input:checked + .slider {
    background-color: #ff8fb1;
}

/* ON（True）の時の丸の移動 */
input:checked + .slider:before {
    transform: translateX(24px);
}

/* フォーカス時の影 */
input:focus + .slider {
    box-shadow: 0 0 1px #ff8fb1;
}

/* 横のテキスト（オプション） */
.toggle-label-text {
    font-size: 0.85rem;
    color: #666;
    font-weight: bold;
}

.no-image-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #ffeef2; /* ごく薄い桜色 */
    border: 2px dashed #ff8fb1; /* 桜色の点線 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff8fb1;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.image-avatar-center {
    margin: 0 auto 20px;
}

.current-image-container img {
    border-radius: 50%;
    width: 120px;
    height: 120px;
    object-fit: cover;
    margin-bottom: 20px;
}

.profile-header img {
    border-radius: 50%;
    width: 120px;
    height: 120px;
    object-fit: cover;
    margin-bottom: 20px;
}

/* プレート全体のコンテナ */
.user-plate {
    display: flex;
    align-items: center; /* 上下中央揃え */
    border-radius: 50px 15px 15px 50px; /* 左側を丸く、右を少し角丸に */
    color: white;
    margin: 0 auto 15px;
    width: 100%;
    max-width: 300px;
    padding-right: 20px;
}

/* リンクとしての装飾をリセット */
.user-plate-link {
    text-decoration: none;
    color: inherit; /* 親の文字色を引き継ぐ */
    display: block; /* プレート全体の幅をクリック可能にする */
    margin-bottom: 15px;
}

/* ホバー（マウスを乗せた時）の演出 */
.user-plate-link:hover .user-plate {
    transform: scale(1.05);
    transition: all 0.2s ease;
    cursor: pointer;
}

.user-icon {
    z-index: 200;
}

/* 左側のアイコン画像 */
.user-icon img {
    width: 70px;
    height: 70px;
    border-radius: 50%; /* 正円にする */
    border: 2px solid #ff8fb1; /* アイコンの縁取り（アクセントカラー） */
    object-fit: cover;
    display: block;
}

.no-image-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #ffeef2; /* ごく薄い桜色 */
    border: 2px dashed #ff8fb1; /* 桜色の点線 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff8fb1;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* 右側のテキストエリア */
.user-info {
    display: flex;
    flex-direction: column; /* 縦に並べる */
    flex-grow: 1;
}

/* VRC ステータス（上段） */
.vrc-status {
    font-size: 0.9rem;
    color: #3c35c6;
    margin-bottom: 2px;
}

/* VRC ID部分（中段） */
.vrc-id {
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    background-color: #605458; /* VRC風のダークグレー */
    margin-left: -10px;
    padding: 10px 10px 10px  0;
    z-index: 100;
    border-radius: 0 30px 30px 0;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 代名詞部分（下段） */
.vrc-nickname {
    text-align: right;
    font-size: 0.8rem;
    color: #fcf0f3; /* 少し薄いグレー */
}

.vrc-nickname-b {
    background-color: #605458;
    display: inline-block;
    padding: 2px 7px;
    border-radius: 20px;
}

/* プロフィール詳細画面専用スタイル */

.profile-detail-vrc-id {
    text-align: center;
    color: #ff8fb1;
    font-size: 1.6rem;
    margin: 0.5rem 0;
    font-weight: 800;
}

.profile-detail-nickname {
    color: #888;
    font-size: 1rem;
    margin-bottom: 0;
    text-align: right;
}

.profile-detail-divider {
    border: none;
    border-top: 1px solid rgba(255, 143, 177, 0.15);
    margin: 2rem 0;
}

.profile-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.profile-detail-label {
    color: #999;
    font-size: 0.9rem;
    font-weight: 600;
}

.profile-detail-value {
    color: #444;
    font-weight: 500;
}

.profile-detail-status-tag {
    padding: 0.3rem 1rem;
    border-radius: 50px;
    background: #f0f0f0;
    font-size: 0.9rem;
    color: #888;
}

.profile-detail-status-tag.active {
    background-color: #ff8fb1;
    color: white;
}

.profile-detail-personality-badge {
    color: #ff8fb1;
    font-weight: bold;
}

.fortune-container {
}

.fortune-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 2rem 1rem;
    text-align: center;
    border: 2px solid rgba(255, 143, 177, 0.3);
    box-shadow: 0 15px 35px rgba(255, 143, 177, 0.2);
}

.fortune-title {
    font-size: 1.2rem;
    color: #ff8fb1;
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.fortune-rank {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 1rem;
    /* ふわふわ揺れるアニメーション */
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.fortune-details {
    background: rgba(255, 143, 177, 0.05);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.fortune-item {
    margin-bottom: 1rem;
}

.fortune-item:last-child { margin-bottom: 0; }

.fortune-item-label { font-size: 0.9rem; color: #575353; margin-bottom: 0.2rem; }
.fortune-item-lucky-item { font-size: 1.1rem; color: #555; font-weight: 600; }
.fortune-item-lucky-personality { color: #ff8fb1; font-weight: 800; }

.retry-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #ff8fb1;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: 0.3s;
}

.retry-btn:hover {
    background: #ff78a0;
    transform: scale(1.05);
}

.topic-list-title {
    color: #ff8fb1;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: bold;
}

/* カード一覧 */
.topic-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 20px;
}

/* 個別カード */
.topic-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(255, 143, 177, 0.1);
    border: 1px solid rgba(255, 143, 177, 0.2);
    transition: transform 0.2s ease;
}

/* カード上部 */
.topic-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.topic-content {
    color: #444;
    font-size: 1rem;
}

.topic-category-c {
    margin-bottom: 5px;
}

.topic-category-tag {
    background: rgba(255, 143, 177, 0.15);
    color: #ff8fb1;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 5px 12px;
}

.topic-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-author {
    color: #555;
    line-height: 1.6;
    word-break: break-all;
    white-space: pre-wrap; /* 改行を反映させる */
}

.topic-timestamp {
    font-size: 0.8rem;
    color: #aaa;
}

/* 下部アクションエリア */
.topic-action-area {
    margin-top: 3rem;
    text-align: center;
}

.pink-button {
    background-color: #ff8fb1;
    color: white;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 143, 177, 0.3);
    transition: all 0.3s ease;
}

.pink-button:hover {
    background-color: #ff78a0;
    transform: scale(1.05);
}

.no-topics {
    text-align: center;
    color: #999;
    padding: 3rem 0;
}

.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 12px; /* 角丸を少しだけ控えめにするとスッキリします */
    border: 2px solid rgba(255, 143, 177, 0.1);
    background: rgba(255, 255, 255, 0.9);
    color: #555;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    outline: none;
}

/* フォーカス（入力中）のエフェクト */
.form-group textarea:focus {
    border-color: #ff8fb1;
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 143, 177, 0.2);
}

/* プレースホルダーの色 */
.form-group textarea::placeholder {
    color: #ccc;
}
