﻿/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

    .page-header h1 {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 10px;
}

    .breadcrumb a {
        color: rgba(255, 255, 255, 0.8);
        transition: var(--transition);
    }

        .breadcrumb a:hover {
            color: var(--white);
        }

    .breadcrumb span {
        color: rgba(255, 255, 255, 0.8);
    }

.courses-section {
    background-color: var(--white);
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.course-card {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.course-image {
    height: 200px;
    background-color: #f5f7ff;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .course-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

@supports not (object-fit: cover) {
    .course-image {
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

        .course-image img {
            display: none;
        }
}

.course-content {
    padding: 20px;
}

.course-category {
    display: inline-block;
    background-color: rgba(74, 108, 247, 0.1);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.course-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
    line-height: 1.4;
}

.course-description {
    color: var(--light-text);
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    color: var(--light-text);
    font-size: 0.9rem;
}

.course-price {
    font-weight: 700;
    color: var(--primary-color);
}

.course-duration {
    display: flex;
    align-items: center;
    gap: 5px;
}

.course-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.course-image img.loading {
    opacity: 0;
}

.course-image.error {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

    .course-image.error::after {
        content: "📚";
    }


.course-image {
    aspect-ratio: 16 / 9;
    height: auto;
    background-color: #f5f7ff;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

    .course-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

@supports not (aspect-ratio: 16/9) {
    .course-image {
        height: 200px;
    }
}

.expandable-section {
    background-color: var(--bg-light);
    padding: 60px 0;
}

.expandable-content {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

    .expandable-content h2 {
        margin-bottom: 20px;
        font-size: 1.8rem;
        color: var(--text-color);
    }

.content-preview {
    position: relative;
    overflow: hidden;
    max-height: 120px; /* حدود 3 خط */
}

.content-full {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

    .content-full.expanded {
        max-height: 1000px; /* ارتفاع کافی برای نمایش کل محتوا */
    }

.read-more-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .read-more-btn:hover {
        color: var(--secondary-color);
    }

@media (max-width: 768px) {

    .page-header h1 {
        font-size: 2rem;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .expandable-content {
        padding: 25px;
    }
}
