/* Challenges Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* *** ダークモードのCSS変数とスタイル *** */
:root {
    /* ライトモードの色定義 - 統一されたカラーシステム */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --primary-color: #ff6156;
    --secondary-color: #f1f5f9;
    --accent-color: #ff6156;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
}

/* ダークモード */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #475569;
    --border-light: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --primary-color: #ff8c9e;
    --secondary-color: #475569;
    --accent-color: #ff8c9e;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --error-color: #f87171;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
}

/* Navigation - defer to main.css */

/* Main Layout */
.main-layout {
    display: flex;
    min-height: calc(100vh - 80px); /* navbar-height固定値を使用 */
    margin-top: 80px; /* navbar-height固定値を使用 */
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 80px; /* navbar-height固定値を使用 */
    height: calc(100vh - 80px); /* navbar-height固定値を使用 */
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-header h1 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.sidebar-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Progress Section */
.progress-section {
    margin-bottom: 24px;
}

.progress-title {
    font-size: 0.875rem;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
}

.progress-skills {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 1em;
}

.skill-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.skill-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.skill-count {
    font-weight: 600;
    min-width: 35px;
    text-align: right;
    color: var(--text-primary);
}

.skill-bar-mini {
    background: var(--secondary-color);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    width: 50px;
    flex-shrink: 0;
}

.skill-fill-mini {
    background: var(--primary-color);
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

/* Filter Section */
.filter-section {
    margin-bottom: 24px;
}

.filter-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    text-align: left;
}

.filter-subgroup {
    margin-bottom: 12px;
    padding-left: 1em;
}

.filter-subgroup:last-child {
    margin-bottom: 0;
}

.filter-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 1em;
}

.filter-option {
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.75rem;
    border: 1px solid var(--border-light);
    display: inline-block;
    text-align: left;
    white-space: nowrap;
    width: auto;
    font-weight: 500;
}

.filter-option i {
    margin-right: 4px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.filter-option:hover {
    background: rgba(255, 97, 86, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-option.active {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.filter-option.active i {
    color: var(--primary-color);
}

.filter-option:hover i {
    color: var(--primary-color);
}


/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
    margin-left: 280px; /* sidebar width */
    overflow-y: auto;
    min-width: 0; /* flexアイテムの最小幅を0に設定 */
    width: calc(100vw - 280px); /* viewportの幅からsidebar幅を除いた幅を指定 */
    max-width: calc(100vw - 280px); /* 最大幅も指定 */
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.content-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}


/* Challenges Grid */
.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 16px;
    animation: fadeIn 0.3s ease-in-out;
    width: 100%; /* 親コンテナの幅を使用 */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.challenge-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    height: auto;
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-light);
}

.challenge-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.challenge-card.completed {
    border-color: var(--border-light) !important;
    background: var(--bg-card) !important;
}

.challenge-card.completed::before {
    background: var(--border-light) !important;
}

.challenge-card.completed .challenge-number {
    background: #3b82f6 !important;
    color: white !important;
    position: relative;
}

.challenge-card.completed .challenge-number::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    background: #3b82f6;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.challenge-card.in-progress {
    border-color: var(--warning-color) !important;
    background: rgba(245, 158, 11, 0.02) !important;
}

.challenge-card.in-progress::before {
    background: var(--warning-color) !important;
}

.challenge-card.pending {
    border-color: var(--border-light) !important;
}

