/*
 * SparkSheets Documentation CSS
 * Version: 2.0.0 - Bootstrap-based redesign
 * CSS変数で管理された統一デザインシステム
 */

/* ========== Global Reset ========== */
/* すべての要素でbox-sizing: border-boxを適用 */
/* これにより width: 100% でもpadding/borderを含めた幅になり、はみ出さない */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ========== CSS Variables ========== */
:root {
    /* === Colors === */
    --docs-bg: #f5f7fa;
    --docs-bg-secondary: #ffffff;
    --docs-text: #333333;
    --docs-text-muted: #8e8e93;
    --docs-border: #e5e5e7;
    --docs-primary: #000000;
    --docs-sidebar-bg: #ffffff;
    --docs-code-bg: #f7f8fa;
    --docs-footer-bg: #2c2c34;
    --docs-footer-text: #ffffff;
    --docs-footer-text-muted: rgba(255, 255, 255, 0.7);

    /* === Legacy Aliases (for sections/plans.php, contact.php) === */
    --text-muted-color: #8e8e93;
    --secondary-bg: #f5f7fa;
    --border-color: #e5e5e7;

    /* === Layout Dimensions === */
    --docs-content-max-width: 1100px;
    --docs-sidebar-width: 25%; /* col-md-3 */
    --docs-main-width: 75%; /* col-md-9 */
    --docs-gap: 2rem;

    /* === Spacing === */
    --docs-padding-xs: 0.5rem;
    --docs-padding-sm: 1rem;
    --docs-padding-md: 1.5rem;
    --docs-padding-lg: 2rem;
    --docs-padding-xl: 3rem;
    --docs-margin-sm: 0.5rem;
    --docs-margin-md: 1rem;
    --docs-margin-lg: 2rem;
    --docs-margin-xl: 3rem;

    /* === Border Radius === */
    --docs-radius-sm: 4px;
    --docs-radius-md: 6px;
    --docs-radius-lg: 12px;

    /* === Shadows === */
    --docs-shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.04);
    --docs-shadow-md: 0 2px 10px rgba(0, 0, 0, 0.1);

    /* === Typography === */
    --docs-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Sans", Arial, sans-serif;
    --docs-font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
    --docs-font-size: 17px;
    --docs-line-height: 1.7;
    --docs-font-size-h1: 1.75rem;
    --docs-font-size-h2: 1.5rem;
    --docs-font-size-h3: 1.25rem;
    --docs-font-size-sm: 0.9rem;
    --docs-font-size-xs: 0.8rem;

    /* === Transitions === */
    --docs-transition: all 0.2s ease;
    --docs-transition-slow: all 0.3s ease;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --docs-bg: #1a1a1e;
        --docs-bg-secondary: #2c2c34;
        --docs-text: #ffffff;
        --docs-text-muted: #8e8e93;
        --docs-border: #38383d;
        --docs-primary: #ffffff;
        --docs-sidebar-bg: #2c2c34;
        --docs-code-bg: #1c1c23;
        --docs-footer-bg: #1c1c1e;
        --docs-footer-text: #ffffff;
        --docs-footer-text-muted: rgba(255, 255, 255, 0.7);
    }
}

body.dark-mode {
    --docs-bg: #1a1a1e;
    --docs-bg-secondary: #2c2c34;
    --docs-text: #ffffff;
    --docs-text-muted: #8e8e93;
    --docs-border: #38383d;
    --docs-primary: #ffffff;
    --docs-sidebar-bg: #2c2c34;
    --docs-code-bg: #1c1c23;
    --docs-footer-bg: #1c1c1e;
    --docs-footer-text: #ffffff;
    --docs-footer-text-muted: rgba(255, 255, 255, 0.7);

    /* Legacy Aliases - Dark Mode */
    --text-muted-color: #8e8e93;
    --secondary-bg: #2c2c34;
    --border-color: #38383d;
    --primary-color: #ffffff;

    /* Force apply dark mode styles */
    background: #1a1a1e !important;
    color: #ffffff !important;
}

body.dark-mode .docs-sidebar {
    background: #2c2c34 !important;
    border-color: #38383d !important;
}

body.dark-mode .docs-footer {
    background: #1c1c1e !important;
    color: #ffffff !important;
}

body.dark-mode .breadcrumb {
    background: #2c2c34 !important;
    border-color: #38383d !important;
}

body.dark-mode .content-card {
    background: #2c2c34 !important;
    border-color: #38383d !important;
    color: #ffffff !important;
}

