/**
 * reading-mode.css - 読書モード（抜き書き本ビューア）のスタイル
 */

/* オーバーレイ */
.reading-mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* コンテナ */
.reading-mode-container {
    width: 100%;
    max-width: 800px;
    height: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-primary, #ffffff);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* ヘッダー */
.reading-mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--color-bg-secondary, #f8fafc);
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    flex-shrink: 0;
}

.reading-mode-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--color-text-secondary, #64748b);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.reading-mode-close:hover {
    background: var(--color-bg-hover, #f1f5f9);
    color: var(--color-text-primary, #1a202c);
}

.reading-mode-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary, #1a202c);
    text-align: center;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 16px;
}

.reading-mode-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reading-mode-print {
    background: transparent;
    border: none;
    font-size: 16px;
    color: var(--color-text-secondary, #64748b);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.reading-mode-print:hover {
    background: var(--color-bg-hover, #f1f5f9);
    color: var(--color-text-primary, #1a202c);
}

.reading-mode-page-indicator {
    font-size: 14px;
    color: var(--color-text-secondary, #64748b);
    white-space: nowrap;
}

/* コンテンツエリア */
.reading-mode-content {
    flex: 1;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    position: relative;
}

/* ナビゲーションボタン */
.reading-mode-nav {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--color-text-tertiary, #94a3b8);
    cursor: pointer;
    padding: 20px;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reading-mode-nav:hover {
    background: var(--color-bg-hover, #f1f5f9);
    color: var(--color-text-primary, #1a202c);
}

.reading-mode-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ページ表示エリア */
.reading-mode-page {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

/* 表紙ページ */
.reading-mode-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: 400px;
}

/* 表紙画像 */
.reading-mode-cover-image-container {
    margin-top: 32px;
    margin-bottom: 32px;
}

.reading-mode-cover-image {
    width: 200px;
    height: 300px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.reading-mode-cover-image-placeholder {
    width: 200px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-secondary, #f8fafc);
    border-radius: 4px;
    color: var(--color-text-tertiary, #94a3b8);
    font-size: 24px;
}

.reading-mode-book-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary, #1a202c);
    margin-bottom: 16px;
    line-height: 1.4;
}

.reading-mode-book-author {
    font-size: 18px;
    color: var(--color-text-secondary, #64748b);
}

.reading-mode-instruction {
    font-size: 14px;
    color: var(--color-text-tertiary, #94a3b8);
    font-style: italic;
}

/* 読書記録ページ */
.reading-mode-record {
    height: 100%;
}

/* 各メモアイテム */
.reading-mode-memo-item {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border-light, #e2e8f0);
}

.reading-mode-memo-item.last {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ページ範囲表示 */
.reading-mode-page-range {
    font-size: 12px;
    color: var(--color-text-tertiary, #94a3b8);
    margin-bottom: 8px;
    font-style: italic;
}

.reading-mode-page-range::before {
    content: 'p.';
}

.reading-mode-notes {
    font-size: 18px;
    line-height: 1.8;
    color: var(--color-text-primary, #1a202c);
}

/* タグのハイライト */
.reading-mode-tag {
    background: var(--color-accent-light, #dbeafe);
    color: var(--color-accent, #3b82f6);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* 画像 */
.reading-mode-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    display: block;
}

.reading-mode-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-secondary, #f8fafc);
    border: 2px dashed var(--color-border, #e2e8f0);
    border-radius: 8px;
    padding: 40px;
    margin: 16px 0;
    color: var(--color-text-tertiary, #94a3b8);
    font-size: 32px;
}

/* 空のメモページ */
.reading-mode-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    color: var(--color-text-tertiary, #94a3b8);
}

.reading-mode-empty i {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.reading-mode-empty p {
    font-size: 18px;
}

/* フッター（進捗バー） */
.reading-mode-footer {
    padding: 8px 20px;
    background: var(--color-bg-secondary, #f8fafc);
    border-top: 1px solid var(--color-border, #e2e8f0);
    flex-shrink: 0;
}

.reading-mode-progress {
    height: 4px;
    background: var(--color-bg-tertiary, #e2e8f0);
    border-radius: 2px;
    overflow: hidden;
}

.reading-mode-progress-bar {
    height: 100%;
    background: var(--color-accent, #3b82f6);
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* ダークモード */
[data-theme="dark"] .reading-mode-overlay {
    background: rgba(0, 0, 0, 0.95);
}

[data-theme="dark"] .reading-mode-container {
    background: var(--color-bg-primary, #0f172a);
}

[data-theme="dark"] .reading-mode-header {
    background: var(--color-bg-secondary, #1e293b);
    border-color: var(--color-border, #334155);
}

[data-theme="dark"] .reading-mode-close:hover {
    background: var(--color-bg-tertiary, #334155);
}

[data-theme="dark"] .reading-mode-print:hover {
    background: var(--color-bg-tertiary, #334155);
}

[data-theme="dark"] .reading-mode-nav:hover {
    background: var(--color-bg-tertiary, #334155);
}

[data-theme="dark"] .reading-mode-cover-image-placeholder {
    background: var(--color-bg-tertiary, #334155);
}

[data-theme="dark"] .reading-mode-tag {
    background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .reading-mode-footer {
    background: var(--color-bg-secondary, #1e293b);
    border-color: var(--color-border, #334155);
}

[data-theme="dark"] .reading-mode-memo-item {
    border-color: var(--color-border, #334155);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .reading-mode-container {
        max-width: 100%;
    }

    .reading-mode-header {
        padding: 10px 12px;
    }

    .reading-mode-title {
        font-size: 14px;
    }

    .reading-mode-page-indicator {
        font-size: 12px;
    }

    .reading-mode-nav {
        padding: 12px;
        font-size: 20px;
    }

    .reading-mode-page {
        padding: 24px 16px;
    }

    .reading-mode-cover-image {
        width: 160px;
        height: 240px;
    }

    .reading-mode-cover-image-placeholder {
        width: 160px;
        height: 240px;
    }

    .reading-mode-book-title {
        font-size: 22px;
    }

    .reading-mode-book-author {
        font-size: 16px;
    }

    .reading-mode-notes {
        font-size: 16px;
        line-height: 1.7;
    }

    .reading-mode-instruction {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .reading-mode-nav {
        padding: 8px;
        font-size: 18px;
    }

    .reading-mode-page {
        padding: 20px 12px;
    }

    .reading-mode-cover-image {
        width: 140px;
        height: 210px;
    }

    .reading-mode-cover-image-placeholder {
        width: 140px;
        height: 210px;
    }

    .reading-mode-book-title {
        font-size: 20px;
    }

    .reading-mode-notes {
        font-size: 15px;
    }
}

/* 印刷時は非表示 */
@media print {
    .reading-mode-overlay {
        display: none !important;
    }
}
