/* ======================
   バイブコーディング入門 - コンポーネントCSS
   再利用可能なUI部品
   作成日: 2025/06/07
   ====================== */

/* ===== Information Boxes - Simple ===== */
.info-box {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 25px;
    margin: 30px 0;
    line-height: 1.8;
    font-size: 16px;
}

.warning-box {
    background: #ffffff;
    border: 1px solid #ff9800;
    border-radius: 4px;
    padding: 25px;
    margin: 30px 0;
    line-height: 1.8;
    font-size: 16px;
}

.concept-box {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 25px;
    margin: 30px 0;
}

.quote-box {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 25px;
    margin: 30px 0;
    font-style: italic;
}

.success-box {
    background: #ffffff;
    border: 1px solid #4caf50;
    border-radius: 4px;
    padding: 25px;
    margin: 30px 0;
    line-height: 1.8;
    font-size: 16px;
}

.troubleshooting {
    margin: 50px 0;
    padding: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    backdrop-filter: var(--backdrop-blur);
}

.troubleshooting-item {
    background: var(--warning-bg);
    border: 1px solid var(--warning-yellow);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
    transition: all var(--transition-base);
}

.troubleshooting-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.troubleshooting-item h4 {
    color: var(--error-red);
    margin-bottom: 10px;
    font-size: 16px;
}

.requirement-list {
    background: var(--light-blue);
    border: 1px solid var(--border-blue);
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 30px 0;
}

.requirement-list h3 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 18px;
}

.requirement-list ul {
    margin: 0;
    padding-left: 20px;
}

.requirement-list li {
    margin-bottom: 8px;
    line-height: 1.7;
}

/* ===== Cards & Grids ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* Topic grid (index pages) */
.topic-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

.topic-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 25px;
}

.topic-item:hover {
    border-color: #999999;
}

.topic-item h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    line-height: 1.4;
}

.topic-item a {
    color: var(--primary-blue);
    text-decoration: none;
}

.topic-item a:hover {
    text-decoration: underline;
}

.topic-item p {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.7;
}

.category-card {
    background: var(--background-white);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all var(--transition-base);
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy), var(--shadow-glow);
    text-decoration: none;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.card-header {
    margin-bottom: 15px;
}

.card-icon {
    font-size: 32px;
    color: var(--primary-blue);
    margin-bottom: 10px;
    display: block;
    text-align: center;
    margin: 0 auto 10px;
}

.card-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

.card-content {
    font-size: 14px;
}

.card-description {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.card-topics {
    list-style: none;
    font-size: 13px;
    color: #555;
    margin: 0;
}

.card-topics li {
    padding: 3px 0;
    padding-left: 15px;
    position: relative;
    margin-bottom: 0;
}

.card-topics li:before {
    content: "・";
    position: absolute;
    left: 0;
}

/* ===== Navigation Components ===== */
.nav-button,
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    background: var(--background-white);
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: all var(--transition-base);
}

.nav-button:hover,
.nav-link:hover {
    background: #f5f5f5;
    border-color: var(--text-light);
    text-decoration: none;
}

.nav-button i,
.nav-link i {
    margin: 0 5px;
}

/* セクション間ナビゲーション */
.section-navigation {
    margin-bottom: 40px;
    padding: 20px;
    background: var(--light-blue);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-blue);
}

.section-navigation h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--primary-blue);
    border: none;
    padding: 0;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nav-links .nav-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid var(--primary-blue);
    font-size: 14px;
}

.nav-links .nav-link:hover {
    background: var(--dark-blue);
    border-color: var(--dark-blue);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.navigation-links {
    text-align: center;
    margin: 40px 0;
}

.next-topic {
    display: inline-block;
    padding: 20px 40px;
    background: var(--primary-gradient);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-large);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    transition: all var(--transition-bounce);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    border: 2px solid transparent;
}

.next-topic::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left var(--transition-slow);
}

.next-topic::after {
    content: '→';
    margin-left: 10px;
    display: inline-block;
    transition: transform var(--transition-base);
}

.next-topic:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-heavy), 0 0 25px rgba(102, 126, 234, 0.5);
    text-decoration: none;
    border-color: rgba(255,255,255,0.3);
}

.next-topic:hover::before {
    left: 100%;
}

.next-topic:hover::after {
    transform: translateX(5px);
}

.next-topic:active {
    transform: translateY(-2px) scale(1.02);
}

/* ===== Steps & Process ===== */
.step,
.flow-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.step-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    margin: 40px 0;
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-base);
}

.step-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.step-header h3 {
    margin: 0;
    margin-left: 20px;
    font-size: 20px;
    color: var(--primary-blue);
}

.step-number {
    background: var(--primary-gradient);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 18px;
    box-shadow: var(--shadow-medium);
}

.step-content {
    flex: 1;
}

.step-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

/* ===== Lists - Enhanced ===== */
.step-list {
    margin: 20px 0;
    padding-left: 0;
    list-style: none;
    counter-reset: step-counter;
}

