/* Enhanced Editor Styles - 完全テーマ連動対応版 */

.enhanced-markdown-to-ppt-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    backdrop-filter: blur(10px);
    margin: 20px 0;
}

.enhanced-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.enhanced-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.enhanced-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.enhanced-status-bar {
    background: #2d3748;
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.enhanced-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.enhanced-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffd700;
    animation: pulse 2s infinite;
}

.enhanced-status-dot.ready {
    background: #48bb78;
    animation: none;
}

.enhanced-status-dot.error {
    background: #f56565;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.enhanced-main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

.enhanced-input-section {
    background: #f8f9ff;
    border-right: 1px solid #e2e8f0;
}

.enhanced-output-section {
    background: #fff;
}

.enhanced-section-header {
    background: #2d3748;
    color: white;
    padding: 15px 25px;
    font-weight: 600;
    font-size: 1.1rem;
}

.enhanced-input-section .enhanced-section-header {
    background: #2b6cb0;
}

.enhanced-output-section .enhanced-section-header {
    background: #38a169;
}

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

.enhanced-markdown-input:focus {
    outline: none;
    background: #fff;
}

.enhanced-preview {
    padding: 25px;
    height: 400px;
    overflow-y: auto;
    background: white;
}

.enhanced-preview h1, .enhanced-preview h2, .enhanced-preview h3 {
    color: #2d3748;
    margin-bottom: 15px;
}

.enhanced-preview h1 {
    font-size: 1.8rem;
    border-bottom: 3px solid #4facfe;
    padding-bottom: 10px;
}

.enhanced-preview h2 {
    font-size: 1.4rem;
    color: #4a5568;
}

.enhanced-preview h3 {
    font-size: 1.2rem;
    color: #718096;
}

.enhanced-preview p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #4a5568;
}

.enhanced-preview ul, .enhanced-preview ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.enhanced-preview li {
    margin-bottom: 5px;
    color: #4a5568;
}

.enhanced-preview blockquote {
    border-left: 4px solid #4facfe;
    padding-left: 16px;
    margin: 16px 0;
    color: #4a5568;
    font-style: italic;
    background: #f0f8ff;
    padding: 15px;
    border-radius: 0 8px 8px 0;
}

.enhanced-preview pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #495057;
    overflow-x: auto;
}

.enhanced-feature-highlight {
    background: #f0fff4;
    border-left: 4px solid #38a169;
    padding: 15px;
    margin: 20px 25px;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: #2c5443;
}

.enhanced-mode-selector {
    background: #f7fafc;
    padding: 25px;
    margin: 20px 25px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.enhanced-mode-selector h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    text-align: center;
    font-size: 1.2rem;
}

.enhanced-mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.enhanced-mode-option {
    cursor: pointer;
    display: block;
}

.enhanced-mode-option input[type="radio"] {
    display: none;
}

.enhanced-mode-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.enhanced-mode-option input[type="radio"]:checked + .enhanced-mode-card {
    border-color: #4facfe;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.2);
}

.enhanced-mode-card:hover {
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.enhanced-mode-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.enhanced-mode-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.enhanced-mode-desc {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.4;
}

.enhanced-controls {
    padding: 25px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.enhanced-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    position: relative;
    text-decoration: none;
    display: inline-block;
}

.enhanced-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.enhanced-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.enhanced-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.enhanced-btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.enhanced-btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
    color: #4a5568;
    text-decoration: none;
}

.enhanced-btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.enhanced-btn-success:hover {
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.enhanced-sample-note {
    background: #ebf8ff;
    border-left: 4px solid #4facfe;
    padding: 15px;
    margin: 20px 25px;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: #2c5282;
}

.enhanced-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .enhanced-main-content {
        grid-template-columns: 1fr;
    }
    
    .enhanced-header h1 {
        font-size: 2rem;
    }
    
    .enhanced-controls {
        flex-direction: column;
    }
    
    .enhanced-status-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .enhanced-mode-options {
        grid-template-columns: 1fr;
    }
}

/* 4ボタン対応のコントロールエリア */
.enhanced-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 15px;
    padding: 25px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    align-items: stretch;
}

/* ボタンを均等な高さに調整 */
.enhanced-controls .enhanced-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 50px;
    width: 100%;
    white-space: nowrap;
    font-size: 0.9rem;
}

/* 超ノーマルスライドボタンの特別スタイル */
#enhancedGenerateNormalBtn {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    color: white;
    border: 1px solid #4a5568;
}

#enhancedGenerateNormalBtn:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(74, 85, 104, 0.3);
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
    .enhanced-controls {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .enhanced-controls .enhanced-btn {
        font-size: 0.85rem;
        min-height: 45px;
    }
}