.challenge-card.pending::before {
    background: var(--border-light) !important;
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.challenge-number {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.challenge-time {
    background: rgba(16, 185, 129, 0.1);
    color: #000000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.challenge-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.challenge-status.completed {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.challenge-status.in-progress {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.challenge-status.pending {
    background: var(--secondary-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.challenge-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.4;
    margin-top: 8px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.challenge-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    max-height: 60px;
    overflow: hidden;
}

.skill-tag {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.2;
}

.skill-tag.question {
    background: rgba(255, 97, 86, 0.1);
    color: #000000;
}

.skill-tag.summary {
    background: rgba(255, 97, 86, 0.1);
    color: #000000;
}

.skill-tag.structure {
    background: rgba(255, 97, 86, 0.1);
    color: #000000;
}

.skill-tag.verbalization {
    background: rgba(255, 97, 86, 0.1);
    color: #000000;
}

.skill-tag.speed {
    background: rgba(255, 97, 86, 0.1);
    color: #000000;
}

.skill-tag i {
    margin-right: 4px;
}

/* Description Section (Challenge Card) */
.challenge-description {
    padding: 16px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    border-bottom: 1px solid var(--border-light);
    flex-grow: 1;
}

/* ===== Hero Card Styles (New 2-Section Layout) ===== */
.challenge-card-hero {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    position: relative;
    height: auto;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.challenge-card-hero:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.challenge-card-hero::before {
    display: none;
}

/* Image Section (Top) */
.hero-image-section {
    height: 230px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

/* Info Section (Bottom) */
.hero-info-section {
    height: 120px;
    padding: 16px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 10;
}

/* Image section now displays the image directly without text overlays */

/* ===== Info Section Elements ===== */
/* Status and Time Row */
.hero-status-time-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.hero-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
}

.hero-status-badge.completed {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.hero-status-badge.pending {
    background: rgba(255, 97, 86, 0.1);
    color: #ff6156;
    border-color: rgba(255, 97, 86, 0.2);
}

.hero-status-badge.in-progress {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.hero-time-info {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--secondary-color);
    border: 1px solid var(--border-light);
}

.hero-detail-button {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hero-detail-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Skills Row */
.hero-skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.hero-skill-tags .skill-prefix {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 4px;
}

.hero-skill-tags .skill-tag {
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 97, 86, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 97, 86, 0.2);
    text-transform: none;
}


/* Responsive adjustments for hero cards */
@media (max-width: 768px) {
    .challenge-card-hero {
        height: auto;
        min-height: 380px;
    }
    
    .hero-image-section {
        height: 200px;
    }
    
    .hero-info-section {
        height: 120px;
        padding: 14px;
    }
    
    .hero-skill-tags {
        gap: 4px;
    }
    
    .hero-skill-tags .skill-tag {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
    
    .hero-card-actions {
        bottom: 8px;
        right: 8px;
        gap: 4px;
    }
    
    .challenge-card {
        height: auto;
        min-height: 360px;
    }
}

/* Grid Display Only */

.challenge-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
}

.action-button {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    white-space: nowrap;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.action-button.primary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-light);
}

.action-button.restart {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-light);
}

.action-button.secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-light);
}

.action-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.action-button.primary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-button.restart:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.action-button.secondary:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-card);
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-light);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close-button:hover {
    color: var(--text-primary);
}

.modal-body {
    line-height: 1.6;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Mobile Filter Toggle */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: all 0.2s ease;
}

/* Loading and Error Messages */
.loading-message,
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin: 20px;
    grid-column: 1 / -1;
}

.loading-spinner {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.loading-message h3,
.error-message h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.loading-message p,
.error-message p {
    margin: 0 0 20px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s ease;
        z-index: 1500;
        top: 0;
        height: 100vh;
        padding-top: 100px;
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 16px;
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
    }

    .mobile-filter-toggle {
        display: block;
    }

    .mobile-filter-toggle:hover {
        transform: scale(1.05);
    }

    .challenges-grid {
        grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
        gap: 12px;
    }

    .nav-menu:not(.mobile-active) {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .challenges-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .content-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .content-title {
        font-size: 1.5rem;
    }

    .view-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-item {
        font-size: 0.8rem;
        padding: 6px 10px;
        gap: 4px;
    }

    .challenge-card {
        padding: 16px;
        min-height: 180px;
    }

    .challenge-actions {
        flex-direction: column;
        gap: 6px;
    }

    .action-button {
        min-height: 44px;
        font-size: 0.9rem;
    }

    .skills-progress {
        grid-template-columns: 1fr;
    }

    .challenge-list-item {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        padding: 16px;
    }

    .list-content {
        width: 100%;
        padding-right: 0;
    }

    .list-meta {
        position: static;
        width: 100%;
        justify-content: flex-start;
    }

    .list-actions {
        position: static;
        width: 100%;
        justify-content: space-between;
    }

    .list-actions .action-button {
        flex: 1;
        min-height: 44px;
    }
}

/* Enhanced Error Message Styles */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin: 20px;
    grid-column: 1 / -1;
}