.step-list li {
    counter-increment: step-counter;
    margin-bottom: 15px;
    padding-left: 45px;
    position: relative;
    line-height: 1.8;
    font-size: 16px;
}

.step-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary-blue);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.setting-list,
.verification-list {
    margin: 20px 0;
    padding-left: 0;
    list-style: none;
}

.setting-list li,
.verification-list li {
    margin-bottom: 12px;
    padding-left: 30px;
    position: relative;
    line-height: 1.8;
    font-size: 16px;
}

.setting-list li::before {
    content: '⚙️';
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 16px;
}

.verification-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 2px;
    background: var(--success-green);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

/* ===== Workflow & Process Visualization ===== */
.workflow-diagram {
    background: var(--glass-bg);
    border: 2px solid var(--border-blue);
    border-radius: var(--border-radius);
    padding: 40px 30px;
    margin: 40px 0;
    text-align: center;
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-medium);
}

.workflow-step {
    display: inline-block;
    background: var(--background-white);
    border: 2px solid var(--primary-blue);
    border-radius: var(--border-radius);
    padding: 20px 25px;
    margin: 10px;
    min-width: 150px;
    vertical-align: middle;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-light);
}

.workflow-step:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--bright-blue);
}

.workflow-step i {
    font-size: 24px;
    color: var(--primary-blue);
    margin-bottom: 10px;
    display: block;
}

.workflow-arrow {
    color: var(--primary-blue);
    font-size: 24px;
    font-weight: bold;
    margin: 0 15px;
    vertical-align: middle;
    display: inline-block;
}

/* ===== Integration & Extension Components ===== */
.integration-feature {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 25px 0;
    position: relative;
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-base);
}

.integration-feature:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.feature-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--primary-gradient);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: var(--shadow-medium);
}

.extension-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.extension-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-blue);
    border-radius: var(--border-radius);
    padding: 25px;
    transition: all var(--transition-base);
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-medium);
}

.extension-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--bright-blue);
}

.extension-icon {
    font-size: 36px;
    color: var(--primary-blue);
    margin-bottom: 15px;
    display: block;
}

.extension-card h4 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-size: 18px;
}

.extension-card small {
    background: var(--light-blue);
    border: 1px solid var(--border-blue);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: var(--font-code);
    font-size: 12px;
    display: block;
    margin-top: 10px;
}

/* ===== Configuration & Code Display ===== */
.config-example {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 25px 0;
    overflow-x: auto;
    font-family: var(--font-code);
    font-size: 14px;
    line-height: 1.6;
    box-shadow: var(--shadow-medium);
}

.json-key {
    color: #9cdcfe;
}

.json-string {
    color: #ce9178;
}

.json-comment {
    color: #6a9955;
    font-style: italic;
}

.command-palette {
    background: var(--warning-bg);
    border: 1px solid var(--warning-yellow);
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 25px 0;
    backdrop-filter: var(--backdrop-blur);
}

.command-palette h3 {
    color: var(--warning-yellow);
    margin-bottom: 15px;
}

keyboard-shortcut {
    display: inline-block;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: var(--font-code);
    font-size: 12px;
    margin: 0 2px;
    color: white;
}

/* ===== Terminal & Demo Components ===== */
.demo-terminal {
    background: #1e1e1e;
    color: #cccccc;
    border-radius: var(--border-radius);
    margin: 25px 0;
    font-family: var(--font-code);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
}

.terminal-header {
    background: #2d2d2d;
    padding: 12px 20px;
    border-bottom: 1px solid #3e3e3e;
    font-size: 12px;
    color: #999;
}

.terminal-content {
    padding: 20px;
}

.terminal-prompt {
    color: #6a9955;
    font-weight: bold;
}

.terminal-command {
    color: #9cdcfe;
}

.terminal-output {
    color: #d4d4d4;
    margin-left: 20px;
    margin-top: 10px;
}

/* ===== Status & Sync Components ===== */
.sync-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    margin: 5px;
    font-weight: 500;
    transition: all var(--transition-base);
}

.sync-active {
    background: var(--success-bg);
    color: var(--success-green);
    border: 1px solid var(--success-green);
}

.sync-inactive {
    background: var(--error-bg);
    color: var(--error-red);
    border: 1px solid var(--error-red);
}

.tips-box {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 2px solid var(--warning-yellow);
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 30px 0;
    backdrop-filter: var(--backdrop-blur);
}

.tips-box h3 {
    color: var(--warning-yellow);
    margin-bottom: 15px;
}

/* ===== Special Introduction Sections ===== */
.vscode-intro {
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.1) 0%, rgba(0, 122, 204, 0.2) 100%);
    border: 1px solid rgba(0, 122, 204, 0.3);
    border-radius: var(--border-radius-large);
    padding: 40px;
    margin: 40px 0;
    text-align: center;
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-medium);
}

