/* style.css */
:root {
    --primary-color: #226e93; /* 元のGoogleサイトのメインカラーに近いブルー */
    --text-color: #333333;
    --bg-color: #f9f9f9;
    --white: #ffffff;
    --border-color: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

/* ヘッダー・ナビゲーション */
header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* メインコンテンツ */
main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin: 2.5rem 0 1rem;
}

h3 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.2rem;
}

p {
    margin-bottom: 1rem;
}

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

.lead-text {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 2rem;
}

/* フッター */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 1rem;
}

footer a:hover {
    text-decoration: underline;
}

/* レスポンシブ対応 (スマートフォン向け) */
@media (max-width: 600px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    main {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* ダウンロードボタン */
.download-section {
    text-align: center;
    margin: 2.5rem 0;
}

.btn-download {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.btn-download:hover {
    background-color: #1a526f; /* メインカラーより少し暗めの色 */
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* CSVインポート説明用 */
.note-box {
    background-color: #fff8e6;
    border-left: 4px solid #e0a800;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.95rem;
}

.code-block {
    background-color: #f4f4f4;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    font-family: 'Menlo', 'Consolas', 'SFMono-Regular', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    white-space: pre;
}

code {
    font-family: 'Menlo', 'Consolas', 'SFMono-Regular', monospace;
    background-color: #f0f0f0;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

table.type-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

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

table.type-table th {
    color: var(--primary-color);
}

.btn-secondary-download {
    display: inline-block;
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.7rem 1.8rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-secondary-download:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

@media (max-width: 600px) {
    table.type-table {
        font-size: 0.85rem;
    }
    table.type-table th,
    table.type-table td {
        padding: 0.5rem 0.4rem;
    }
}

/* CSVエディターページ用 */
.editor-section {
    margin-bottom: 2.5rem;
}

.editor-section h2 {
    margin: 0 0 1rem;
}

.text-input,
.select-input {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    background-color: var(--white);
    width: 100%;
}

.text-input:focus,
.select-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.hint {
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.token-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.7rem;
}

.btn-token {
    font-family: 'Menlo', 'Consolas', 'SFMono-Regular', monospace;
    font-size: 0.85rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 0.35rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-token:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.editor-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.2rem;
}

.editor-table th {
    text-align: left;
    padding: 0.5rem 0.6rem;
    color: var(--primary-color);
    font-size: 0.9rem;
    border-bottom: 2px solid var(--border-color);
}

.editor-table td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.editor-table td.col-name { width: 25%; }
.editor-table td.col-type { width: 20%; }
.editor-table td.col-content { width: 45%; }
.editor-table td.col-action { width: 10%; text-align: center; }
.editor-table th.col-position,
.editor-table td.col-position { width: 6%; text-align: center; color: #999; font-variant-numeric: tabular-nums; }
.editor-table th.col-apply,
.editor-table td.col-apply { width: 8%; text-align: center; }
.editor-table td.col-apply input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; }

.partial-only { display: none; }
.editor-table.mode-partial .partial-only { display: table-cell; }

.mode-selector {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.mode-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.mode-option input[type="radio"] {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.content-hint {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.3rem;
}

.row-delete-btn {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
}

.row-delete-btn:hover {
    color: #e74c3c;
}

.btn-add-row {
    display: inline-block;
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px dashed var(--primary-color);
    padding: 0.6rem 1.5rem;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-row:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-add-row:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.warning-box {
    background-color: #fdecea;
    border-left: 4px solid #c0392b;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #922b21;
}

.success-msg {
    text-align: center;
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 0.8rem;
    min-height: 1.4em;
}

.editor-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0 0.5rem;
}

.editor-actions button {
    cursor: pointer;
    font-family: inherit;
}

@media (max-width: 700px) {
    .editor-table, .editor-table thead, .editor-table tbody, .editor-table th, .editor-table td, .editor-table tr {
        display: block;
    }
    .editor-table thead {
        display: none;
    }
    .editor-table tr {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 1rem;
        padding: 0.8rem;
    }
    .editor-table td {
        border-bottom: none;
        padding: 0.4rem 0;
        width: auto !important;
    }
    .editor-table td.col-name::before { content: "項目名"; font-weight: bold; color: var(--primary-color); display: block; font-size: 0.8rem; margin-bottom: 0.2rem; }
    .editor-table td.col-type::before { content: "タイプ"; font-weight: bold; color: var(--primary-color); display: block; font-size: 0.8rem; margin-bottom: 0.2rem; }
    .editor-table td.col-content::before { content: "内容"; font-weight: bold; color: var(--primary-color); display: block; font-size: 0.8rem; margin-bottom: 0.2rem; }
    .editor-table td.col-position::before { content: "位置"; font-weight: bold; color: var(--primary-color); display: block; font-size: 0.8rem; margin-bottom: 0.2rem; }
    .editor-table td.col-apply::before { content: "上書き"; font-weight: bold; color: var(--primary-color); display: block; font-size: 0.8rem; margin-bottom: 0.2rem; }
    .editor-table td.col-position, .editor-table td.col-apply { text-align: left; }
}
/* CSV読み込みエリア */
.csv-load-section {
    margin-bottom: 2rem;
}

.drop-zone {
    border: 2px dashed var(--primary-color);
    border-radius: 10px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-color);
    position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
    background-color: #e8f4fa;
    border-color: #1a526f;
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.drop-zone-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.drop-zone-text {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: bold;
}

.drop-zone-sub {
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.3rem;
}

/* 確認ダイアログ（モーダル） */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--white);
    border-radius: 12px;
    padding: 1.8rem;
    max-width: 480px;
    width: calc(100% - 2rem);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.modal-box h3 {
    margin: 0 0 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.modal-summary {
    background: var(--bg-color);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    line-height: 1.7;
}

.modal-summary .mode-badge {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    font-size: 0.8rem;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    margin-bottom: 0.6rem;
    font-weight: bold;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

.btn-modal-cancel {
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-modal-cancel:hover {
    background: var(--bg-color);
}

.btn-modal-ok {
    padding: 0.6rem 1.6rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-modal-ok:hover {
    background: #1a526f;
}
