/* Courses Page Specific Styles */

/* Courses Hero Section */
.courses-hero {
    background: radial-gradient(1200px 500px at 50% -200px, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 60%),
        linear-gradient(135deg, #3B82F6 0%, #1e40af 100%);
    padding: 7rem 0 4.5rem;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.courses-hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.courses-hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1100px, 90%);
    height: 120px;
    background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
    filter: blur(40px);
}

.courses-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.courses-subtitle {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Search and Filter Container */
.search-filter-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.15);
}

.search-bar {
    position: relative;
    margin-bottom: 1.25rem;
}

.search-bar svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    z-index: 1;
}

.search-bar input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-bar input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Recent searches */
.recent-searches {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.recent-searches.hidden { display: none; }

.recent-searches .chip {
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.14);
    color: #fff;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.recent-searches .chip:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.45);
}

.filter-dropdowns {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.filter-dropdown {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.22);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    min-width: 150px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.filter-dropdown:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.45);
}

.filter-dropdown:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.filter-dropdown:focus-visible {
    outline: 3px solid rgba(255,255,255,0.4);
    outline-offset: 2px;
}

.filter-dropdown option {
    background: #1f2937;
    color: white;
}

.results-count {
    text-align: center;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.92rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.results-count span {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
}

/* All Courses Section */
.all-courses {
    background: #f8fafc;
    padding: 5.5rem 0;
    min-height: 60vh;
}

.all-courses .courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.2rem;
}

.all-courses .course-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
    transition: all 0.35s ease;
    border: 1px solid #eef2f7;
    opacity: 1;
    transform: scale(1);
    position: relative;
}

.all-courses .course-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
    border-color: #e5eaf1;
}

.all-courses .course-card.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* Accent strip */
.all-courses .course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3B82F6, #8b5cf6, #06b6d4);
    opacity: 0.9;
}

/* Course card header and elements refinement */
.all-courses .course-header {
    background: linear-gradient(135deg, #3B82F6 0%, #1e40af 100%);
    color: #fff;
}

.all-courses .course-tag {
    background: #eef2ff;
    color: #4338ca;
    border-radius: 999px;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
}

.all-courses .course-price {
    color: #0ea5e9;
    font-size: 1.8rem;
    margin-bottom: 1.25rem;
}

.all-courses .course-btn {
    background: linear-gradient(135deg, #3B82F6 0%, #1e40af 100%);
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.25);
}

.all-courses .course-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(59, 130, 246, 0.35);
    filter: brightness(1.02);
}

/* Course Description */
.course-description {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Advanced Difficulty Badge */
.difficulty-badge.advanced {
    background: #dc2626;
    color: white;
}

/* Subtle badge glow */
.difficulty-badge {
    box-shadow: 0 6px 18px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(255,255,255,0.3);
}

/* Responsive Design for Courses Page */
@media (max-width: 1024px) {
    .courses-hero {
        padding: 4.5rem 0 3rem;
    }
    
    .courses-hero-content {
        padding: 0 1.5rem;
    }
    
    .course-filters {
        gap: 0.75rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .all-courses .courses-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.6rem;
    }
}

@media (max-width: 768px) {
    .courses-hero {
        padding: 3.5rem 0 2.2rem;
    }
    
    .courses-hero-content {
        padding: 0 1rem;
    }
    
    .search-filter-container {
        padding: 0.75rem 1rem 1rem;
    }
    
    .search-bar {
        margin-bottom: 1.5rem;
    }
    
    .filter-dropdowns {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
        margin-bottom: 0.75rem;
    }
    
    .filter-dropdown {
        width: 100%;
        max-width: 250px;
    }
    
    .all-courses {
        padding: 3.2rem 0;
    }
    
    .all-courses .courses-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 0 1rem;
    }
    
    .all-courses .course-header {
        padding: 1.5rem;
    }
    
    .all-courses .course-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .courses-hero {
        padding: 2.2rem 0 1.5rem;
    }
    
    .courses-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .all-courses {
        padding: 2.2rem 0;
    }
    
    .all-courses .course-header {
        padding: 1rem;
    }
    
    .all-courses .course-content {
        padding: 1rem;
    }
    
    .course-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Animation for filter transitions */
.course-card {
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.course-card.filtering {
    opacity: 0;
    transform: scale(0.8);
}

/* Micro interactions */
.course-card:hover .course-title {
    color: #0f172a;
}

.meta-item svg {
    opacity: 0.8;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.course-card:hover .meta-item svg {
    transform: translateY(-2px);
    opacity: 1;
}

/* Loading state */
.courses-loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-size: 1.1rem;
}

.courses-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #3B82F6;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Course Outline Styles */
.course-outline {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    border-left: 4px solid #3B82F6;
}

.course-outline h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.outline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.outline-list li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.4;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.outline-list li:last-child {
    border-bottom: none;
}

.outline-list li strong {
    color: #1e40af;
    font-weight: 600;
}