/* ───────────────────────────────────────────────
   COURSE MODAL STYLES
─────────────────────────────────────────────── */
.course-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeOverlayIn 0.25s ease;
}
.course-modal-overlay.active {
    display: flex;
}
@keyframes fadeOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.course-modal-container {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 750px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
    animation: slideModalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    scroll-behavior: smooth;
}
@keyframes slideModalIn {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.course-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.course-modal-close:hover {
    background: #f44336;
    color: #fff;
    transform: rotate(90deg);
}

/* Header with gradient */
.course-modal-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 50px 36px 32px;
    position: relative;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    align-items: flex-end;
}
.course-modal-header.has-image {
    background-size: cover;
    background-position: center;
}
.course-modal-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 100%);
}
.course-modal-header-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.course-modal-badge {
    display: inline-block;
    background: #f6a623;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 50px;
    margin-bottom: 10px;
}

.course-modal-title {
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 14px;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.course-modal-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.course-meta-chip {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Body */
.course-modal-body {
    padding: 30px 36px;
}

.course-modal-short {
    font-size: 15px;
    color: #555;
    line-height: 1.7;
    margin: 0 0 16px;
}

.course-modal-divider {
    border: none;
    border-top: 2px solid #f0f0f0;
    margin: 16px 0 24px;
}

/* Rich text rendered from Quill */
.course-modal-full.ql-rendered {
    font-size: 15px;
    color: #333;
    line-height: 1.8;
}
.course-modal-full.ql-rendered h1,
.course-modal-full.ql-rendered h2,
.course-modal-full.ql-rendered h3 {
    margin: 18px 0 8px;
    color: #1a1a2e;
    font-weight: 700;
}
.course-modal-full.ql-rendered ul,
.course-modal-full.ql-rendered ol {
    padding-left: 24px;
    margin: 10px 0;
}
.course-modal-full.ql-rendered ul li {
    list-style: disc;
    margin-bottom: 6px;
}
.course-modal-full.ql-rendered ol li {
    list-style: decimal;
    margin-bottom: 6px;
}
.course-modal-full.ql-rendered strong { font-weight: 700; }
.course-modal-full.ql-rendered em    { font-style: italic; }
.course-modal-full.ql-rendered u     { text-decoration: underline; }
.course-modal-full.ql-rendered blockquote {
    border-left: 4px solid #f6a623;
    padding: 8px 16px;
    margin: 16px 0;
    background: #fff8ee;
    color: #555;
    border-radius: 0 8px 8px 0;
}

/* ── Fee Breakdown Panel ── */
.course-fee-panel {
    margin-top: 24px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff8f0 100%);
    border: 1.5px solid #f0e8d8;
    border-radius: 16px;
    overflow: hidden;
}
.course-fee-panel-title {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.course-fee-panel-title i { color: #f6a623; }

.course-fee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0;
}
.course-fee-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-right: 1.5px solid rgba(240,232,216,0.8);
    border-bottom: 1.5px solid rgba(240,232,216,0.8);
    transition: background 0.18s;
}
.course-fee-item:last-child { border-right: none; }
.course-fee-item:hover { background: rgba(246,166,35,0.06); }

.course-fee-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.course-fee-icon.reg    { background: #e8f0fe; color: #1a73e8; }
.course-fee-icon.course { background: #fff3e0; color: #e65100; }
.course-fee-icon.topup  { background: #e8f5e9; color: #2e7d32; }

.course-fee-info { display: flex; flex-direction: column; }
.course-fee-label {
    font-size: 11px; font-weight: 600; color: #999;
    text-transform: uppercase; letter-spacing: 0.6px;
}
.course-fee-value {
    font-size: 16px; font-weight: 800;
    color: #1a1a2e; margin-top: 2px;
}

/* Free badge */
.course-fee-free {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px;
    font-size: 15px; font-weight: 700; color: #2e7d32;
}
.course-fee-free i { font-size: 20px; }

/* CTA */
.course-modal-cta {
    margin-top: 28px;

    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.btn-enroll {
    background: linear-gradient(135deg, #f6a623, #e8890a);
    color: #fff;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(246,166,35,0.35);
    border: none;
    cursor: pointer;
}
.btn-enroll:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(246,166,35,0.5);
    color: #fff;
    text-decoration: none;
}
.btn-close-modal {
    background: #f5f5f5;
    color: #555;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-close-modal:hover { background: #e0e0e0; }

/* Scrollbar styling inside modal */
.course-modal-container::-webkit-scrollbar { width: 6px; }
.course-modal-container::-webkit-scrollbar-track { background: #f1f1f1; }
.course-modal-container::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

@media (max-width: 576px) {
    .course-modal-header { padding: 40px 20px 24px; }
    .course-modal-body   { padding: 20px; }
    .course-modal-title  { font-size: 20px; }
}
