/* 2画面HTML分割プレビューエディター CSS */
.split-editor-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
}

/* Header */
.editor-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    gap: 15px;
}

.header-right .status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #28a745;
}

/* Main Editor Area - 2 Columns */
.split-editor-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 700px;
}

/* Left Column: Original Markdown Section */
.original-markdown-section {
    background: #f8f9ff;
    border-right: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

/* Right Column: HTML Preview Section */
.html-preview-section {
    background: #fff;
    display: flex;
    flex-direction: column;
}

.section-header {
    background: #4a5568;
    color: white;
    padding: 15px 25px;
    border-bottom: 1px solid #e2e8f0;
}

.section-header h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: white;
}

.help-text {
    font-size: 0.85rem;
    opacity: 0.8;
}

.original-markdown-section .section-header {
    background: #2b6cb0;
}

.html-preview-section .section-header {
    background: #38a169;
}

.markdown-input-wrapper {
    flex: 1;
    padding: 0;
}

#originalMarkdown {
    width: 100%;
    height: 450px;
    border: none;
    padding: 25px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    background: #f8f9ff;
    color: #2d3748;
    box-sizing: border-box;
}

#originalMarkdown:focus {
    outline: none;
    background: #fff;
    box-shadow: inset 0 0 0 2px #667eea;
}

.auto-split-rules {
    background: #e8f4fd;
    border-top: 1px solid #0ea5e9;
    padding: 20px 25px;
}

.auto-split-rules h4 {
    margin: 0 0 10px 0;
    color: #0ea5e9;
    font-size: 1rem;
}

.auto-split-rules ul {
    margin: 0;
    padding-left: 20px;
}

.auto-split-rules li {
    margin-bottom: 5px;
    color: #0369a1;
    font-size: 0.9rem;
}

/* HTML Preview Container */
.html-preview-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 450px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.no-splits-message {
    text-align: center;
    color: #6c757d;
    padding: 50px 20px;
    font-style: italic;
}

