/**
 * AI LIFE Academy - Course Archive Styles
 * コース一覧ページのスタイル
 */

/* ページヘッダー */
.ailife-page-header {
    background: transparent;
    color: #6b7280;
    padding: 4rem 0 3rem;
    text-align: center;
}

.ailife-page-header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: #6b7280;
}

.ailife-page-subtitle {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 400;
    color: #6b7280;
}

/* フィルターセクション */
.ailife-filter-section {
    background: #f8fafc;
    padding: 2.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.ailife-filter-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 検索フォーム */
.ailife-search-form {
    max-width: 500px;
    margin: 0 auto;
}

.ailife-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ailife-search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.2s ease;
}

.ailife-search-input:focus {
    outline: none;
    border-color: #1847C7;
    box-shadow: 0 0 0 3px rgba(24, 71, 199, 0.1);
}

.ailife-search-button {
    position: absolute;
    right: 0.5rem;
    background: #1847C7;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ailife-search-button:hover {
    background: #1e40af;
}

/* フィルター */
.ailife-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.ailife-filter-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ailife-filters-with-reset {
    display: flex;
    gap: 2rem;
    align-items: flex-end;
}

.ailife-filters-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ailife-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ailife-filter-group label {
    font-weight: 600;
    color: #333333;
    font-size: 0.875rem;
}

.ailife-filter-select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.ailife-filter-select:focus {
    outline: none;
    border-color: #1847C7;
}

/* フィルターアクション */
.ailife-filter-actions {
    display: flex;
    align-items: flex-end;
}

.ailife-filter-reset {
    background: #6b7280;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    height: fit-content;
}

.ailife-filter-reset:hover {
    background: #4b5563;
}

/* コース一覧セクション */
.ailife-courses-section {
    padding: 3rem 0;
}

/* 結果件数 */
.ailife-results-info {
    margin-bottom: 2rem;
    text-align: center;
}

.ailife-results-count {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

/* コースグリッド */
.ailife-courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

/* コースカード（トップページと同じスタイル） */
.ailife-course-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    position: relative;
}

.ailife-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* コースサムネイル */
.ailife-course-thumbnail {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.ailife-course-thumbnail img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ailife-course-card:hover .ailife-course-thumbnail img {
    transform: scale(1.05);
}

/* カテゴリーバッジ（左上） */
.ailife-course-category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #1847C7;
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(24, 71, 199, 0.3);
    backdrop-filter: blur(8px);
}

/* コースコンテンツ */
.ailife-course-content {
    padding: 1.5rem;
}

/* タイトルと価格の行 */
.ailife-course-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0px;
    gap: 1rem;
}

.ailife-course-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.5;
    color: #333333;
    flex: 1;
    min-height: 2.8rem; /* タイトル高さを統一 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ailife-course-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ailife-course-title a:hover {
    color: #1847C7;
}

/* コースメタ情報 */
.ailife-course-meta {
    margin-top: 0.75rem;
}

