/* にしけい講座フィルター - スタイルシート v1.0.4 */

/* ========================================
   基本設定
======================================== */
.ncf-container {
    font-family: 'Hiragino Sans', 'Yu Gothic', sans-serif;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========================================
   フィルターセクション
======================================== */
.ncf-filters {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ncf-filters h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
    text-align: center;
}

.ncf-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.ncf-filter-group {
    display: flex;
    flex-direction: column;
}

.ncf-filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.ncf-filter-select {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: all 0.3s ease;
    min-height: 44px;
    cursor: pointer;
}

.ncf-filter-select:focus {
    border-color: #ae0000;
    outline: none;
    box-shadow: 0 0 0 3px rgba(174, 0, 0, 0.1);
}

.ncf-filter-select:hover {
    border-color: #ae0000;
}

/* ========================================
   アクションボタン（赤色ベース）
======================================== */
.ncf-filter-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.ncf-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 140px;
}

.ncf-btn-primary {
    background: #ae0000;
    color: white;
    box-shadow: 0 3px 8px rgba(174, 0, 0, 0.3);
}

.ncf-btn-primary:hover {
    background: #8b0000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(174, 0, 0, 0.4);
    color: white;
    text-decoration: none;
}

.ncf-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(174, 0, 0, 0.3);
}

.ncf-btn-secondary {
    background: #f8f9fa;
    color: #ae0000;
    border: 2px solid #ae0000;
}

.ncf-btn-secondary:hover {
    background: #ae0000;
    color: white;
    transform: translateY(-1px);
    text-decoration: none;
}

.ncf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   結果表示エリア
======================================== */
.ncf-results-count {
    margin: 20px 0 15px 0;
    font-weight: 600;
    color: #333;
    text-align: center;
    font-size: 16px;
}

.ncf-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

/* ========================================
   講座カード
======================================== */
.ncf-course-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
}

.ncf-course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(174, 0, 0, 0.15);
    border-color: #ae0000;
}

/* 講座画像エリア */
.ncf-course-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #ae0000 0%, #d63031 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ncf-image-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.ncf-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.ncf-placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.ncf-course-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(174, 0, 0, 0.1);
    z-index: 1;
}

/* タグエリア */
.ncf-course-tags {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

/* 講座情報エリア */
.ncf-course-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ncf-course-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #2c3e50;
    line-height: 1.4;
    min-height: 50px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ncf-course-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ncf-course-title a:hover {
    color: #ae0000;
    text-decoration: none;
}

.ncf-course-excerpt {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
    line-height: 1.5;
    min-height: 60px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   講座メタ情報
======================================== */
.ncf-course-meta {
    margin-bottom: 20px;
    flex: 1;
}

.ncf-course-price {
    font-size: 20px;
    font-weight: 700;
    color: #ae0000;
    margin-bottom: 12px;
}

.ncf-course-details {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ncf-tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-block;
}

.ncf-tag-level.ncf-tag-beginner { 
    background: #e8f5e8; 
    color: #2e7d32; 
}

.ncf-tag-level.ncf-tag-intermediate { 
    background: #fff3e0; 
    color: #f57c00; 
}

.ncf-tag-level.ncf-tag-advanced { 
    background: #fce4ec; 
    color: #c2185b; 
}

.ncf-tag-subject { 
    background: #f3e5f5; 
    color: #7b1fa2; 
}

.ncf-sessions,
.ncf-format {
    font-size: 12px;
    padding: 6px 12px;
    background: #f8f9fa;
    color: #495057;
    border-radius: 16px;
    font-weight: 500;
    display: inline-block;
    white-space: nowrap;
}

/* ========================================
   講座アクション
======================================== */
.ncf-course-actions {
    padding: 0;
    margin-top: auto;
}

.ncf-course-actions .ncf-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    min-width: auto;
    margin: 0;
}

/* ========================================
   エラー・空状態
======================================== */
.ncf-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    border: 1px solid #f5c6cb;
}

.ncf-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    grid-column: 1 / -1;
}

.ncf-no-results h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #495057;
}

/* ========================================
   ローディング状態
======================================== */
.ncf-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    grid-column: 1 / -1;
}

.ncf-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ae0000;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ncf-loading.active {
    display: block;
}

/* ========================================
   レスポンシブ対応
======================================== */
@media (max-width: 768px) {
    .ncf-container {
        padding: 15px;
    }
    
    .ncf-filters {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .ncf-filter-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ncf-filter-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .ncf-btn {
        padding: 12px 20px;
        font-size: 14px;
        min-width: auto;
        width: 100%;
    }
    
    .ncf-courses-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 0;
    }
    
    .ncf-course-card {
        margin: 0 auto;
        max-width: 400px;
    }
    
    .ncf-course-image {
        height: 180px;
    }
    
    .ncf-course-info {
        padding: 15px;
    }
    
    .ncf-course-title {
        font-size: 16px;
        min-height: 40px;
    }
    
    .ncf-course-excerpt {
        min-height: 50px;
    }
    
    .ncf-course-meta {
        gap: 6px;
    }
    
    .ncf-tag {
        font-size: 10px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    body .ncf-container {
        padding: 10px !important;
    }
    
    body .ncf-filters {
        padding: 15px 10px !important;
        border-radius: 8px !important;
    }
    
    body .ncf-courses-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 0 5px !important;
        display: grid !important;
    }
    
    body .ncf-course-card {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        min-height: 480px !important;
        display: flex !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
    }
    
    body .ncf-course-image {
        height: 160px !important;
        flex-shrink: 0 !important;
        width: 100% !important;
    }
    
    body .ncf-course-info {
        padding: 12px !important;
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    body .ncf-course-title {
        font-size: 15px !important;
        margin-bottom: 8px !important;
        min-height: 55px !important;
        line-height: 1.3 !important;
    }
    
    body .ncf-course-tags {
        margin-bottom: 8px !important;
        min-height: 28px !important;
        display: flex !important;
        align-items: flex-start !important;
    }
    
    body .ncf-course-excerpt {
        min-height: 55px !important;
        font-size: 12px !important;
        flex: 1 !important;
    }
    
    body .ncf-course-price {
        font-size: 18px !important;
    }
    
    body .ncf-course-meta {
        margin-top: auto !important;
        padding-top: 8px !important;
    }
    
    body .ncf-tag {
        font-size: 9px !important;
        padding: 2px 5px !important;
    }
    
    body .ncf-course-actions {
        margin-top: 12px !important;
    }
}

/* ========================================
   アニメーション
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ncf-course-card {
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   アクセシビリティ対応
======================================== */
.ncf-filter-select:focus,
.ncf-btn:focus {
    outline: 2px solid #ae0000;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .ncf-course-card {
        animation: none;
    }
    
    .ncf-course-card:hover {
        transform: none;
    }
    
    .ncf-btn:hover {
        transform: none;
    }
    
    .ncf-spinner {
        animation: none;
    }
}

/* ========================================
   印刷対応
======================================== */
@media print {
    .ncf-filters,
    .ncf-filter-actions {
        display: none;
    }
    
    .ncf-course-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .ncf-course-card:hover {
        transform: none;
    }
}