@media (max-width: 768px) {
    .enhanced-controls {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 20px;
    }
    
    .enhanced-controls .enhanced-btn {
        font-size: 0.8rem;
        min-height: 40px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .enhanced-controls {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 15px;
    }
    
    .enhanced-controls .enhanced-btn {
        font-size: 0.9rem;
        min-height: 45px;
        padding: 12px 15px;
    }
}

/* ボタンホバー効果の統一 */
.enhanced-controls .enhanced-btn:hover:not(:disabled) {
    transition: all 0.3s ease;
}

/* 4ボタンレイアウト用の順序調整 */
#enhancedGenerateNormalBtn { order: 1; }
#enhancedLoadSample { order: 2; }
#enhancedTestLibrary { order: 3; }
#enhancedGenerateBtn { order: 4; }

/* ボタンテキストの改行防止 */
.enhanced-controls .enhanced-btn span {
    display: inline-block;
    white-space: nowrap;
}

/* 小さい画面でのテキスト調整 */
@media (max-width: 480px) {
    #enhancedGenerateNormalBtn::after {
        content: "\A（装飾なし）";
        white-space: pre;
        font-size: 0.7rem;
        opacity: 0.8;
    }
    
    #enhancedGenerateBtn span::after {
        content: "\A（3モード）";
        white-space: pre;
        font-size: 0.7rem;
        opacity: 0.8;
    }
}

/* public/css/enhanced-editor-style.css に以下を追加 */

/* 分割プレビューセクション（enhanced版用） */
.enhanced-split-container .split-preview-section {
    background: #f0f8ff;
    border: 2px solid #4facfe;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 0;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

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

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

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

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

.enhanced-split-container .split-preview-header {
    background: #4facfe;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.enhanced-split-container .split-preview-section.section-2 .split-preview-header {
    background: #38a169;
}

.enhanced-split-container .split-preview-section.section-3 .split-preview-header {
    background: #ed8936;
}

.enhanced-split-container .split-preview-section.section-4 .split-preview-header {
    background: #ec4899;
}

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

.enhanced-split-container .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;
}

.enhanced-split-container .section-actions {
    display: flex;
    gap: 5px;
}

.enhanced-split-container .split-section-btn,
.enhanced-split-container .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;
    color: white;
}

.enhanced-split-container .split-section-btn {
    background: #ffc107;
}

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

.enhanced-split-container .delete-section-btn {
    background: #dc3545;
}

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

.enhanced-split-container .split-preview-content {
    padding: 0;
    background: white;
}

.enhanced-split-container .direct-editable-area {
    padding: 20px;
    background: white;
    min-height: 100px;
    border: none;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    font-size: 14px;
    color: #2d3748;
    cursor: text;
}

.enhanced-split-container .direct-editable-area:focus {
    background: #f8f9ff;
    box-shadow: inset 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.enhanced-split-container .section-separator {
    text-align: center;
    margin: 10px 0;
    position: relative;
}

.enhanced-split-container .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;
}

.enhanced-split-container .section-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;
}

/* public/css/enhanced-editor-style.css に追加 */

/* モードファイル名表示 */
.enhanced-mode-filename {
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(79, 172, 254, 0.1);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4facfe;
    text-align: center;
    border: 1px solid rgba(79, 172, 254, 0.2);
}

/* モード選択時のファイル名強調 */
.enhanced-mode-option input[type="radio"]:checked + .enhanced-mode-card .enhanced-mode-filename {
    background: #4facfe;
    color: white;
    border-color: #4facfe;
}

/* モード別アイコン調整 */
.enhanced-mode-option:nth-child(1) .enhanced-mode-filename {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
    border-color: rgba(79, 172, 254, 0.2);
}

.enhanced-mode-option:nth-child(2) .enhanced-mode-filename {
    background: rgba(56, 161, 105, 0.1);
    color: #38a169;
    border-color: rgba(56, 161, 105, 0.2);
}

.enhanced-mode-option:nth-child(3) .enhanced-mode-filename {
    background: rgba(237, 137, 54, 0.1);
    color: #ed8936;
    border-color: rgba(237, 137, 54, 0.2);
}

/* 選択時の色 */
.enhanced-mode-option:nth-child(2) input[type="radio"]:checked + .enhanced-mode-card .enhanced-mode-filename {
    background: #38a169;
    color: white;
    border-color: #38a169;
}

.enhanced-mode-option:nth-child(3) input[type="radio"]:checked + .enhanced-mode-card .enhanced-mode-filename {
    background: #ed8936;
    color: white;
    border-color: #ed8936;
}