.ailife-course-level {
    background: white;
    color: #64748b;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* 価格バッジ（タイトル行の右端） */
.ailife-course-price {
    flex-shrink: 0;
}

.ailife-course-price .ailife-price-free {
    background: #dcfce7;
    color: #16a34a;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
    border: 1px solid #bbf7d0;
    white-space: nowrap;
}

.ailife-course-price .ailife-price-paid {
    background: #fef3c7;
    color: #d97706;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
    border: 1px solid #fed7aa;
    white-space: nowrap;
}

/* アイコン付きメタ情報 */
.ailife-course-students,
.ailife-course-duration-meta {
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* SVGアイコンの定義（トップページと同じ） */
.ailife-icon-students::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.ailife-icon-duration::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12,6 12,12 16,14'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.ailife-icon-level::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='22,12 18,12 15,21 9,3 6,12 2,12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* メタ情報を横並びに */
.ailife-course-meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* アクションボタンエリア */
.ailife-course-action {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.ailife-course-button {
    display: inline-block;
    width: 100%;
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

/* 無料コースボタン */
.ailife-free-course-btn {
    background: #1847C7;
    color: white;
    width: -webkit-fill-available;
}

.ailife-free-course-btn:hover {
    background: #1539a8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(24, 71, 199, 0.3);
}

/* 有料会員用アクセスボタン */
.ailife-paid-access-btn {
    background: #10b981;
    color: white;
    width: -webkit-fill-available;
}

.ailife-paid-access-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* 有料会員アップグレードボタン */
.ailife-upgrade-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.ailife-upgrade-btn:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}

.ailife-upgrade-btn::before {
    content: '✨';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}

/* コースが見つからない場合 */
.ailife-no-courses {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    text-align: center;
}

.ailife-no-courses-content {
    max-width: 500px;
    padding: 2rem;
}

.ailife-no-courses-icon {
    margin: 0 auto 1.5rem;
    color: #9ca3af;
}

.ailife-no-courses h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333333;
    margin: 0 0 1rem;
}

.ailife-no-courses p {
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 0.5rem;
}

.ailife-no-courses-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.ailife-cta-button {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.ailife-cta-primary {
    background: #1847C7;
    color: white;
}

.ailife-cta-primary:hover {
    background: #1e40af;
    transform: translateY(-2px);
}

.ailife-cta-secondary {
    background: white;
    color: #1847C7;
    border: 2px solid #1847C7;
}

.ailife-cta-secondary:hover {
    background: #1847C7;
    color: white;
}

/* ページネーション */
.ailife-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 4rem;
}

.ailife-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: white;
    color: #64748b;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    min-width: 48px;
    height: 48px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ailife-pagination .page-numbers:hover {
    background: #f8fafc;
    border-color: #1847C7;
    color: #1847C7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 71, 199, 0.15);
}

.ailife-pagination .page-numbers.current {
    background: #1847C7;
    color: white;
    border-color: #1847C7;
    box-shadow: 0 4px 12px rgba(24, 71, 199, 0.3);
}

.ailife-pagination .page-numbers.dots {
    background: transparent;
    border: none;
    cursor: default;
    box-shadow: none;
}

.ailife-pagination .page-numbers.dots:hover {
    background: transparent;
    border: none;
    color: #64748b;
    transform: none;
    box-shadow: none;
}

/* 人気のタグセクション */
.ailife-popular-tags-section {
    background: #f8fafc;
    padding: 3rem 0;
    border-top: 1px solid #e2e8f0;
}

.ailife-popular-tags-section h2 {
    text-align: center;
    font-size: 1.875rem;
    font-weight: 700;
    color: #333333;
    margin: 0 0 2rem;
}

.ailife-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.ailife-tag-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    color: #6b7280;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ailife-tag-button:hover {
    background: #1847C7;
    color: white;
    border-color: #1847C7;
    transform: translateY(-2px);
}

.ailife-tag-icon {
    opacity: 0.7;
}

.ailife-tag-count {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ailife-tag-button:hover .ailife-tag-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
    .ailife-courses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .ailife-filters {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ailife-page-header {
        padding: 3rem 0 2rem;
    }
    
    .ailife-page-header-content h1 {
        font-size: 2rem;
    }
    
    .ailife-filter-section {
        padding: 1.5rem 0;
    }
    
    .ailife-filters {
        grid-template-columns: 1fr;
    }
    
    .ailife-courses-section {
        padding: 2rem 0;
    }
    
    .ailife-courses-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .ailife-no-courses-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .ailife-cta-button {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
    
    .ailife-pagination .page-numbers {
        padding: 0.5rem 0.75rem;
        min-width: 40px;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .ailife-page-header-content h1 {
        font-size: 1.75rem;
    }
    
    .ailife-course-content {
        padding: 1rem;
    }
    
    .ailife-course-title {
        font-size: 1rem;
    }
    
    .ailife-tags-container {
        gap: 0.5rem;
    }
    
    .ailife-tag-button {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }
    .ailife-filters-with-reset{
        display: block;

    }
    .ailife-filter-actions {
        display: block;
        text-align: center;
        margin-top: 20px;
    }
}