/* Split Preview Sections */
.split-preview-section {
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.split-preview-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.split-preview-section.section-1 {
    border-color: #4facfe;
}

.split-preview-section.section-2 {
    border-color: #38a169;
}

.split-preview-section.section-3 {
    border-color: #ed8936;
}

.split-preview-section.section-4 {
    border-color: #ec4899;
}

/* Split Preview Header */
.split-preview-header {
    background: #e2e8f0;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #cbd5e0;
}

.split-preview-section.section-1 .split-preview-header {
    background: #4facfe;
    color: white;
}

.split-preview-section.section-2 .split-preview-header {
    background: #38a169;
    color: white;
}

.split-preview-section.section-3 .split-preview-header {
    background: #ed8936;
    color: white;
}

.split-preview-section.section-4 .split-preview-header {
    background: #ec4899;
    color: white;
}

.section-number {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.section-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    color: #4facfe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.split-preview-section.section-1 .section-badge {
    color: #4facfe;
}

.split-preview-section.section-2 .section-badge {
    color: #38a169;
}

.split-preview-section.section-3 .section-badge {
    color: #ed8936;
}

.split-preview-section.section-4 .section-badge {
    color: #ec4899;
}

.section-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.edit-section-btn,
.split-section-btn,
.delete-section-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-section-btn {
    background: #17a2b8;
    color: white;
}

.edit-section-btn:hover {
    background: #138496;
    transform: scale(1.1);
}

.split-section-btn {
    background: #ffc107;
    color: white;
}

.split-section-btn:hover {
    background: #e0a800;
    transform: scale(1.1);
}

.delete-section-btn {
    background: #dc3545;
    color: white;
}

.delete-section-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Split Preview Content */
.split-preview-content {
    padding: 0;
    background: white;
    position: relative;
}

/* Rendered Preview (HTML only) */
.rendered-preview-only {
    padding: 20px;
    background: white;
    min-height: 100px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.rendered-preview-only:hover {
    background: #f8f9fa;
}

/* Edit Overlay */
.edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.section-editor {
    flex: 1;
    width: 100%;
    border: none;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #2d3748;
    background: #f8f9ff;
    resize: none;
    box-sizing: border-box;
    min-height: 150px;
}

.section-editor:focus {
    outline: none;
    background: #fff;
    box-shadow: inset 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.edit-controls {
    padding: 10px 15px;
    background: #f1f3f5;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.save-edit-btn,
.cancel-edit-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-edit-btn {
    background: #28a745;
    color: white;
}

.save-edit-btn:hover {
    background: #218838;
}

.cancel-edit-btn {
    background: #6c757d;
    color: white;
}

.cancel-edit-btn:hover {
    background: #5a6268;
}

/* Split Preview Content */
.split-preview-content {
    padding: 0;
    background: white;
    display: flex;
    flex-direction: column;
}

/* Editable Section Content */
.editable-section-content {
    width: 100%;
    min-height: 120px;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #2d3748;
    background: #f8f9ff;
    resize: vertical;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.editable-section-content:focus {
    outline: none;
    background: #fff;
    box-shadow: inset 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.editable-section-content::placeholder {
    color: #a0aec0;
    font-style: italic;
}

/* Rendered Preview */
.rendered-preview {
    padding: 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    min-height: 100px;
}

/* WordPress Theme Override - 独自CSS */
.markdown-to-ppt-editor {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif !important;
    line-height: 1.6 !important;
}

.markdown-to-ppt-editor * {
    box-sizing: border-box !important;
}

/* リスト間スペースの統一 */
.direct-editable-area ul,
.direct-editable-area ol {
    margin: 0 0 15px 0 !important;
    padding: 0 0 0 20px !important;
    list-style-position: outside !important;
}

.direct-editable-area li {
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    color: #4a5568 !important;
}

.direct-editable-area li:last-child {
    margin-bottom: 0 !important;
}

/* ネストしたリストの調整 */
.direct-editable-area ul ul,
.direct-editable-area ol ol,
.direct-editable-area ul ol,
.direct-editable-area ol ul {
    margin: 5px 0 5px 0 !important;
    padding-left: 20px !important;
}

/* 段落間スペースの統一 */
.direct-editable-area p {
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    line-height: 1.6 !important;
    color: #4a5568 !important;
}

.direct-editable-area p:last-child {
    margin-bottom: 0 !important;
}

/* 見出し間スペースの統一 */
.direct-editable-area h1,
.direct-editable-area h2,
.direct-editable-area h3,
.direct-editable-area h4,
.direct-editable-area h5,
.direct-editable-area h6 {
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

.direct-editable-area h1 {
    font-size: 1.8rem !important;
    color: #2d3748 !important;
    border-bottom: 3px solid #4facfe !important;
    padding-bottom: 10px !important;
}

.direct-editable-area h2 {
    font-size: 1.4rem !important;
    color: #4a5568 !important;
}

.direct-editable-area h3 {
    font-size: 1.2rem !important;
    color: #718096 !important;
}

/* WordPress テーマリセット */
.direct-editable-area {
    padding: 20px !important;
    background: white !important;
    min-height: 100px !important;
    border: 2px solid transparent !important;
    outline: none !important;
    transition: all 0.3s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif !important;
    line-height: 1.6 !important;
    font-size: 14px !important;
    color: #2d3748 !important;
}

/* WordPressテーマの影響をリセット */
.direct-editable-area * {
    font-family: inherit !important;
    font-size: inherit !important;
}

.direct-editable-area strong,
.direct-editable-area b {
    font-weight: 600 !important;
    color: #2d3748 !important;
}

.direct-editable-area em,
.direct-editable-area i {
    font-style: italic !important;
    color: #718096 !important;
}

.direct-editable-area code {
    background: #f1f5f9 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 0.9em !important;
    color: #e53e3e !important;
    border: none !important;
    box-shadow: none !important;
}

.direct-editable-area blockquote {
    border-left: 4px solid #4facfe !important;
    padding-left: 16px !important;
    margin: 16px 0 !important;
    color: #4a5568 !important;
    font-style: italic !important;
    background: transparent !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
}

/* フォーカス時のスタイル */
.direct-editable-area:focus {
    border-color: #667eea !important;
    background: #f8f9ff !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1) !important;
}

.direct-editable-area:hover {
    background: #f8f9fa !important;
    border-color: #e2e8f0 !important;
}

/* プレースホルダー */
.direct-editable-area.empty::before {
    content: "ここで直接編集できます...";
    color: #a0aec0 !important;
    font-style: italic !important;
    pointer-events: none !important;
}

/* 2画面HTML分割プレビューエディター CSS */
.split-editor-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
}

/* Header */
.editor-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    gap: 15px;
}

.header-right .status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #28a745;
}

/* Main Editor Area - 2 Columns */
.split-editor-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 700px;
}

/* Left Column: Original Markdown Section */
.original-markdown-section {
    background: #f8f9ff;
    border-right: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

/* Right Column: HTML Preview Section */
.html-preview-section {
    background: #fff;
    display: flex;
    flex-direction: column;
}

.section-header {
    background: #4a5568;
    color: white;
    padding: 15px 25px;
    border-bottom: 1px solid #e2e8f0;
}

.section-header h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: white;
}

.help-text {
    font-size: 0.85rem;
    opacity: 0.8;
}

.original-markdown-section .section-header {
    background: #2b6cb0;
}

.html-preview-section .section-header {
    background: #38a169;
}

.markdown-input-wrapper {
    flex: 1;
    padding: 0;
}

#originalMarkdown {
    width: 100%;
    height: 450px;
    border: none;
    padding: 25px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    background: #f8f9ff;
    color: #2d3748;
    box-sizing: border-box;
}

#originalMarkdown:focus {
    outline: none;
    background: #fff;
    box-shadow: inset 0 0 0 2px #667eea;
}

.auto-split-rules {
    background: #e8f4fd;
    border-top: 1px solid #0ea5e9;
    padding: 20px 25px;
}

.auto-split-rules h4 {
    margin: 0 0 10px 0;
    color: #0ea5e9;
    font-size: 1rem;
}

.auto-split-rules ul {
    margin: 0;
    padding-left: 20px;
}

.auto-split-rules li {
    margin-bottom: 5px;
    color: #0369a1;
    font-size: 0.9rem;
}

/* HTML Preview Container */
.html-preview-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 450px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.no-splits-message {
    text-align: center;
    color: #6c757d;
    padding: 50px 20px;
    font-style: italic;
}

/* Split Preview Sections */
.split-preview-section {
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.split-preview-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.split-preview-section.section-1 {
    border-color: #4facfe;
}

.split-preview-section.section-2 {
    border-color: #38a169;
}

.split-preview-section.section-3 {
    border-color: #ed8936;
}

.split-preview-section.section-4 {
    border-color: #ec4899;
}

/* Split Preview Header */
.split-preview-header {
    background: #e2e8f0;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #cbd5e0;
}

.split-preview-section.section-1 .split-preview-header {
    background: #4facfe;
    color: white;
}

.split-preview-section.section-2 .split-preview-header {
    background: #38a169;
    color: white;
}

.split-preview-section.section-3 .split-preview-header {
    background: #ed8936;
    color: white;
}

.split-preview-section.section-4 .split-preview-header {
    background: #ec4899;
    color: white;
}

.section-number {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.section-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    color: #4facfe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.split-preview-section.section-1 .section-badge {
    color: #4facfe;
}

.split-preview-section.section-2 .section-badge {
    color: #38a169;
}

.split-preview-section.section-3 .section-badge {
    color: #ed8936;
}

.split-preview-section.section-4 .section-badge {
    color: #ec4899;
}

/* Section Actions (簡素化) */
.section-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.split-section-btn,
.delete-section-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.split-section-btn {
    background: #ffc107;
    color: white;
}

.split-section-btn:hover {
    background: #e0a800;
    transform: scale(1.1);
}

.delete-section-btn {
    background: #dc3545;
    color: white;
}

.delete-section-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Split Preview Content */
.split-preview-content {
    padding: 0;
    background: white;
    position: relative;
}

/* 編集中の視覚的フィードバック */
.direct-editable-area:focus h1,
.direct-editable-area:focus h2,
.direct-editable-area:focus h3 {
    position: relative;
}

.direct-editable-area:focus h1::after,
.direct-editable-area:focus h2::after,
.direct-editable-area:focus h3::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #667eea;
    opacity: 0.5;
}

/* Section Separator */
.section-separator {
    text-align: center;
    margin: 15px 0;
    position: relative;
}

.section-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #dc3545, transparent);
    z-index: 1;
}

