/* Courses Pages Styles */

/* Hero Section */
.courses-hero {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e293b 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.courses-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.courses-hero p {
    font-size: 1.125rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
}

/* Courses Section */
.courses-section {
    padding: 60px 0;
    background: var(--bg-secondary);
    min-height: 60vh;
}

/* Loading State */
.courses-loading {
    text-align: center;
    padding: 4rem 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Course Card */
.course-card {
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-blue);
}

.course-card.featured {
    border-color: var(--primary-blue);
    background: linear-gradient(to bottom, #eff6ff 0%, white 100%);
}

.course-card.coming-soon {
    opacity: 0.8;
}

.coming-soon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: 16px;
    z-index: 1;
}

.featured-badge {
    position: absolute;
    top: -12px;
    right: 24px;
    background: var(--primary-blue);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.free-badge {
    background: var(--success-green);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}

/* Course Header */
.course-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.course-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

/* Course Description */
.course-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

/* Course Meta */
.course-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.meta-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-light);
}

/* Course Stats */
.course-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

/* Progress Section */
.progress-section {
    margin-bottom: 1.5rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.progress-header span:first-child {
    color: var(--text-secondary);
}

.progress-header span:last-child {
    color: var(--primary-blue);
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-blue-dark));
    transition: width 0.5s ease;
}

/* Course Features */
.course-features {
    margin-bottom: 1.5rem;
}

.feature-item {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.375rem 0;
}

/* Course Footer */
.course-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Price Section */
.price-section {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.original-price {
    color: var(--text-light);
    text-decoration: line-through;
    font-size: 1rem;
}

.price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-blue);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-success {
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    flex: 1;
    text-align: center;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-success {
    background: var(--success-green);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn-retry {
    background: var(--primary-blue);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-retry:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
}

/* Error State */
.error-state {
    text-align: center;
    padding: 4rem 0;
}

.error-state p {
    color: var(--error-red);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    position: relative;
    z-index: 1;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary);
    transform: rotate(90deg);
}

.modal-header h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.modal-header p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Active Navigation Link */
.nav-link-active {
    color: var(--primary-blue);
    font-weight: 600;
}

/* My Courses Specific */
.my-courses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.my-courses-header h2 {
    margin: 0;
}

.course-filters {
    display: flex;
    gap: 1rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light);
    background: white;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .courses-hero h1 {
        font-size: 2rem;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .course-card {
        padding: 1.5rem;
    }
    
    .course-header h3 {
        font-size: 1.25rem;
    }
    
    .course-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .price-section {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .price {
        font-size: 1.5rem;
    }
    
    .my-courses-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .course-filters {
        width: 100%;
        overflow-x: auto;
    }
}