/* =============================================================================
   Dr. Jackie Eldridge — Courses Plugin Frontend Styles
   Palette: Teal #3a6b65 | Gold #b89a5c | Dark #2d2d2d | Warm White #f7f5f1
   ============================================================================= */

/* ── Wrap ─────────────────────────────────────────────────────────────────── */
.dje-courses-wrap {
    font-family: inherit;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0 60px;
}

/* ── Grid ─────────────────────────────────────────────────────────────────── */
.dje-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.dje-course-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dje-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.dje-course-card.dje-sold-out {
    opacity: 0.75;
}

/* ── Image ────────────────────────────────────────────────────────────────── */
.dje-course-img-wrap {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: #f0ede8;
}

.dje-course-img-wrap .dje-course-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.dje-course-card:hover .dje-course-img {
    transform: scale(1.04);
}

.dje-sold-out-badge,
.dje-spots-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dje-sold-out-badge {
    background: rgba(45,45,45,0.85);
    color: #fff;
}

.dje-spots-badge {
    background: rgba(184,154,92,0.92);
    color: #fff;
}

/* ── Body ─────────────────────────────────────────────────────────────────── */
.dje-course-body {
    padding: 24px 26px 26px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dje-course-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d2d2d;
    margin: 0 0 12px;
    line-height: 1.3;
}

/* ── Meta (date / location) ───────────────────────────────────────────────── */
.dje-course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.dje-meta-item {
    font-size: 12px;
    color: #666;
    background: #f7f5f1;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e8e4de;
}

/* ── Description ──────────────────────────────────────────────────────────── */
.dje-course-description {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    flex: 1;
    margin-bottom: 20px;
}

.dje-course-description p:first-child { margin-top: 0; }
.dje-course-description p:last-child  { margin-bottom: 0; }

/* ── Footer (price + button) ─────────────────────────────────────────────── */
.dje-course-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f0ede8;
    padding-top: 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.dje-price-amount {
    font-size: 22px;
    font-weight: 700;
    color: #3a6b65;
    letter-spacing: -0.5px;
}

.dje-price-free {
    font-size: 18px;
    font-weight: 600;
    color: #3a6b65;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.dje-btn {
    display: inline-block;
    padding: 11px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.dje-btn-enroll {
    background: #3a6b65;
    color: #fff !important;
}

.dje-btn-enroll:hover {
    background: #2a4f4a;
    color: #fff !important;
    transform: translateY(-1px);
}

.dje-btn-enroll:active {
    transform: translateY(0);
}

.dje-btn-contact {
    background: transparent;
    color: #3a6b65 !important;
    border: 2px solid #3a6b65;
}

.dje-btn-contact:hover {
    background: #3a6b65;
    color: #fff !important;
}

.dje-btn-sold-out {
    background: #ccc;
    color: #888 !important;
    cursor: not-allowed;
}

/* ── Confirmation banner ─────────────────────────────────────────────────── */
.dje-confirmation {
    background: linear-gradient(135deg, #3a6b65 0%, #2a4f4a 100%);
    color: #fff;
    border-radius: 12px;
    padding: 32px 36px;
    margin-bottom: 40px;
    text-align: center;
}

.dje-confirmation-icon {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.dje-confirmation h3 {
    color: #fff;
    font-size: 22px;
    margin: 0 0 10px;
}

.dje-confirmation p {
    color: rgba(255,255,255,0.9);
    font-size: 15px;
    margin: 0;
}

/* ── Loading overlay ─────────────────────────────────────────────────────── */
#dje-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dje-loader {
    background: #fff;
    border-radius: 12px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.dje-loader p {
    margin: 16px 0 0;
    color: #555;
    font-size: 15px;
}

.dje-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #f0ede8;
    border-top-color: #3a6b65;
    border-radius: 50%;
    animation: dje-spin 0.8s linear infinite;
    margin: 0 auto;
}

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

/* ── Error modal ─────────────────────────────────────────────────────────── */
#dje-error-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dje-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.dje-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 40px 44px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.dje-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.dje-modal-icon {
    font-size: 40px;
    margin-bottom: 14px;
}

.dje-modal-box h3 {
    color: #2d2d2d;
    margin: 0 0 10px;
    font-size: 20px;
}

.dje-modal-box p {
    color: #666;
    margin: 0 0 20px;
}

/* ── No courses ─────────────────────────────────────────────────────────────*/
.dje-no-courses {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 40px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .dje-course-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .dje-course-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .dje-btn {
        width: 100%;
        text-align: center;
    }
    .dje-confirmation {
        padding: 24px 20px;
    }
}