/* ========== Base Styles ========== */
body {
    font-family: var(--docs-font-family);
    font-size: var(--docs-font-size);
    line-height: var(--docs-line-height);
    color: var(--docs-text);
    background: var(--docs-bg);
}

/* ========== Bootstrap Grid Override (Docs pages only) ========== */
body:not(.marketplace-page) .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: 0;
    margin-left: 0;
    gap: var(--docs-gap);
}

/* デスクトップでサイドバーを25%、メインを75%に */
@media (min-width: 768px) {
    body:not(.marketplace-page) .col-md-3 {
        flex: 0 0 auto;
        width: calc(var(--docs-sidebar-width) - 1rem);
    }
    body:not(.marketplace-page) .col-md-9 {
        flex: 0 0 auto;
        width: calc(var(--docs-main-width) - 1rem);
    }
}

/* モバイルでは100%幅 */
@media (max-width: 767px) {
    body:not(.marketplace-page) .col-md-3,
    body:not(.marketplace-page) .col-md-9 {
        width: 100%;
    }
}

/* ========== Sidebar ========== */
.docs-sidebar {
    background: var(--docs-sidebar-bg);
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius-md);
    box-shadow: var(--docs-shadow-sm);
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

/* ロゴエリア */
.docs-logo {
    padding: var(--docs-padding-md) var(--docs-padding-lg);
    border-bottom: 1px solid var(--docs-border);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--docs-text);
    text-decoration: none;
    display: block;
}

.docs-logo:hover {
    color: var(--docs-primary);
}

/* ナビゲーションエリア */
.docs-nav {
    padding: var(--docs-padding-md) 0 0;
}

/* セクションタイトル */
.docs-nav-section-title {
    padding: 0 var(--docs-padding-lg);
    margin-bottom: var(--docs-margin-sm);
    font-size: var(--docs-font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--docs-text-muted);
    opacity: 0.8;
}

/* リストグループのカスタマイズ */
.list-group,
.list-group-flush {
    margin-bottom: var(--docs-margin-md);
    list-style: none;
    padding-left: 0;
    margin-top: 0px;
}

.list-group li,
.list-group-flush li {
    list-style: none;
}

.list-group li::marker,
.list-group-flush li::marker {
    content: none;
    display: none;
}

.docs-nav-item {
    background-color: transparent;
    color: var(--docs-text);
    border: none;
    padding: 0.25rem var(--docs-padding-lg);
    margin: 0 var(--docs-margin-sm) 0.15rem var(--docs-margin-sm);
    font-size: 0.8rem;
    transition: var(--docs-transition);
    display: flex;
    align-items: center;
    gap: var(--docs-padding-xs);
    text-decoration: none;
    border-radius: 6px;
    list-style: none;
}

.docs-nav-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--docs-primary);
}

.docs-nav-item.active {
    background-color: rgba(0, 0, 0, 0.06);
    color: var(--docs-primary);
    font-weight: 600;
}

.docs-nav-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.docs-nav-item:hover svg,
.docs-nav-item.active svg {
    opacity: 1;
}

/* ソーシャルリンク */
.sidebar-social {
    padding: var(--docs-margin-sm);
    border-top: 1px solid var(--docs-border);
    display: flex;
    gap: var(--docs-padding-xs);
    justify-content: center;
}

.sidebar-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--docs-radius-lg);
    background: var(--docs-bg);
    color: var(--docs-text-muted);
    transition: var(--docs-transition-slow);
}

.sidebar-social a:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--docs-primary);
    transform: translateY(-2px);
}

/* ========== Main Content ========== */
.docs-content {
    max-width: var(--docs-content-max-width);
    margin: 0 auto;
    padding: 2rem 0;
}

.content-card {
    background: var(--docs-bg-secondary);
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius-md);
    padding: var(--docs-padding-xl);
    box-shadow: var(--docs-shadow-sm);
    margin-bottom: 1.5rem;
}

/* ========== Breadcrumb ========== */
.breadcrumb {
    background: var(--docs-bg-secondary);
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius-md);
    padding: 0.875rem var(--docs-padding-md);
    margin-bottom: var(--docs-margin-lg);
    box-shadow: var(--docs-shadow-sm);
}

.breadcrumb ol {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: var(--docs-font-size-sm);
}

.breadcrumb li {
    color: var(--docs-text-muted);
}

.breadcrumb li::after {
    content: "/";
    margin: 0 var(--docs-padding-xs);
    color: var(--docs-border);
}

.breadcrumb li:last-child::after {
    content: "";
}

