/**
 * ゼロから始める理論科目 一覧ページCSS
 * Version: 3.0.0 - リデザイン版
 */

/* ==================== */
/* 基本設定 */
/* ==================== */
.index-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 20px 100px;
}

/* ==================== */
/* ヒーローセクション */
/* ==================== */
.hero-section {
    text-align: center;
    padding: 56px 32px 48px;
    background: linear-gradient(145deg, #e8553d 0%, #c93a1e 50%, #a82e15 100%);
    border-radius: 24px;
    color: #fff;
    margin-bottom: 40px;
    box-shadow:
        0 20px 60px rgba(200, 58, 30, 0.25),
        inset 0 1px 0 rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 600;
    margin-bottom: 18px;
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
}

.hero-section h1 {
    font-size: 2.1em;
    font-weight: 800;
    margin-bottom: 14px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.hero-subtitle {
    font-size: 1em;
    opacity: 0.9;
    margin-bottom: 28px;
    font-weight: 400;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.feature-tag {
    background: rgba(255,255,255,0.12);
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.85em;
    font-weight: 500;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ==================== */
/* Aboutセクション */
/* ==================== */
.about-section {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
}

.about-section h2 {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.about-text {
    line-height: 1.9;
}

.about-text p {
    margin-bottom: 10px;
    font-size: 0.95em;
}

.about-text .highlight {
    color: #d63e2a;
    font-weight: 700;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #f8f8f6;
    border-radius: 14px;
    border: 1px solid #eee;
}

.feature-icon {
    font-size: 1.6em;
}

.feature-text strong {
    display: block;
    color: #333;
    margin-bottom: 2px;
    font-size: 0.9em;
}

.feature-text p {
    font-size: 0.82em;
    color: #888;
    margin: 0;
}

/* ==================== */
/* フローセクション */
/* ==================== */
.flow-section {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
}

.flow-section h2 {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.flow-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.flow-card {
    padding: 20px 16px;
    border-radius: 16px;
    text-align: center;
}

.flow-card.main {
    background: #fef5f4;
    border: 2px solid #e8553d;
}

.flow-card.support {
    background: #f0f7ff;
    border: 2px solid #3b82f6;
}

.flow-card.advanced {
    background: #f5f0ff;
    border: 2px solid #8b5cf6;
}

.flow-badge {
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.flow-card p {
    font-size: 0.85em;
    color: #666;
    line-height: 1.65;
}

/* ==================== */
/* クイックナビ */
/* ==================== */
.toc-section {
    background: #fff;
    border: 1px solid #e5e3df;
    border-radius: 16px;
    padding: 16px 20px;
    margin: 28px 0 36px;
    position: sticky;
    top: 10px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.toc-title {
    margin: 0;
    font-size: 1rem;
    color: #666;
    font-weight: 600;
}

.toc-hint {
    font-size: 0.75rem;
    color: #aaa;
    background: #f5f4f2;
    padding: 4px 10px;
    border-radius: 12px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 25px;
    background: #faf9f7;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    border: 1.5px solid #e5e3df;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.toc-icon {
    font-size: 1rem;
}

.toc-text {
    font-size: 0.85rem;
}

.toc-arrow {
    display: none;
}

.toc-link:hover {
    border-color: var(--primary-color, #e8553d);
    background: var(--primary-light, #fef5f4);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.toc-link.active {
    background: var(--primary-color, #e8553d);
    color: #fff;
    border-color: var(--primary-color, #e8553d);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

.toc-link.active .toc-icon {
    filter: brightness(10);
}

.toc-link:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary-color) 50%, white);
    outline-offset: 2px;
}

/* ==================== */
/* テーマカラー定義 */
/* ==================== */
.theme-dc {
    --unit-color: #d35400;
    --unit-bg: #fef8f3;
    --unit-glow: rgba(211, 84, 0, 0.1);
    --primary-color: #d35400;
    --primary-light: #fef8f3;
}

.theme-induction {
    --unit-color: #2e7d32;
    --unit-bg: #f1f8e9;
    --unit-glow: rgba(76, 175, 80, 0.12);
    --primary-color: #4caf50;
    --primary-light: #f1f8e9;
}

.theme-transformer {
    --unit-color: #1e8449;
    --unit-bg: #f2faf5;
    --unit-glow: rgba(30, 132, 73, 0.1);
    --primary-color: #1e8449;
    --primary-light: #f2faf5;
}

.theme-synchronous {
    --unit-color: #2980b9;
    --unit-bg: #f2f8fd;
    --unit-glow: rgba(41, 128, 185, 0.1);
    --primary-color: #2980b9;
    --primary-light: #f2f8fd;
}

/* ==================== */
/* 単元一覧 */
/* ==================== */
.units-section {
    margin-bottom: 30px;
}

.units-section > h2 {
    font-size: 1.35em;
    font-weight: 700;
    margin-bottom: 22px;
    color: #333;
}

/* 単元ブロック */
.unit-block {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
    border-left: 5px solid var(--unit-color, #e94560);
    scroll-margin-top: 80px;
}

/* 単元ヘッダー */
.unit-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0efed;
    margin-bottom: 24px;
}

.unit-icon {
    font-size: 2.4em;
}

.unit-info {
    flex: 1;
}

.unit-info h3 {
    font-size: 1.4em;
    font-weight: 800;
    color: var(--unit-color);
    margin-bottom: 4px;
}

.unit-info p {
    font-size: 0.85em;
    color: #888;
    margin: 0;
}

.unit-count {
    background: var(--unit-color);
    color: #fff;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* セクションヘッダー */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px dashed #eee;
}

.section-badge {
    background: var(--unit-color);
    color: #fff;
    padding: 4px 14px;
    border-radius: 15px;
    font-size: 0.78em;
    font-weight: 700;
    white-space: nowrap;
}

.section-title {
    color: #888;
    font-size: 0.88em;
    font-weight: 500;
}

/* ==================== */
/* 講座リスト - 新デザイン */
/* ==================== */
.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 講座アイテム */
.lesson-item {
    display: grid;
    grid-template-columns: 54px 1fr auto;
    align-items: center;
    gap: 0 14px;
    padding: 14px 18px;
    background: #faf9f7;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1.5px solid transparent;
    position: relative;
}

/* 講番号 */
.lesson-number {
    font-weight: 700;
    color: var(--unit-color);
    font-size: 0.78em;
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1;
}

/* タイトル＋説明ラッパー */
.lesson-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* タイトル */
.lesson-title {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
    line-height: 1.4;
}

/* 説明 */
.lesson-desc {
    font-size: 0.78em;
    color: #aaa;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 数式が含まれる場合のスタイル */
.lesson-desc .MathJax {
    font-size: 1.05em !important;
}

/* 矢印エリア */
.lesson-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--unit-glow, rgba(0,0,0,0.04));
    color: var(--unit-color);
    transition: all 0.22s ease;
    flex-shrink: 0;
}

.lesson-arrow svg {
    width: 16px;
    height: 16px;
    stroke: var(--unit-color);
    stroke-width: 2.5;
    fill: none;
    transition: transform 0.22s ease;
}

/* 旧statusは非表示 */
.lesson-status {
    display: none;
}

/* 利用可能な講座 */
.lesson-item.available {
    cursor: pointer;
    background: var(--unit-bg);
    border-color: rgba(0,0,0,0.04);
}

.lesson-item.available .lesson-title {
    color: var(--unit-color);
}

.lesson-item.available:hover {
    background: #fff;
    border-color: var(--unit-color);
    box-shadow: 0 6px 24px var(--unit-glow, rgba(0,0,0,0.08));
    transform: translateY(-2px);
}

.lesson-item.available:hover .lesson-arrow {
    background: var(--unit-color);
}

.lesson-item.available:hover .lesson-arrow svg {
    stroke: #fff;
    transform: translateX(2px);
}

.lesson-item.available:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--unit-glow);
}

/* ロック状態の講座 */
.lesson-item.locked {
    opacity: 0.45;
    background: #f0efed;
    pointer-events: none;
    cursor: not-allowed;
}

.lesson-item.locked .lesson-title {
    color: #999;
}

.lesson-item.locked .lesson-desc {
    color: #bbb;
}

.lesson-item.locked .lesson-arrow {
    background: #e5e3df;
}

.lesson-item.locked .lesson-arrow svg {
    stroke: #bbb;
}

/* ==================== */
/* 学習のコツ */
/* ==================== */
.tips-section {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
}

.tips-section h2 {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.tip-card {
    display: flex;
    gap: 14px;
    padding: 20px;
    background: #f8f8f6;
    border-radius: 14px;
    border: 1px solid #eee;
}

.tip-number {
    width: 34px;
    height: 34px;
    background: linear-gradient(145deg, #e8553d, #c93a1e);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
    font-size: 0.9em;
}

.tip-content strong {
    display: block;
    color: #333;
    margin-bottom: 6px;
    font-size: 0.95em;
}

.tip-content p {
    font-size: 0.85em;
    color: #888;
    line-height: 1.65;
    margin: 0;
}

/* ==================== */
/* スタートボタン */
/* ==================== */
.start-section {
    text-align: center;
    padding: 20px 0;
}

.start-button {
    display: inline-block;
    background: linear-gradient(145deg, #e8553d 0%, #c93a1e 100%);
    color: #fff;
    padding: 18px 50px;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(200, 58, 30, 0.3);
    transition: all 0.3s ease;
}

.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(200, 58, 30, 0.4);
}

/* ==================== */
/* レスポンシブ */
/* ==================== */
@media (max-width: 768px) {
    .index-container {
        padding: 14px 14px 80px;
    }

    .hero-section {
        padding: 36px 20px 32px;
        border-radius: 18px;
    }

    .hero-section h1 {
        font-size: 1.5em;
    }

    .hero-features {
        flex-direction: column;
        align-items: center;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .flow-cards {
        grid-template-columns: 1fr;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .unit-header {
        flex-wrap: wrap;
    }

    .unit-count {
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }

    .unit-block {
        padding: 20px 16px;
        border-radius: 16px;
    }

    /* クイックナビ - モバイル */
    .toc-section {
        position: sticky;
        top: 0;
        padding: 12px 14px;
        margin-left: -14px;
        margin-right: -14px;
        border-radius: 0;
        z-index: 100;
        background: #fff;
        box-shadow: none;
        transition: box-shadow 0.2s ease;
    }

    .toc-section.is-stuck {
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .toc-header {
        margin-bottom: 10px;
    }

    .toc-hint {
        display: none;
    }

    .toc-list {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .toc-link {
        padding: 7px 12px;
        font-size: 0.78rem;
    }

    .toc-icon {
        font-size: 0.95rem;
    }

    .unit-block {
        scroll-margin-top: 100px;
    }

    /* 講座アイテム - モバイル */
    .lesson-item {
        grid-template-columns: 44px 1fr 32px;
        padding: 12px 14px;
    }

    .lesson-desc {
        font-size: 0.75em;
    }

    .start-button {
        padding: 15px 40px;
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.3em;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .lesson-item {
        grid-template-columns: 38px 1fr 30px;
        padding: 11px 12px;
        gap: 0 10px;
    }

    .lesson-number {
        font-size: 0.72em;
    }

    .lesson-title {
        font-size: 0.88em;
    }

    .lesson-arrow {
        width: 28px;
        height: 28px;
    }

    .lesson-arrow svg {
        width: 14px;
        height: 14px;
    }

    .toc-section {
        padding: 10px 12px;
    }

    .toc-list {
        gap: 6px;
    }

    .toc-link {
        padding: 6px 10px;
        font-size: 0.72rem;
        gap: 4px;
    }

    .toc-icon {
        font-size: 0.9rem;
    }

    .unit-block {
        scroll-margin-top: 90px;
    }
}