/* DevTools入門 - コンポーネント */

.bookmark-btn { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: #ccc; padding: 0; line-height: 1; transition: transform 0.2s, color 0.2s; }
.bookmark-btn:hover { transform: scale(1.2); color: #f4a623; }
.bookmark-btn.bookmarked { color: #f4a623; }

.bookmark-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px); background: #333; color: #fff; padding: 12px 24px; border-radius: 8px; font-size: 0.9rem; z-index: 10000; opacity: 0; transition: transform 0.3s, opacity 0.3s; }
.bookmark-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.no-bookmarks { text-align: center; color: #888; padding: 3rem 1rem; background: #f8f6f1; border-radius: 8px; }
.bookmark-group { margin-bottom: 2rem; }
.bookmark-chapter { font-size: 1rem; color: #1a365d; border-bottom: 1px solid #d4c5a9; padding-bottom: 0.5rem; margin-bottom: 1rem; }
.bookmark-items { list-style: none; padding: 0; margin: 0; }
.bookmark-item { display: flex; align-items: center; padding: 0.75rem; border-bottom: 1px solid #eee; }
.bookmark-link { flex: 1; display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: #333; }
.bookmark-link:hover { color: #1a365d; }
.bookmark-title { font-size: 0.95rem; }
.bookmark-date { font-size: 0.8rem; color: #888; }
.bookmark-remove { background: none; border: none; color: #999; cursor: pointer; font-size: 1.2rem; padding: 0 0.5rem; margin-left: 0.5rem; }
.bookmark-remove:hover { color: #dc2626; }

.bookmark-actions, .review-actions { margin-top: 2rem; text-align: center; }
.clear-all-btn { background: #dc2626; color: #fff; border: none; padding: 0.5rem 1.5rem; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
.clear-all-btn:hover { background: #b91c1c; }

.review-tracker-widget { position: fixed; bottom: 20px; right: 20px; width: 260px; background: #fff; border: 1px solid #d4c5a9; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1000; font-size: 0.85rem; }
.review-tracker-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; background: #f8f6f1; border-bottom: 1px solid #d4c5a9; border-radius: 8px 8px 0 0; }
.review-tracker-icon { font-size: 1.1rem; }
.review-tracker-title { flex: 1; font-weight: bold; color: #1a365d; }
.review-tracker-toggle { background: none; border: none; cursor: pointer; font-size: 1rem; color: #666; padding: 0; }
.review-tracker-body { padding: 1rem; }
.review-tracker-widget.collapsed .review-tracker-body { display: none; }
.review-tracker-chapter { font-weight: bold; color: #1a365d; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid #eee; }
.review-tracker-stat { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.stat-label { color: #666; }
.stat-value { font-weight: 500; }

.status-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: bold; margin-left: 0.5rem; }
.status-badge.overdue { background: #fecaca; color: #dc2626; }
.status-badge.today { background: #fef3c7; color: #d97706; }
.status-badge.soon { background: #dbeafe; color: #2563eb; }
.status-badge.ok { background: #dcfce7; color: #16a34a; }
.status-badge.not-started { background: #f3f4f6; color: #6b7280; }

.review-tracker-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid #eee; }
.review-tracker-link { color: #1a365d; text-decoration: none; font-size: 0.8rem; }
.review-tracker-link:hover { text-decoration: underline; }
.review-tracker-clear { background: none; border: 1px solid #ddd; padding: 0.25rem 0.75rem; border-radius: 4px; cursor: pointer; font-size: 0.75rem; color: #666; }
.review-tracker-clear:hover { background: #f5f5f5; }

.status-legend { background: #f8f6f1; padding: 1rem; border-radius: 6px; margin-bottom: 2rem; font-size: 0.85rem; line-height: 2; }
.review-history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.review-history-card { background: #fff; border: 1px solid #d4c5a9; border-radius: 8px; padding: 1rem; transition: box-shadow 0.2s; }
.review-history-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.review-history-card.overdue { border-left: 4px solid #dc2626; }
.review-history-card.today { border-left: 4px solid #d97706; }
.review-history-card.soon { border-left: 4px solid #2563eb; }
.review-history-card.ok { border-left: 4px solid #16a34a; }
.review-history-card.not-started { border-left: 4px solid #9ca3af; opacity: 0.7; }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.card-chapter { font-size: 0.8rem; color: #666; }
.card-title { display: block; font-weight: bold; color: #1a365d; text-decoration: none; margin-bottom: 0.75rem; }
.card-title:hover { text-decoration: underline; }
.card-stats { font-size: 0.8rem; }
.card-stat { display: flex; justify-content: space-between; margin-bottom: 0.25rem; }
.card-clear { background: none; border: 1px solid #ddd; padding: 0.25rem 0.5rem; border-radius: 4px; cursor: pointer; font-size: 0.7rem; color: #666; margin-top: 0.5rem; }
.card-clear:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.not-started-text { color: #888; font-style: italic; }

.search-container { position: relative; padding: 0.5rem 0 1rem 0; }
.search-box { position: relative; }
.search-box input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d4c5a9; border-radius: 4px; font-size: 0.85rem; font-family: inherit; background: #fff; color: #333; box-sizing: border-box; }
.search-box input:focus { outline: none; border-color: #1a365d; box-shadow: 0 0 0 2px rgba(26, 54, 93, 0.15); }
.search-box input::placeholder { color: #999; }

.search-results { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #d4c5a9; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,0.2); max-height: 450px; overflow-y: auto; z-index: 1000; margin-top: 4px; }
.search-result-item { display: block; padding: 0.75rem 1rem; border-bottom: 1px solid #eee; text-decoration: none; transition: background 0.15s; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.selected { background: #f8f6f1; }
.search-result-title { font-weight: bold; color: #1a365d; font-size: 0.9rem; margin-bottom: 0.25rem; }
.search-result-title mark { background: #fef3c7; color: #1a365d; padding: 0 0.15rem; border-radius: 2px; }
.search-result-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.75rem; }
.search-result-chapter { color: #666; }
.search-result-snippet { font-size: 0.8rem; color: #555; margin-top: 0.4rem; line-height: 1.5; }
.search-result-snippet mark { background: #fef3c7; color: #333; padding: 0 0.1rem; border-radius: 2px; }
.search-no-results { padding: 1.5rem 1rem; text-align: center; color: #888; font-size: 0.9rem; }

@media (max-width: 900px) {
    .review-tracker-widget { width: 200px; bottom: 10px; right: 10px; font-size: 0.8rem; }
    .review-history-grid { grid-template-columns: 1fr; }
}

@media print {
    .sidebar-menu, .menu-toggle, .review-tracker-widget { display: none !important; }
    .main-content { margin-left: 0; }
}