.breadcrumb a {
    color: var(--docs-text-muted);
    text-decoration: none;
    transition: var(--docs-transition);
}

.breadcrumb a:hover {
    color: var(--docs-primary);
}

/* ========== Footer ========== */
.docs-footer {
    max-width: var(--docs-content-max-width);
    margin: 40px auto var(--docs-margin-lg);
    background: var(--docs-footer-bg);
    border-radius: var(--docs-radius-md);
    padding: 3rem 0;
    color: var(--docs-footer-text);
    box-shadow: var(--docs-shadow-sm);
}

.docs-footer-inner {
    padding: 0 var(--docs-padding-xl);
    display: grid;
    grid-template-columns: 1.8fr 1fr .7fr 1fr 1.2fr;
    gap: var(--docs-padding-xl);
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--docs-margin-sm);
    color: var(--docs-footer-text);
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: var(--docs-padding-xs);
    font-size: .8rem;
    line-height: 1.5rem;
}

.footer-section a {
    color: var(--docs-footer-text-muted);
    text-decoration: none;
    transition: var(--docs-transition-slow);
}

.footer-section a:hover {
    color: var(--docs-footer-text);
}

.copyright {
    margin: 10px 0;
    color: var(--docs-footer-text-muted);
    opacity: 0.7;
    font-size: 0.875rem;
}

.sparksheets-logo--footer-docs {
    font-size: var(--docs-font-size-h1);
    font-weight: 700;
    margin-bottom: var(--docs-margin-sm);
}

.sparksheets-logo-spark {
    color: var(--docs-footer-text);
}

.sparksheets-logo-sheets {
    color: var(--docs-footer-text-muted);
}

/* ========== Mobile Menu Toggle ========== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: var(--docs-margin-sm);
    left: var(--docs-margin-sm);
    z-index: 1001;
    width: 40px;
    height: 40px;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius-sm);
    background: var(--docs-bg);
    color: var(--docs-text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-menu-toggle:hover {
    background: var(--docs-bg-secondary);
}

/* ========== Dark Mode Toggle ========== */
.dark-mode-toggle {
    position: fixed;
    top: var(--docs-margin-sm);
    right: var(--docs-margin-sm);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--docs-bg);
    border: 1px solid var(--docs-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    box-shadow: var(--docs-shadow-sm);
}

.dark-mode-toggle:hover {
    background: var(--docs-bg-secondary);
    transform: scale(1.05);
}

.dark-mode-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--docs-text);
}

/* ========== Typography ========== */
.content-card h1 {
    font-size: var(--docs-font-size-h1);
    font-weight: 700;
    margin-top: 0px;
    margin-bottom: var(--docs-margin-md);
    color: var(--docs-text);
}

.content-card h2 {
    font-size: var(--docs-font-size-h2);
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: var(--docs-margin-md);
    color: var(--docs-text);
}

.content-card h3 {
    font-size: var(--docs-font-size-h3);
    font-weight: 600;
    margin-top: var(--docs-margin-lg);
    margin-bottom: var(--docs-margin-sm);
    color: var(--docs-text);
}

.content-card p {
    margin-bottom: var(--docs-margin-md);
}

.content-card ul,
.content-card ol {
    margin-bottom: var(--docs-margin-md);
    padding-left: 0;
    list-style: inside;
}

.content-card li {
    margin-bottom: 0.5rem;
}

.content-card code {
    background: var(--docs-code-bg);
    padding: 0.2em 0.4em;
    border-radius: var(--docs-radius-sm);
    font-family: var(--docs-font-mono);
    font-size: 0.9em;
}

.content-card pre {
    background: var(--docs-code-bg);
    padding: var(--docs-padding-md);
    border-radius: var(--docs-radius-md);
    overflow-x: auto;
    margin-bottom: var(--docs-margin-md);
}

.content-card pre code {
    background: none;
    padding: 0;
}

/* ========== Tables ========== */
.content-card table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--docs-margin-lg) 0;
}

.content-card table th,
.content-card table td {
    border: 1px solid var(--docs-border);
    padding: 0.75rem;
    text-align: left;
}

.content-card table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

/* ========== Alert Boxes ========== */
.alert {
    padding: var(--docs-padding-md);
    border-radius: var(--docs-radius-md);
    margin-bottom: var(--docs-margin-md);
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-left-color: #10b981;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-left-color: #ef4444;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-left-color: #3b82f6;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-left-color: #f59e0b;
}

.alert h3 {
    margin-top: 0;
    margin-bottom: var(--docs-margin-sm);
}

