/**
 * ヘルプページ専用スタイル
 *
 * 権限マトリックス、ショートカット、使い方ガイドなどの
 * ヘルプページ固有のコンポーネントスタイルを定義
 */

/* ====================================
   ヘルプページ内のカード
   ==================================== */

/* カード間の間隔 */
.settings-section .card {
    margin-bottom: 1.5rem;
}

.settings-section .card:last-child {
    margin-bottom: 0;
}

/* ====================================
   権限マトリックステーブル
   ==================================== */

.permission-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

.permission-table th {
    background-color: var(--background-secondary);
    font-weight: 600;
    text-align: center;
}

.permission-table th:first-child {
    text-align: left;
}

.permission-table .category-header {
    background-color: var(--background-secondary);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
}

.permission-table .allowed,
.permission-table .denied {
    text-align: center;
    font-weight: 600;
}

.permission-table .allowed {
    color: var(--success);
}

.permission-table .denied {
    color: var(--text-muted);
}

/* ====================================
   ショートカットテーブル
   ==================================== */

.shortcut-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

.shortcut-table th {
    background-color: var(--background-secondary);
    font-weight: 600;
}

.shortcut-table kbd {
    background-color: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-family: monospace;
    font-size: 0.9em;
}

/* ====================================
   コードブロック
   ==================================== */

.help-content pre {
    background-color: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.help-content pre code {
    background-color: transparent;
    padding: 0;
    border: none;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

.help-content code {
    background-color: var(--background-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

/* ====================================
   アラートスタイル
   ==================================== */

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert.info {
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--text);
}

.alert.info i {
    color: #3b82f6;
    margin-top: 0.1rem;
}

.alert strong {
    font-weight: 600;
}

/* ====================================
   データ構造図
   ==================================== */

.structure-diagram {
    margin: 1.5rem 0;
}

.structure-item {
    padding: 1rem;
    border-left: 3px solid var(--brand);
    margin-bottom: 1rem;
    background: var(--background-secondary);
    border-radius: 6px;
}

.structure-item.level-1 {
    border-left-color: var(--brand);
}

.structure-item.level-2 {
    margin-left: 2rem;
    border-left-color: #10b981;
}

.structure-item.level-3 {
    margin-left: 4rem;
    border-left-color: #f59e0b;
}

.structure-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.structure-header i {
    font-size: 1.2rem;
}

.structure-header .ah-badge {
    margin-left: auto;
    background: var(--brand);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.structure-description {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ====================================
   タスク管理ワークフロー
   ==================================== */

.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.workflow-step {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.workflow-number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--brand);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.workflow-content {
    flex: 1;
}

.workflow-content h4 {
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workflow-content p {
    margin: 0.25rem 0;
    line-height: 1.6;
}

/* ====================================
   ビューガイドテーブル
   ==================================== */

.view-guide-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.view-guide-table th,
.view-guide-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.view-guide-table th {
    background-color: var(--background-secondary);
    font-weight: 600;
}

.view-guide-table td i {
    margin-right: 0.5rem;
}

.frequency {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.frequency.high {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.frequency.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.frequency.low {
    background: rgba(107, 114, 128, 0.2);
    color: var(--muted);
}

/* ====================================
   典型的な使い方の流れ
   ==================================== */

.flow-steps {
    list-style: none;
    padding: 0;
    counter-reset: flow-counter;
}

.flow-steps > li {
    counter-increment: flow-counter;
    margin-bottom: 1.5rem;
    padding-left: 3rem;
    position: relative;
}

.flow-steps > li::before {
    content: counter(flow-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--brand);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.flow-step-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.flow-step-header i {
    color: var(--brand);
}

/* ====================================
   タスクタイプ比較
   ==================================== */

.task-type-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

@media (max-width: 768px) {
    .task-type-comparison {
        grid-template-columns: 1fr;
    }
}

.task-type-card {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.task-type-card.finite {
    border-color: var(--brand);
}

.task-type-card.infinite {
    border-color: #10b981;
}

.task-type-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.task-type-card.finite .task-type-header {
    background: rgba(var(--brand-rgb), 0.1);
}

.task-type-card.infinite .task-type-header {
    background: rgba(16, 185, 129, 0.1);
}

.task-type-header i {
    font-size: 1.5rem;
}

.task-type-card.finite .task-type-header i {
    color: var(--brand);
}

.task-type-card.infinite .task-type-header i {
    color: #10b981;
}

.task-type-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.task-type-content {
    padding: 1rem;
}

.task-type-content p {
    margin: 0.5rem 0;
}

.task-type-definition,
.task-type-metric {
    font-size: 0.95rem;
}

.task-type-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.task-type-content ul li {
    margin: 0.25rem 0;
}

/* ====================================
   ライフサイクル図
   ==================================== */

.lifecycle-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.lifecycle-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 100px;
}

.lifecycle-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.lifecycle-icon.create {
    background: var(--brand);
}

.lifecycle-icon.progress {
    background: #f59e0b;
}

.lifecycle-icon.complete {
    background: #10b981;
}

.lifecycle-icon.archive {
    background: #6366f1;
}

.lifecycle-icon.any {
    background: var(--muted);
}

.lifecycle-icon.trash {
    background: #ef4444;
}

.lifecycle-icon.delete {
    background: #991b1b;
}

.lifecycle-label {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
}

.lifecycle-description {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.4;
}

.lifecycle-arrow {
    font-size: 1.5rem;
    color: var(--muted);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .lifecycle-diagram {
        flex-direction: column;
    }

    .lifecycle-arrow {
        transform: rotate(90deg);
    }
}