.vscode-logo {
    font-size: 64px;
    color: #007ACC;
    margin-bottom: 20px;
    filter: brightness(1.3);
}

.vscode-intro h2 {
    color: #007ACC;
    margin-bottom: 15px;
    font-size: 24px;
}

.vscode-intro p {
    font-size: 16px;
    margin-bottom: 0;
    opacity: 0.9;
}

/* ===== Tables - Simple ===== */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: #ffffff;
}

.comparison-table th,
.comparison-table td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
}

.comparison-table th {
    background: #fafafa;
    color: #333333;
    font-weight: bold;
    font-size: 14px;
}

/* ===== Content Structure ===== */
.article-content {
    max-width: 800px;
    margin: 0 auto;
}

.article-content h2 {
    font-size: 22px;
    margin: 35px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    line-height: 1.6;
}

.article-content h3 {
    font-size: 19px;
    margin: 30px 0 15px;
    line-height: 1.6;
}

.article-content h4 {
    font-size: 17px;
    margin: 25px 0 12px;
    font-weight: bold;
    line-height: 1.6;
}

.article-content p {
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 16px;
}

/* ===== Table of Contents ===== */
.table-of-contents {
    background: #f5f5f5;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
}

.table-of-contents h2 {
    font-size: 18px;
    margin-bottom: 10px;
    border: none;
    padding: 0;
}

.table-of-contents ol {
    margin-left: 20px;
}

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

/* ===== Summary & Special Sections ===== */
.summary-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 40px;
}

.summary-section h2 {
    color: var(--primary-blue);
    margin-bottom: 15px;
}

/* ===== Icon Handling ===== */
.fas, .far, .fab {
    margin-right: 5px;
    font-size: inherit;
    vertical-align: middle;
}

/* 見出し内のアイコンは非表示 */
h1 i, h2 i, h3 i, h4 i, h5 i, h6 i {
    display: none;
}

/* summary-item内のアイコン調整 */
.summary-item > i:first-child {
    display: block;
    font-size: 24px;
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-blue);
}

/* ===== External Links ===== */
.link-note {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0.5em 0;
    padding: 0.5em;
    background-color: #f8f9fa;
    border-left: 3px solid #007bff;
    border-radius: 3px;
}

.link-note strong {
    color: var(--error-red);
}

.warning-note {
    font-size: 0.85em;
    color: #856404;
    margin: 0.5em 0;
    padding: 0.5em;
    background-color: #fff3cd;
    border-left: 3px solid var(--warning-yellow);
    border-radius: 3px;
}

.warning-note strong {
    color: var(--error-red);
}

.info-note {
    font-size: 0.85em;
    color: #0c5460;
    margin: 0.5em 0;
    padding: 0.5em;
    background-color: #d1ecf1;
    border-left: 3px solid #17a2b8;
    border-radius: 3px;
}

.external-link i.fas {
    font-size: 0.8em;
    margin-left: 0.3em;
    color: #6c757d;
}

.external-link:hover i.fas {
    color: #007bff;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .category-grid,
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .article-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-button {
        justify-content: center;
        width: 100%;
    }
    
    .nav-links {
        flex-direction: column;
    }
    
    .nav-links .nav-link {
        text-align: center;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-bottom: 10px;
        margin-right: 0;
    }
}

/* ===== Print Styles ===== */
@media print {
    .nav-button,
    .nav-link,
    .section-navigation,
    .navigation-links {
        display: none;
    }
    
    .content-section {
        box-shadow: none;
        border: 1px solid var(--border-light);
    }
}

/* ===== 検索機能 ===== */

/* 検索ボックス */
.search-box {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #ddd;
    position: relative;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    background: #fff;
}

.search-input {
    flex: 1;
    border: none;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: #999;
}

.search-clear {
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    font-size: 1rem;
    line-height: 1;
}

.search-clear:hover {
    color: #333;
}

.search-controls {
    display: none;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0.4rem;
    gap: 0.3rem;
}

.search-counter {
    font-size: 0.75rem;
    color: #666;
    margin-right: auto;
}

.search-prev,
.search-next {
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1;
}

.search-prev:hover,
.search-next:hover {
    background: #f0f0f0;
}

/* 検索ハイライト */
.search-highlight {
    background-color: #ffeb3b;
    color: #000;
    padding: 0 1px;
}

.search-highlight-current {
    background-color: #ff9800;
    color: #000;
}

/* 全章検索結果ドロップダウン */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
}

.search-result-item {
    display: block;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
}

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

.search-result-item:hover,
.search-result-item.selected {
    background-color: #f5f5f5;
}

.search-result-chapter {
    display: inline-block;
    background: #667eea;
    color: #fff;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    border-radius: 2px;
    margin-right: 0.5rem;
}

.search-result-title {
    color: #333;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
}

.search-snippet {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.3rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-snippet mark {
    background-color: #ffeb3b;
    color: #000;
    padding: 0 2px;
}