.section-separator-text {
    background: white;
    padding: 5px 15px;
    color: #dc3545;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid #dc3545;
    border-radius: 15px;
    position: relative;
    z-index: 2;
    display: inline-block;
}

/* Manual Split Instructions */
.manual-split-area {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 20px 25px;
}

.manual-split-area h4 {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 1rem;
}

.instruction-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.instruction-columns p {
    margin: 0 0 5px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
}

.instruction-columns ul {
    margin: 5px 0 0 20px;
    padding: 0;
}

.instruction-columns li {
    margin-bottom: 3px;
    color: #6c757d;
    font-size: 0.8rem;
}

/* Footer */
.editor-footer {
    background: #f1f3f5;
    border-top: 1px solid #dee2e6;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-center {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* List Format Selection */
.list-format-selection {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.list-format-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.radio-option:hover {
    background: #e9ecef;
}

.radio-option input[type="radio"] {
    margin: 0;
    width: 14px;
    height: 14px;
    accent-color: #667eea;
}

.radio-text {
    font-size: 0.8rem;
    color: #495057;
    white-space: nowrap;
    font-weight: 500;
}

.radio-option input[type="radio"]:checked + .radio-text {
    color: #667eea;
    font-weight: 600;
}

/* Custom Button Styles */
#autoNormalizeBtn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

#autoNormalizeBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

#generatePptBtn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px 25px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

#generatePptBtn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

#generatePptBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Preview Modal */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: #4a5568;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .split-editor-main {
        grid-template-columns: 1fr;
    }
    
    .original-markdown-section {
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
    }
    
    #originalMarkdown {
        height: 300px;
    }
    
    .html-preview-container {
        max-height: 300px;
    }
    
    .instruction-columns {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .editor-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-center {
        order: -1;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .list-format-selection {
        order: 2;
        width: 100%;
        justify-content: center;
    }
    
    .split-preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Section Separator */
.section-separator {
    text-align: center;
    margin: 15px 0;
    position: relative;
}

.section-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #dc3545, transparent);
    z-index: 1;
}

.section-separator-text {
    background: white;
    padding: 5px 15px;
    color: #dc3545;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid #dc3545;
    border-radius: 15px;
    position: relative;
    z-index: 2;
    display: inline-block;
}

/* Manual Split Instructions */
.manual-split-area {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 20px 25px;
}

.manual-split-area h4 {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 1rem;
}

.instruction-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.instruction-columns p {
    margin: 0 0 5px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
}

.instruction-columns ul {
    margin: 5px 0 0 20px;
    padding: 0;
}

.instruction-columns li {
    margin-bottom: 3px;
    color: #6c757d;
    font-size: 0.8rem;
}

/* Footer */
.editor-footer {
    background: #f1f3f5;
    border-top: 1px solid #dee2e6;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-center {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* List Format Selection */
.list-format-selection {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.list-format-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.radio-option:hover {
    background: #e9ecef;
}

.radio-option input[type="radio"] {
    margin: 0;
    width: 14px;
    height: 14px;
    accent-color: #667eea;
}

.radio-text {
    font-size: 0.8rem;
    color: #495057;
    white-space: nowrap;
    font-weight: 500;
}

.radio-option input[type="radio"]:checked + .radio-text {
    color: #667eea;
    font-weight: 600;
}

/* Custom Button Styles */
#autoNormalizeBtn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

#autoNormalizeBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

#generatePptBtn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px 25px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

#generatePptBtn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

#generatePptBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Preview Modal */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: #4a5568;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .split-editor-main {
        grid-template-columns: 1fr;
    }
    
    .original-markdown-section {
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
    }
    
    #originalMarkdown {
        height: 300px;
    }
    
    .html-preview-container {
        max-height: 300px;
    }
    
    .instruction-columns {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .editor-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-center {
        order: -1;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .list-format-selection {
        order: 2;
        width: 100%;
        justify-content: center;
    }
    
    .split-preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* WordPress テーマとの競合を防ぐための追加CSS */

/* 直接編集可能エリアの強化スタイル */
.direct-editable-area {
    padding: 20px !important;
    background: white !important;
    min-height: 100px !important;
    border: 2px solid transparent !important;
    outline: none !important;
    transition: all 0.3s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif !important;
    line-height: 1.6 !important;
    font-size: 14px !important;
    color: #2d3748 !important;
    cursor: text !important;
}

/* WordPressテーマの影響をリセット */
.direct-editable-area * {
    font-family: inherit !important;
    box-sizing: border-box !important;
}

.direct-editable-area h1,
.direct-editable-area h2,
.direct-editable-area h3,
.direct-editable-area h4,
.direct-editable-area h5,
.direct-editable-area h6 {
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

.direct-editable-area h1 {
    font-size: 1.8rem !important;
    color: #2d3748 !important;
    border-bottom: 3px solid #4facfe !important;
    padding-bottom: 10px !important;
}

.direct-editable-area h2 {
    font-size: 1.4rem !important;
    color: #4a5568 !important;
}

.direct-editable-area h3 {
    font-size: 1.2rem !important;
    color: #718096 !important;
}

/* リスト間スペースの統一 */
.direct-editable-area ul,
.direct-editable-area ol {
    margin: 0 0 15px 0 !important;
    padding: 0 0 0 20px !important;
    list-style-position: outside !important;
}

.direct-editable-area li {
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    line-height: 1.6 !important;
    color: #4a5568 !important;
}

.direct-editable-area li:last-child {
    margin-bottom: 0 !important;
}

/* ネストしたリストの調整 */
.direct-editable-area ul ul,
.direct-editable-area ol ol,
.direct-editable-area ul ol,
.direct-editable-area ol ul {
    margin: 5px 0 5px 0 !important;
    padding-left: 20px !important;
}

/* 段落間スペースの統一 */
.direct-editable-area p {
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    line-height: 1.6 !important;
    color: #4a5568 !important;
}

.direct-editable-area p:last-child {
    margin-bottom: 0 !important;
}

.direct-editable-area strong,
.direct-editable-area b {
    font-weight: 600 !important;
    color: #2d3748 !important;
}

.direct-editable-area em,
.direct-editable-area i {
    font-style: italic !important;
    color: #718096 !important;
}

.direct-editable-area code {
    background: #f1f5f9 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 0.9em !important;
    color: #e53e3e !important;
    border: none !important;
    box-shadow: none !important;
}

.direct-editable-area blockquote {
    border-left: 4px solid #4facfe !important;
    padding-left: 16px !important;
    margin: 16px 0 !important;
    color: #4a5568 !important;
    font-style: italic !important;
    background: transparent !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
}

/* フォーカス時のスタイル */
.direct-editable-area:focus {
    border-color: #667eea !important;
    background: #f8f9ff !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1) !important;
}

.direct-editable-area:hover {
    background: #f8f9fa !important;
    border-color: #e2e8f0 !important;
}

/* プレースホルダー */
.direct-editable-area.empty::before {
    content: "ここで直接編集できます...";
    color: #a0aec0 !important;
    font-style: italic !important;
    pointer-events: none !important;
}

/* 編集中の視覚的フィードバック */
.direct-editable-area:focus h1,
.direct-editable-area:focus h2,
.direct-editable-area:focus h3 {
    position: relative;
}

.direct-editable-area:focus h1::after,
.direct-editable-area:focus h2::after,
.direct-editable-area:focus h3::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #667eea;
    opacity: 0.5;
}

/* フロントエンド専用の調整 */
.markdown-to-ppt-frontend-wrapper .direct-editable-area {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* テーマリセット強化 */
.markdown-to-ppt-frontend-wrapper .split-editor-container * {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif !important;
}

/* ボタンスタイルの強化 */
.markdown-to-ppt-frontend-wrapper .split-section-btn,
.markdown-to-ppt-frontend-wrapper .delete-section-btn {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    color: white !important;
}

.markdown-to-ppt-frontend-wrapper .split-section-btn {
    background: #ffc107 !important;
}

.markdown-to-ppt-frontend-wrapper .split-section-btn:hover {
    background: #e0a800 !important;
    transform: scale(1.1) !important;
}

.markdown-to-ppt-frontend-wrapper .delete-section-btn {
    background: #dc3545 !important;
}

.markdown-to-ppt-frontend-wrapper .delete-section-btn:hover {
    background: #c82333 !important;
    transform: scale(1.1) !important;
}

/* 2画面分割モード用の追加CSS */

/* Header の調整 */
.editor-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.header-left {
    display: flex;
    gap: 15px;
}

.header-right .enhanced-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
}

/* Main content を2画面に調整 */
.enhanced-main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

/* 左側入力エリアの調整 */
.enhanced-input-section {
    background: #f8f9ff;
    border-right: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.enhanced-markdown-input {
    width: 100%;
    height: 400px;
    border: none;
    padding: 25px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    background: #f8f9ff;
    color: #2d3748;
    box-sizing: border-box;
}

.enhanced-markdown-input:focus {
    outline: none;
    background: #fff;
    box-shadow: inset 0 0 0 2px #667eea;
}

/* 自動分割ルール表示 */
.auto-split-rules {
    background: #e8f4fd;
    border-top: 1px solid #0ea5e9;
    padding: 20px 25px;
}

.auto-split-rules h4 {
    margin: 0 0 10px 0;
    color: #0ea5e9;
    font-size: 1rem;
}

.auto-split-rules ul {
    margin: 0;
    padding-left: 20px;
}

.auto-split-rules li {
    margin-bottom: 5px;
    color: #0369a1;
    font-size: 0.9rem;
}

/* 右側分割プレビューエリア */
.enhanced-output-section {
    background: #fff;
    display: flex;
    flex-direction: column;
}

.enhanced-split-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.no-splits-message {
    text-align: center;
    color: #6c757d;
    padding: 50px 20px;
    font-style: italic;
}

/* 分割セクションのスタイル */
.enhanced-split-section {
    background: #f0f8ff;
    border: 2px solid #4facfe;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.enhanced-split-section.section-2 {
    background: #f0fff0;
    border-color: #38a169;
}

.enhanced-split-section.section-3 {
    background: #fff8f0;
    border-color: #ed8936;
}

.enhanced-split-section.section-4 {
    background: #fdf2f8;
    border-color: #ec4899;
}

.enhanced-split-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.2);
}

.enhanced-split-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.enhanced-split-number {
    display: flex;
    align-items: center;
    gap: 8px;
}

.enhanced-slide-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4facfe;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.enhanced-split-section.section-2 .enhanced-slide-number {
    background: #38a169;
}

.enhanced-split-section.section-3 .enhanced-slide-number {
    background: #ed8936;
}

.enhanced-split-section.section-4 .enhanced-slide-number {
    background: #ec4899;
}

.enhanced-slide-title {
    font-weight: 600;
    color: #2d3748;
}

.enhanced-delete-split-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.enhanced-delete-split-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.enhanced-split-content {
    background: white;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    color: #2d3748;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

.enhanced-split-content:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.enhanced-split-content.editable-content {
    cursor: text;
}

.enhanced-split-content.editable-content:hover {
    border-color: #a0aec0;
}

/* 分割区切り線 */
.enhanced-split-separator {
    text-align: center;
    margin: 10px 0;
    position: relative;
}

.enhanced-split-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #dc3545, transparent);
    z-index: 1;
}

.enhanced-split-separator-text {
    background: white;
    padding: 5px 15px;
    color: #dc3545;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #dc3545;
    border-radius: 15px;
    position: relative;
    z-index: 2;
    display: inline-block;
}

/* 手動分割操作エリア */
.manual-split-area {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 20px 25px;
}

.manual-split-area h4 {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 1rem;
}

.instruction-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.instruction-columns p {
    margin: 0 0 5px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
}

.instruction-columns ul {
    margin: 5px 0 0 20px;
    padding: 0;
}

.instruction-columns li {
    margin-bottom: 3px;
    color: #6c757d;
    font-size: 0.8rem;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .enhanced-main-content {
        grid-template-columns: 1fr;
    }
    
    .enhanced-input-section {
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
    }
    
    .enhanced-markdown-input {
        height: 300px;
    }
    
    .enhanced-split-container {
        max-height: 300px;
    }
    
    .instruction-columns {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .enhanced-controls {
        grid-template-columns: 1fr 1fr;
    }
    
    .enhanced-split-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}