/* Dark mode alert overrides */
body.dark-mode .alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

body.dark-mode .alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

body.dark-mode .alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

body.dark-mode .alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* ========== Responsive Design ========== */
@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .breadcrumb {
        margin: 0 var(--docs-margin-sm) var(--docs-margin-sm);
        padding: 0.75rem var(--docs-padding-md);
    }

    .docs-content {
        padding: 0 var(--docs-margin-sm);
    }

    .content-card {
        padding: var(--docs-padding-md);
    }

    .docs-footer {
        margin: var(--docs-padding-xl) var(--docs-margin-sm) var(--docs-margin-sm);
        padding: var(--docs-padding-lg) 0;
    }

    .docs-footer-inner {
        padding: 0 var(--docs-padding-md);
        grid-template-columns: 1fr;
        gap: var(--docs-margin-lg);
    }

    .docs-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .docs-sidebar.open {
        left: 0;
        box-shadow: var(--docs-shadow-md);
    }
}

@media (max-width: 768px) {
    .docs-footer-inner {
        grid-template-columns: 1fr;
        gap: var(--docs-margin-lg);
    }
}

/* ========== Plans Page Styles ========== */
.plans-section {
    margin-top: var(--docs-margin-lg);
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--docs-margin-lg);
    margin-top: var(--docs-margin-lg);
}

.plan-card {
    background: var(--docs-bg-secondary);
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius-lg);
    padding: var(--docs-padding-xl);
    position: relative;
    transition: var(--docs-transition);
}

.plan-card:hover {
    box-shadow: var(--docs-shadow-md);
    transform: translateY(-4px);
}

.plan-card.featured {
    border: 2px solid var(--docs-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.plan-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--docs-primary);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--docs-margin-sm);
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--docs-primary);
    margin-bottom: var(--docs-margin-md);
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: var(--docs-margin-lg) 0;
}

.plan-features li {
    padding: var(--docs-padding-sm) 0;
    display: flex;
    align-items: center;
    gap: var(--docs-padding-sm);
}

.plan-features .check {
    color: #4caf50;
    font-weight: bold;
    font-size: 1.2rem;
}

.plan-features .cross {
    color: #999;
    font-weight: bold;
    font-size: 1.2rem;
}

.plan-button {
    width: 100%;
    padding: var(--docs-padding-md) var(--docs-padding-lg);
    border: none;
    border-radius: var(--docs-radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--docs-transition);
    box-sizing: border-box;
}

/* Link buttons should auto-size */
a.plan-button {
    display: inline-block;
    width: auto;
    text-decoration: none;
}

.plan-button.primary {
    background: var(--docs-primary);
    color: #ffffff;
}

.plan-button.primary:hover {
    background: #333;
}

.plan-button.secondary {
    background: var(--docs-bg);
    color: var(--docs-text);
    border: 1px solid var(--docs-border);
}

.plan-button.secondary:hover {
    background: #e0e0e0;
}

.plan-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== Contact Page Styles ========== */
.contact-section {
    margin-top: var(--docs-margin-lg);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

/* Contact Info Cards */
.contact-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--docs-border);
}

.info-card {
    background: var(--docs-bg-secondary);
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius-lg);
    padding: 2rem;
}

.info-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: var(--docs-text);
    letter-spacing: -0.01em;
}

.info-card-text {
    color: var(--docs-text-muted);
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.info-card-link {
    display: inline-block;
    color: var(--docs-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--docs-transition);
    position: relative;
}

.info-card-link::after {
    content: '→';
    margin-left: 0.5rem;
    transition: var(--docs-transition);
}

.info-card-link:hover::after {
    margin-left: 0.75rem;
}

.info-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card-list li {
    padding: 0.5rem 0;
    color: var(--docs-text-muted);
    border-bottom: 1px solid var(--docs-border);
}

.info-card-list li:last-child {
    border-bottom: none;
}

.form-group {
    margin-bottom: var(--docs-margin-lg);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--docs-margin-sm);
    color: var(--docs-text);
}

