/* ========================================
   凸凹万博リーダー専用スタイル
======================================== */

/* CSS Variables for Dekoboko Theme */
:root {
    --primary-color: #2C3E50;
    --secondary-color: #E74C3C;
    --accent-color: #F39C12;
    --danger-color: #8E44AD;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --text-light: #95A5A6;
    --background: #F8F4E6;
    --card-bg: #FFFFFF;
    --border-color: #E0D5C7;
    --settings-bg: #FDFCF8;
    --button-hover: #F5F5F5;
}

/* Status Badges */
.toc-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 8px;
    text-transform: uppercase;
}

.toc-status-badge.published {
    background-color: #4caf50;
    color: white;
}

.toc-status-badge.writing {
    background-color: #2196f3;
    color: white;
}

.toc-status-badge.confirmed {
    background-color: #ff9800;
    color: white;
}

.toc-status-badge.draft {
    background-color: #9c27b0;
    color: white;
}

.toc-status-badge.planned {
    background-color: #9e9e9e;
    color: white;
}

/* Part Titles in TOC */
.toc-part-title {
    margin: 20px 0 10px;
    padding: 10px 0;
    font-size: 14px;
    font-weight: bold;
    color: #2563eb;
    border-top: 2px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

/* Disabled chapters */
.toc-item[data-chapter] {
    cursor: pointer;
}

.toc-item .toc-status-badge.planned {
    opacity: 0.5;
}

.toc-item .toc-status-badge.draft {
    opacity: 0.7;
}

.toc-item .toc-status-badge.confirmed {
    opacity: 0.9;
}

.toc-item .toc-status-badge.writing {
    opacity: 0.9;
}

.toc-item:has(.toc-status-badge.planned) {
    opacity: 0.5;
    pointer-events: none;
}

.toc-item:has(.toc-status-badge.draft) {
    opacity: 0.7;
    pointer-events: none;
}

.toc-item:has(.toc-status-badge.confirmed) {
    opacity: 0.9;
    pointer-events: none;
}

.toc-item:has(.toc-status-badge.writing) {
    opacity: 0.9;
    pointer-events: none;
}

/* Project Switch */
.project-switch {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.switch-project-link {
    display: block;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    text-decoration: none;
    color: #4b5563;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.switch-project-link:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Chapter completion CTA */
.chapter-completion-cta {
    margin-top: 60px;
    padding: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    text-align: center;
    color: white;
}

.cta-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 16px;
}

.cta-description {
    font-size: 16px;
    margin-bottom: 24px;
    opacity: 0.95;
}

.cta-button {
    display: inline-block;
    padding: 14px 32px;
    background: white;
    color: #667eea;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Dark theme adjustments */
[data-theme="dark"] .toc-part-title {
    color: #60a5fa;
    border-top-color: #374151;
    border-bottom-color: #374151;
}

[data-theme="dark"] .project-switch {
    border-top-color: #374151;
}

[data-theme="dark"] .switch-project-link {
    background: #1f2937;
    color: #9ca3af;
}

[data-theme="dark"] .switch-project-link:hover {
    background: #374151;
    color: #e5e7eb;
}

/* Sepia theme adjustments */
[data-theme="sepia"] .toc-part-title {
    color: #92400e;
    border-top-color: #d6cdb7;
    border-bottom-color: #d6cdb7;
}

[data-theme="sepia"] .project-switch {
    border-top-color: #d6cdb7;
}

[data-theme="sepia"] .switch-project-link {
    background: #f5f2e8;
    color: #78716c;
}

[data-theme="sepia"] .switch-project-link:hover {
    background: #e8e2d3;
    color: #451a03;
}

/* Settings Panel Override */
.settings-panel {
    background: var(--settings-bg) !important;
}

.setting-group {
    background: white !important;
    padding: 1rem !important;
    border-radius: 4px !important;
    margin-bottom: 0.75rem !important;
}

.setting-label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
}

.setting-controls {
    display: flex !important;
    gap: 0.5rem !important;
}

/* Font and Line Height Controls */
.font-size-btn,
.line-height-btn,
.font-btn {
    flex: 1 !important;
    padding: 8px 12px !important;
    background: white !important;
    border: 2px solid var(--border-color) !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    border-radius: 4px !important;
}

.font-size-btn:hover,
.line-height-btn:hover,
.font-btn:hover {
    background: var(--button-hover) !important;
    border-color: var(--primary-color) !important;
}

.font-size-btn.active,
.line-height-btn.active,
.font-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

/* Speech Control Panel Fix */
.speech-control-panel {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    background: white !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 1.25rem !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    z-index: 1000 !important;
    display: none;
}

.speech-control-panel.active {
    display: block !important;
}

.speech-controls {
    margin-bottom: 1rem !important;
}

.speech-main-controls {
    display: flex !important;
    gap: 1rem !important;
    justify-content: center !important;
    margin-bottom: 1rem !important;
}

.speech-control-btn {
    padding: 0.75rem !important;
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    min-width: 60px !important;
}

.speech-speed-controls {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    background: var(--background) !important;
    padding: 0.75rem !important;
    border-radius: 8px !important;
    margin-bottom: 1rem !important;
}

.speed-btn {
    width: 32px !important;
    height: 32px !important;
    border: 1px solid var(--border-color) !important;
    background: white !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.speed-slider-container {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

.speed-slider {
    flex: 1 !important;
}

.speed-display {
    min-width: 3rem !important;
    font-weight: 600 !important;
    color: var(--primary-color) !important;
}

.speech-preset-speeds {
    display: flex !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
}

.preset-btn {
    flex: 1 !important;
    padding: 0.5rem !important;
    background: white !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
}

.preset-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .toc-status-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .toc-part-title {
        font-size: 13px;
    }
    
    .chapter-completion-cta {
        padding: 30px 20px;
    }
    
    .cta-title {
        font-size: 20px;
    }
    
    .cta-description {
        font-size: 14px;
    }
}