/* ========================================
   健康管理入門 - コンポーネントスタイル
   ブックマーク、学習履歴ウィジェット、音声プレイヤー
   （数学入門スタイル準拠）
   ======================================== */

/* ========================================
   音声プレイヤー
   ======================================== */

.audio-player {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem 1.2rem;
    margin: 1.5rem 0;
}

.audio-player-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.audio-player-header span {
    font-size: 1.2rem;
}

.audio-player-label {
    font-size: 0.95rem;
    color: #333;
    margin: 0;
    font-weight: 500;
}

.audio-type-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.audio-type-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #1a365d;
    border-radius: 20px;
    background: #fff;
    color: #1a365d;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.audio-type-btn:hover {
    background: #f0f4f8;
}

.audio-type-btn.active {
    background: #1a365d;
    color: #fff;
}

.audio-player audio {
    width: 100%;
    margin-bottom: 0.8rem;
}

.audio-speed-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.audio-speed-btn {
    padding: 0.3rem 0.7rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.audio-speed-btn:hover {
    background: #f0f0f0;
}

.audio-speed-btn.active {
    background: #1a365d;
    color: #fff;
    border-color: #1a365d;
}

/* ========================================
   ブックマーク機能
   ======================================== */

.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: #f8f8f8;
    border-radius: 8px;
}

.bookmark-group {
    margin-bottom: 2rem;
}

.bookmark-chapter {
    font-size: 1rem;
    color: #333;
    border-bottom: 1px solid #ddd;
    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: #0066cc;
}

.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 #ddd;
    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: #f8f8f8;
    border-bottom: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
}

.review-tracker-icon {
    font-size: 1.1rem;
}

.review-tracker-title {
    flex: 1;
    font-weight: bold;
    color: #333;
}

.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-widget.collapsed .review-tracker-header {
    border-radius: 8px;
    border-bottom: none;
}

.review-tracker-chapter {
    font-weight: bold;
    color: #333;
    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: #0066cc;
    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: #f8f8f8;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 2rem;
    font-size: 0.85rem;
    line-height: 2;
}

.review-chapter-group {
    margin-bottom: 2rem;
}

.review-chapter-group h3,
.review-chapter-title {
    font-size: 1rem;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.review-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.review-history-card {
    background: #fff;
    border: 1px solid #ddd;
    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-num {
    font-weight: 600;
    color: #666;
}

.card-title {
    display: block;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    margin-bottom: 0.75rem;
}

.card-title:hover {
    color: #0066cc;
    text-decoration: underline;
}

.card-stats {
    font-size: 0.8rem;
}

.card-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.not-started-text {
    color: #888;
    font-style: italic;
    margin: 0;
}

.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;
}

/* ========================================
   レスポンシブ
   ======================================== */

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