.form-group input,
.form-group select,
.form-group textarea,
.form-select,
.form-input {
    width: 100%;
    padding: var(--docs-padding-sm);
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--docs-transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--docs-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Ensure select width matches other inputs */
select.form-select {
    width: 100%;
    padding-right: 2.5rem; /* 矢印のためのスペース確保 */
    appearance: none; /* ブラウザデフォルトの矢印を削除 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpolyline fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' points='2,4 6,8 10,4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center; /* 右から1remの位置 */
    background-size: 12px;
}

.submit-button,
.form-submit {
    background: var(--docs-primary);
    color: #ffffff;
    border: none;
    padding: var(--docs-padding-md) var(--docs-padding-xl);
    border-radius: var(--docs-radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--docs-transition);
    width: 100%;
}

.submit-button:hover,
.form-submit:hover {
    background: #333;
}

/* ========== Dark Mode - Additional Page Elements ========== */

/* Plans Page */
body.dark-mode .plan-card {
    background: #2c2c34 !important;
    border-color: #38383d !important;
    color: #ffffff !important;
}

body.dark-mode .plan-name,
body.dark-mode .plan-price,
body.dark-mode .plan-features li {
    color: #ffffff !important;
}

body.dark-mode .plan-button.primary {
    background: #ffffff !important;
    color: #000000 !important;
}

body.dark-mode .plan-button.secondary {
    background: transparent !important;
    border-color: #38383d !important;
    color: #ffffff !important;
}

body.dark-mode .plan-badge {
    background: #FFD700 !important;
    color: #000000 !important;
}

body.dark-mode .check {
    color: #10b981 !important;
}

body.dark-mode .cross {
    color: #ef4444 !important;
}

/* Affiliate Page */
body.dark-mode .affiliate-section h3,
body.dark-mode .affiliate-section h4 {
    color: #ffffff !important;
}

body.dark-mode .affiliate-section p,
body.dark-mode .affiliate-section li {
    color: #8e8e93 !important;
}

/* Contact Page */
body.dark-mode .contact-form .form-group label {
    color: #ffffff !important;
}

body.dark-mode .contact-form .form-input,
body.dark-mode .contact-form .form-select,
body.dark-mode .contact-form .form-textarea {
    background: #2c2c34 !important;
    border-color: #38383d !important;
    color: #ffffff !important;
}

/* ダークモードのセレクトボックス矢印を白に */
body.dark-mode select.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpolyline fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' points='2,4 6,8 10,4'/%3E%3C/svg%3E") !important;
}

body.dark-mode .contact-form .form-input::placeholder,
body.dark-mode .contact-form .form-textarea::placeholder {
    color: #8e8e93 !important;
}

body.dark-mode .form-submit {
    background: #ffffff !important;
    color: #000000 !important;
}

body.dark-mode .form-submit:hover {
    background: #e0e0e0 !important;
}

/* Contact Info Cards - Dark Mode */
body.dark-mode .info-card {
    background: #2c2c34 !important;
    border-color: #38383d !important;
}

body.dark-mode .info-card:hover {
    border-color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .info-card-title {
    color: #ffffff !important;
}

body.dark-mode .info-card-text {
    color: #8e8e93 !important;
}

body.dark-mode .info-card-link {
    color: #ffffff !important;
}

body.dark-mode .info-card-list li {
    color: #8e8e93 !important;
    border-color: #38383d !important;
}

/* Alert boxes */
body.dark-mode .alert-success {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #10b981 !important;
}

body.dark-mode .alert-error {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
}

body.dark-mode .alert-info {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #3b82f6 !important;
}

/* ========== Sidebar Toggle Functionality ========== */

/* Toggle button styles */
.docs-nav-section-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--docs-text-muted);
    transition: var(--docs-transition);
    flex-shrink: 0;
}

.docs-nav-section-toggle:hover {
    color: var(--docs-primary);
}

.docs-nav-section-toggle svg {
    transition: transform 0.2s ease;
}

.docs-nav-section-toggle.collapsed svg {
    transform: rotate(-90deg);
}

/* Content wrapper for smooth collapse */
.docs-nav-section-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 1000px;
    opacity: 1;
}

.docs-nav-section-content.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Dark mode overrides */
body.dark-mode .docs-nav-section-toggle {
    color: var(--docs-text-muted);
}

body.dark-mode .docs-nav-section-toggle:hover {
    color: var(--docs-primary);
}

/* ========== Footer Styles (統合: 旧 footer.css より) ========== */
/* Footer styles - shared across all pages */
.docs-footer {
    background: #1a1a2e;
    color: #fff;
    padding: 60px 0 40px;
    margin-top: 60px;
}

.docs-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 40px;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #fff;
}

.sparksheets-logo--footer-docs {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.sparksheets-logo-spark {
    color: #667eea;
}

.sparksheets-logo-sheets {
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .docs-footer {
        padding: 40px 0 30px;
    }

    .docs-footer-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .docs-footer-inner {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}