.error-message .error-icon {
    margin-bottom: 20px;
}

.error-message .error-icon i {
    font-size: 4rem;
    color: #ff6b6b;
}

.error-message h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.error-message .error-main {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.error-message .error-detail {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ===== AI Recommendations Section ===== */
.ai-recommendations-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.recommendations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.recommendations-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.recommendations-title i {
    color: var(--primary-color);
}

.recommendations-refresh {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recommendations-refresh:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.recommendations-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Unified Recommendation Card Design */
.recommendation-card.unified-design {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.recommendation-card.unified-design:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

/* Simple Recommendation Card Design */
.recommendation-card.simple {
    padding: 12px 16px;
    min-height: auto;
}

.rec-simple-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rec-simple-header .rec-title {
    margin: 0 !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    flex: 1;
    display: block !important;
    line-height: 1.4 !important;
}

/* ダークモード対応 */
[data-theme="dark"] .rec-simple-header .rec-title {
    color: #f1f5f9 !important;
}

.rec-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rec-score-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.rec-difficulty-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--secondary-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.rec-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.rec-meta {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.rec-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rec-time i {
    font-size: 0.85rem;
}

.rec-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.rec-skill-tag {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 97, 86, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 97, 86, 0.2);
}

.rec-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.rec-action-button {
    width: 100%;
    padding: 10px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rec-action-button:hover {
    background: #e5554a;
    transform: translateY(-1px);
}

.rec-action-button i {
    font-size: 0.85rem;
}

/* Loading and Empty States */
.recommendations-loading,
.recommendations-empty,
.recommendations-error {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-secondary);
}

.recommendations-loading i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.recommendations-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    color: var(--success-color);
}

.empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-message {
    font-size: 0.9rem;
    line-height: 1.4;
}

.recommendations-error i {
    font-size: 2rem;
    margin-bottom: 12px;
    color: var(--error-color);
}

.error-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.error-message {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Recommendation Mark */
.recommendation-mark {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

/* Highlight Effect for Challenge Cards */
.challenge-card-hero.highlighted {
    animation: highlightPulse 2s ease-out;
    border-color: var(--primary-color) !important;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 97, 86, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(255, 97, 86, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 97, 86, 0);
    }
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.error-action-btn:hover {
    background: var(--primary-dark, #2563eb);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.error-action-btn:nth-child(2) {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-light);
}

.error-action-btn:nth-child(2):hover {
    background: var(--bg-card);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== サイドバー推奨課題シンプルリスト ===== */
.recommendation-item-simple {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recommendation-item-simple:hover {
    background: var(--bg-hover);
}

.recommendation-item-simple i {
    color: var(--text-secondary);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.rec-title-simple {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.3;
}

/* ハイライトエフェクト */
.highlight-flash {
    animation: flash 0.5s ease-in-out 3;
}

@keyframes flash {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4);
    }
}

/* ===== AIチャットヒント ===== */
.content-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.ai-chat-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
}

.ai-chat-hint i {
    color: #3b82f6;
    font-size: 1rem;
}

.ai-chat-hint:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

/* レスポンシブ対応 - タブレット */
@media (max-width: 768px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ai-chat-hint {
        font-size: 0.85rem;
        padding: 5px 10px;
    }
}