/* =============================================
   AgriGreenSkills - Modules page styles
   =============================================
   Contains the dedicated module list layout and card styles.
*/

.modules-page {
    padding: 130px 40px 70px;
    min-height: calc(100vh - 180px);
}

.modules-page h1 {
    font-size: 34px;
    font-weight: normal;
    color: #505050;
    text-align: center;
}

.modules-page-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 42px;
}

.module-group {
    margin-bottom: 56px;
}

.module-group:last-child {
    margin-bottom: 0;
}

.module-group h2 {
    font-size: 30px;
    font-weight: normal;
    color: #505050;
    margin-bottom: 12px;
    text-align: center;
}

.module-progress {
    max-width: 360px;
    margin: 0 auto 24px;
    text-align: center;
    color: #666;
    font-size: 13px;
    font-weight: 700;
}

.module-progress-track {
    height: 8px;
    background: #edf3ef;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.module-progress-bar {
    height: 100%;
    background: #3a9e6e;
    border-radius: inherit;
}

.module-progress.is-complete .module-progress-bar {
    background: #e7b52f;
}

.img-placeholder {
    position: relative;
    overflow: hidden;
    background: #e2ece5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
}

.img-placeholder img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: transform .2s, box-shadow .2s;
}

.card.is-completed {
    border-color: #cfe8d8;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .06);
}

.card-img-wrap {
    width: 100%;
    height: 315px;
}

.card-body {
    padding: 16px;
}

.card-body h3 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.card-body p {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

.card-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    background: #e8f5ed;
    color: #3a9e6e;
    border-radius: 8px;
    padding: 2px 8px;
    margin-bottom: 6px;
}

.lesson-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.lesson-card-meta .card-badge {
    margin-bottom: 0;
}

.lesson-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    color: #2a7a4b;
    background: #edf8f1;
    border-radius: 50%;
    padding: 0;
    font-size: 15px;
    font-weight: 800;
}

.lesson-status.completed {
    background: #3a9e6e;
    color: #fff;
    box-shadow: 0 6px 18px rgba(58, 158, 110, 0.28);
}

.btn-lesson {
    display: inline-block;
    margin-top: 12px;
    background: none;
    border: 1.5px solid #D74750;
    color: #D74750;
    border-radius: 20px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, color .2s;
}

.btn-lesson:hover {
    background: #D74750;
    color: #fff;
}

@media (max-width: 900px) {
    .modules-page .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 620px) {
    .modules-page {
        padding: 105px 24px 50px;
    }

    .modules-page .cards {
        grid-template-columns: 1fr;
    }
}
