/* guide-page.css - ガイドページ専用スタイル
 * アカウント削除ガイド、設定ガイドなどのヘルプページ用
 * 作成日: 2025-12-29
 */

/* ============================================
   Table of Contents (目次)
   ============================================ */
/* nav.table-of-contents は common-page.css / header-footer.css の nav スタイルを上書きする必要がある */
nav.table-of-contents,
.table-of-contents {
    position: static !important; /* common-page.css の nav { position: fixed } を上書き */
    width: auto !important;
    top: auto !important;
    left: auto !important;
    z-index: auto !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    background: var(--color-bg-base) !important;
    color: var(--color-text-primary) !important;
    border-left: 4px solid var(--color-btn-primary);
    border-radius: 4px;
    padding: 20px 25px;
    margin-bottom: 30px;
}

.table-of-contents h2 {
    font-size: 18px;
    color: var(--color-header-bg);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-of-contents ul {
    list-style: none;
    padding-left: 0;
    display: block !important; /* header-footer.css の nav ul { display: flex } を上書き */
    margin: 0;
}

.table-of-contents li {
    margin-bottom: 6px;
    display: list-item !important; /* header-footer.css の nav li を上書き */
}

.table-of-contents a {
    color: var(--color-btn-primary) !important; /* header-footer.css の nav a を上書き */
    text-decoration: none;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.table-of-contents a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* ============================================
   Alert Boxes (アラートボックス)
   ============================================ */
.alert {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert i {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-danger i {
    color: #e74c3c;
}

.alert-warning {
    background-color: var(--color-warning-light, #fffbeb);
    border: 1px solid #fde68a;
    color: var(--color-warning-dark, #92400e);
}

.alert-warning i {
    color: #ffc107;
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.alert-info i {
    color: #3498db;
}

.alert-success {
    background-color: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.alert-success i {
    color: var(--color-success-dark);
}

.alert-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.alert-content p {
    margin: 0;
}

/* ============================================
   Section Header (セクションヘッダー)
   ============================================ */
.section-header {
    border-left: 4px solid var(--color-btn-primary);
    padding-left: 16px;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 26px;
    color: var(--color-header-bg);
    margin-bottom: 8px;
}

.section-header p {
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* ============================================
   Comparison Table (比較テーブル)
   ============================================ */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.comparison-table th,
.comparison-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.comparison-table th {
    background: var(--color-bg-base);
    font-weight: 600;
    color: var(--color-header-bg);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table .highlight {
    background: #fef3c7;
}

/* ============================================
   Flow Diagram (フロー図)
   ============================================ */
.flow-diagram {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 30px 0;
}

.flow-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
}

.flow-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 24px;
    top: 50px;
    width: 2px;
    height: calc(100% - 10px);
    background: linear-gradient(to bottom, var(--color-btn-primary), var(--color-border));
}

.flow-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--color-btn-primary), var(--color-secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
    z-index: 1;
}

.flow-content {
    flex: 1;
    padding-bottom: 30px;
}

.flow-content h3 {
    font-size: 20px;
    color: var(--color-header-bg);
    margin-bottom: 10px;
}

.flow-content p {
    color: var(--color-text-secondary);
    margin-bottom: 10px;
}

.flow-detail {
    background: var(--color-bg-base);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.flow-detail ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.flow-detail li {
    padding: 4px 0;
    padding-left: 25px;
    position: relative;
    color: var(--color-text-secondary);
}

.flow-detail li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--color-success-dark);
}

/* ============================================
   Timeline (タイムライン)
   ============================================ */
.timeline {
    background: linear-gradient(135deg, #f5f7fa, #e4e8ec);
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
}

.timeline-header {
    text-align: center;
    margin-bottom: 25px;
}

.timeline-header h3 {
    font-size: 20px;
    color: var(--color-header-bg);
}

.timeline-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 20px 0;
}

.timeline-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--color-success-dark), #ffc107, #e74c3c);
    transform: translateY(-50%);
    border-radius: 2px;
}

.timeline-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-bg-secondary);
    border: 4px solid var(--color-success-dark);
    margin-bottom: 10px;
}

.timeline-point:nth-child(2) .timeline-dot {
    border-color: #ffc107;
}

.timeline-point:nth-child(3) .timeline-dot {
    border-color: #e74c3c;
}

.timeline-label {
    font-size: 14px;
    font-weight: bold;
    color: var(--color-text-primary);
    text-align: center;
    background: var(--color-bg-secondary);
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ============================================
   Data List (データリスト)
   ============================================ */
.data-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.data-item {
    background: var(--color-bg-base);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.data-item i {
    font-size: 24px;
    color: var(--color-btn-primary);
}

.data-item.delete i {
    color: #e74c3c;
}

.data-item span {
    font-size: 14px;
    color: var(--color-text-primary);
}

/* ============================================
   Recovery Box (復旧ボックス)
   ============================================ */
.recovery-box {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    border: 2px solid var(--color-success-dark);
}

.recovery-box h3 {
    color: #2e7d32;
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recovery-box p {
    color: #1b5e20;
    margin-bottom: 15px;
}

.recovery-steps {
    background: var(--color-bg-secondary);
    border-radius: 8px;
    padding: 20px;
}

.recovery-steps ol {
    margin: 0;
    padding-left: 20px;
}

.recovery-steps li {
    padding: 8px 0;
    color: #2e7d32;
}

/* ============================================
   Contact Box (連絡先ボックス)
   ============================================ */
.contact-box {
    background: var(--color-bg-base);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.contact-box p {
    margin-bottom: 10px;
}

.contact-box a {
    color: var(--color-btn-primary);
    text-decoration: none;
    font-weight: bold;
}

.contact-box a:hover {
    text-decoration: underline;
}

/* ============================================
   Steps (ステップフロー)
   ============================================ */
.steps {
    counter-reset: step-counter;
}

.step {
    margin-bottom: 40px;
    position: relative;
    padding-left: 70px;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 24px;
    top: 50px;
    width: 2px;
    height: calc(100% + 0px);
    background: linear-gradient(to bottom, var(--color-btn-primary), var(--color-border));
}

.step:before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--color-btn-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(91, 124, 153, 0.3);
    z-index: 1;
}

.step h3 {
    font-size: 20px;
    color: var(--color-header-bg);
    margin-bottom: 12px;
}

.step p {
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

/* ============================================
   Info Table (情報テーブル)
   ============================================ */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.info-table th,
.info-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.info-table th {
    background: var(--color-bg-base);
    font-weight: 600;
    color: var(--color-header-bg);
}

.info-table td {
    color: var(--color-text-secondary);
}

/* ============================================
   Section (セクション)
   ============================================ */
.section {
    background: var(--color-bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 40px;
    margin-bottom: 40px;
}

/* ============================================
   Button (ボタン)
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--color-btn-primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 124, 153, 0.3);
}

.btn i {
    margin-right: 6px;
}

/* ============================================
   Note & Warning Boxes (注意ボックス)
   ============================================ */
.note {
    background: var(--color-bg-base);
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
    border-left: 4px solid var(--color-info-dark);
}

.note p {
    margin: 0;
    color: var(--color-text-secondary);
}

.note i {
    color: var(--color-info-dark);
    margin-right: 8px;
}

.warning {
    background: var(--color-warning-light);
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
    border-left: 4px solid var(--color-warning);
}

.warning p {
    margin: 0;
    color: var(--color-warning-dark);
}

.warning i {
    color: var(--color-warning);
    margin-right: 8px;
}

/* ============================================
   Table of Contents Toggle (目次の折りたたみ)
   ============================================ */
.table-of-contents h2 {
    cursor: pointer;
}

.table-of-contents h2 .toc-toggle {
    display: none;
    margin-left: auto;
    font-size: 14px;
    transition: transform 0.3s ease;
}

/* 中幅画面: 折りたたみ可能な目次 */
@media (max-width: 1100px) {
    .table-of-contents {
        padding: 12px 20px; /* 折りたたみ時はコンパクトに（上下均等） */
        margin-bottom: 0; /* margin を削除（白い隙間防止） */
    }

    .table-of-contents + .section {
        margin-top: 0; /* 目次との間に隙間を作らない */
    }

    .table-of-contents h2 {
        margin-bottom: 0; /* 折りたたみ時は余白を削除 */
    }

    .table-of-contents h2 .toc-toggle {
        display: inline-block;
    }

    .table-of-contents ul {
        display: none !important;
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--color-border);
    }

    .table-of-contents.toc-open ul {
        display: flex !important;
    }

    .table-of-contents.toc-open {
        padding-bottom: 15px; /* 開いた時の下余白を調整 */
    }

    .table-of-contents.toc-open h2 {
        margin-bottom: 12px; /* 開いた時は余白を復活 */
    }

    .table-of-contents.toc-open h2 .toc-toggle {
        transform: rotate(180deg);
    }

    .table-of-contents li {
        margin-bottom: 4px;
    }

    .table-of-contents li:last-child {
        margin-bottom: 0; /* 最後の項目の下余白を削除 */
    }
}

/* ============================================
   FAQ Section (FAQ)
   ============================================ */
.faq {
    margin-top: 40px;
}

.faq h3 {
    margin-bottom: 20px;
    color: var(--color-header-bg);
}

.faq-item {
    background: var(--color-bg-base);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.faq-item h4 {
    color: var(--color-header-bg);
    font-size: 17px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-item h4 i {
    color: var(--color-btn-primary);
}

.faq-item p {
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.faq-item a {
    color: var(--color-btn-primary);
    text-decoration: underline;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-size: 16px;
    font-weight: bold;
    color: var(--color-header-bg);
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.faq-question i {
    color: var(--color-btn-primary);
    flex-shrink: 0;
}

.faq-answer {
    color: var(--color-text-secondary);
    padding-left: 30px;
}

/* ============================================
   Screenshot Placeholder (スクリーンショット)
   ============================================ */
.screenshot {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border: 2px dashed var(--color-border-dark);
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    margin: 20px 0;
    color: var(--color-text-secondary);
}

.screenshot i {
    font-size: 48px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    display: block;
}

.screenshot .comment {
    font-size: 14px;
    font-style: italic;
    color: var(--color-text-secondary);
    margin-top: 8px;
}

/* ============================================
   Button Group (ボタングループ)
   ============================================ */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* ============================================
   Links Section (リンクセクション)
   ============================================ */
.links-section {
    text-align: center;
    padding: 30px;
    background: var(--color-bg-base);
    border-radius: 12px;
    margin-top: 40px;
}

.links-section p {
    margin-bottom: 20px;
    color: var(--color-text-secondary);
}

.links-section a {
    color: var(--color-btn-primary);
    text-decoration: none;
    margin: 0 15px;
}

.links-section a:hover {
    text-decoration: underline;
}

/* ============================================
   Dark Mode - Guide Components
   ============================================ */
@media (prefers-color-scheme: dark) {
    nav.table-of-contents,
    .table-of-contents {
        background: #2d2d2d !important;
        border-left-color: #8bb8e8;
        color: #e0e0e0 !important;
    }

    .table-of-contents h2 {
        color: #ffffff;
    }

    .table-of-contents a {
        color: #8bb8e8 !important;
    }

    .table-of-contents a:hover {
        color: #a8d0ff !important;
    }

    .table-of-contents ul {
        border-top-color: #444444;
    }

    .alert-danger {
        background-color: #3a2020;
        border-color: #e87373;
        color: #e8a8a8;
    }

    .alert-warning {
        background-color: #3d3520;
        border-color: #d4a800;
        color: #e0c080;
    }

    .alert-info {
        background-color: #1e3a5f;
        border-color: #5ba3f5;
        color: #a8d0ff;
    }

    .alert-success {
        background-color: #1c4532;
        border-color: #48bb78;
        color: #9ae6b4;
    }

    .comparison-table th {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .comparison-table .highlight {
        background: #3d3520;
    }

    .timeline {
        background: linear-gradient(135deg, #2d2d2d, #3a3a3a);
    }

    .recovery-box {
        background: linear-gradient(135deg, #1c4532, #276749);
    }

    .recovery-box h3,
    .recovery-box p {
        color: #9ae6b4;
    }

    .recovery-steps {
        background: #2d2d2d;
    }

    .recovery-steps li {
        color: #9ae6b4;
    }

    .screenshot {
        background: linear-gradient(135deg, #2d2d2d, #3a3a3a);
        border-color: #555555;
    }

    .btn {
        background: #6b7fd8;
        color: #ffffff;
    }

    .btn:hover {
        background: #7b8fe8;
    }

    .btn-primary {
        background: #6b7fd8;
    }

    .btn-primary:hover {
        background: #7b8fe8;
    }

    .btn-danger {
        background: #e05252;
    }

    .btn-danger:hover {
        background: #f06060;
    }

    .info-table {
        background: #2d2d2d;
    }

    .info-table th {
        background: #3d3d3d;
        color: #ffffff;
    }

    .info-table td {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .info-table th,
    .info-table td {
        border-bottom-color: #444444;
    }

    .faq-item {
        background: #2d2d2d;
    }

    .faq-item h4 {
        color: #ffffff;
    }

    .faq-item p {
        color: #e0e0e0;
    }

    .note {
        background: #2d3748;
        border-left-color: #5ba3f5;
    }

    .note p {
        color: #a8d0ff;
    }

    .warning {
        background: #3d3520;
        border-left-color: #d4a800;
    }

    .warning p {
        color: #e0c080;
    }

    .section {
        background: #1e1e1e;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
}

/* Dark mode with explicit attribute */
[data-theme="dark"] nav.table-of-contents,
[data-theme="dark"] .table-of-contents {
    background: #2d2d2d !important;
    border-left-color: #8bb8e8;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .table-of-contents h2 {
    color: #ffffff;
}

[data-theme="dark"] .table-of-contents a {
    color: #8bb8e8 !important;
}

[data-theme="dark"] .table-of-contents ul {
    border-top-color: #444444;
}

[data-theme="dark"] .alert-danger {
    background-color: #3a2020;
    border-color: #e87373;
    color: #e8a8a8;
}

[data-theme="dark"] .alert-warning {
    background-color: #3d3520;
    border-color: #d4a800;
    color: #e0c080;
}

[data-theme="dark"] .alert-info {
    background-color: #1e3a5f;
    border-color: #5ba3f5;
    color: #a8d0ff;
}

[data-theme="dark"] .alert-success {
    background-color: #1c4532;
    border-color: #48bb78;
    color: #9ae6b4;
}

[data-theme="dark"] .comparison-table th {
    background: #2d2d2d;
    color: #e0e0e0;
}

[data-theme="dark"] .timeline {
    background: linear-gradient(135deg, #2d2d2d, #3a3a3a);
}

[data-theme="dark"] .recovery-box {
    background: linear-gradient(135deg, #1c4532, #276749);
}

[data-theme="dark"] .screenshot {
    background: linear-gradient(135deg, #2d2d2d, #3a3a3a);
}

[data-theme="dark"] .btn {
    background: #6b7fd8;
    color: #ffffff;
}

[data-theme="dark"] .btn:hover {
    background: #7b8fe8;
}

[data-theme="dark"] .info-table {
    background: #2d2d2d;
}

[data-theme="dark"] .info-table th {
    background: #3d3d3d;
    color: #ffffff;
}

[data-theme="dark"] .info-table td {
    background: #2d2d2d;
    color: #e0e0e0;
}

[data-theme="dark"] .info-table th,
[data-theme="dark"] .info-table td {
    border-bottom-color: #444444;
}

[data-theme="dark"] .faq-item {
    background: #2d2d2d;
}

[data-theme="dark"] .faq-item h4 {
    color: #ffffff;
}

[data-theme="dark"] .faq-item p {
    color: #e0e0e0;
}

[data-theme="dark"] .note {
    background: #2d3748;
    border-left-color: #5ba3f5;
}

[data-theme="dark"] .note p {
    color: #a8d0ff;
}

[data-theme="dark"] .warning {
    background: #3d3520;
    border-left-color: #d4a800;
}

[data-theme="dark"] .warning p {
    color: #e0c080;
}

[data-theme="dark"] .section {
    background: #1e1e1e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ============================================
   Responsive - Guide Components
   ============================================ */
@media (max-width: 768px) {
    .table-of-contents {
        padding: 15px 20px;
    }

    .table-of-contents h2 {
        font-size: 16px;
    }

    .table-of-contents a {
        font-size: 14px;
    }

    .section {
        padding: 24px 20px;
    }

    .step {
        padding-left: 0;
        padding-top: 48px;
    }

    .step:not(:last-child)::after {
        display: none;
    }

    .step:before {
        left: 0;
        top: 0;
        transform: none;
    }

    .flow-step {
        flex-direction: column;
        align-items: flex-start;
    }

    .flow-step:not(:last-child)::after {
        display: none;
    }

    .timeline-bar {
        flex-direction: column;
        gap: 30px;
    }

    .timeline-bar::before {
        width: 4px;
        height: 100%;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    .data-list {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        text-align: center;
    }

    .comparison-table {
        font-size: 14px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 12px 8px;
    }

    .links-section a {
        display: block;
        margin: 10px 0;
    }

    .section-header h2 {
        font-size: 22px;
    }
}
