/* ============================================================
   Fixly Course Manager — Public CSS
   ============================================================ */

/* ---- Reset & Base ---- */
.fcm-courses-grid,
.fcm-dashboard,
.fcm-lesson-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* ---- Course Grid ---- */
.fcm-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 16px 0;
}

.fcm-course-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.fcm-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
}
.fcm-course-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.fcm-course-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.fcm-course-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #111;
}
.fcm-course-desc {
    color: #6b7280;
    font-size: .9rem;
    margin: 0;
    flex: 1;
}
.fcm-course-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: .85rem;
}
.fcm-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #e11d48;
}
.fcm-access {
    color: #6b7280;
    font-size: .8rem;
}
.fcm-enrolled-badge {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
}

/* ---- Buttons ---- */
.fcm-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background .2s, opacity .2s;
}
.fcm-btn:disabled { opacity: .6; cursor: not-allowed; }
.fcm-btn-primary { background: #e2136e; color: #fff; }
.fcm-btn-primary:hover { background: #c0115c; color: #fff; }
.fcm-btn-secondary { background: #f3f4f6; color: #374151; }
.fcm-btn-secondary:hover { background: #e5e7eb; }
.fcm-btn-sm { padding: 6px 14px; font-size: .82rem; }

/* ---- Modal ---- */
.fcm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.fcm-modal-inner {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.fcm-modal-inner h3 { margin: 0 0 12px; font-size: 1.3rem; }
.fcm-modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none; border: none;
    font-size: 1.5rem; cursor: pointer; color: #9ca3af;
}
.fcm-modal-close:hover { color: #111; }
#fcm-modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.fcm-spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 3px solid #e2136e;
    border-top-color: transparent;
    border-radius: 50%;
    animation: fcm-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes fcm-spin { to { transform: rotate(360deg); } }

/* ---- Lesson Player ---- */
.fcm-lesson-wrap { max-width: 860px; margin: 0 auto; }
.fcm-lesson-title { font-size: 1.4rem; margin-bottom: 16px; }
.fcm-player-container { position: relative; }
.fcm-video-wrapper { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.fcm-watermark {
    position: absolute;
    top: 18px; right: 18px;
    color: rgba(255,255,255,.35);
    font-size: .75rem;
    pointer-events: none;
    user-select: none;
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
    white-space: nowrap;
    letter-spacing: .04em;
}
.fcm-access-denied {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 28px;
    text-align: center;
    color: #7f1d1d;
}
.fcm-access-denied p { font-size: 1.05rem; margin-bottom: 16px; }

/* ---- Quiz ---- */
.fcm-quiz-section {
    margin-top: 32px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
}
.fcm-quiz-section h3 { margin: 0 0 16px; }
.fcm-question { margin-bottom: 20px; }
.fcm-question-text { margin: 0 0 10px; }
.fcm-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background .15s;
}
.fcm-option:hover { background: #eff6ff; border-color: #93c5fd; }
.fcm-option input[type="radio"] { accent-color: #e2136e; }
.fcm-quiz-feedback { margin-top: 16px; padding: 12px 16px; border-radius: 8px; font-weight: 600; }
.fcm-quiz-feedback.passed { background: #d1fae5; color: #065f46; }
.fcm-quiz-feedback.failed  { background: #fee2e2; color: #991b1b; }
.fcm-quiz-result.fcm-passed {
    background: #d1fae5; color: #065f46;
    padding: 10px 16px; border-radius: 8px; margin-bottom: 16px;
}

/* ---- Resources ---- */
.fcm-resources-section { margin-top: 24px; }
.fcm-resource-list { list-style: none; padding: 0; }
.fcm-resource-list li { margin-bottom: 6px; }
.fcm-resource-link { color: #1d4ed8; text-decoration: none; }
.fcm-resource-link:hover { text-decoration: underline; }

/* ---- Dashboard ---- */
.fcm-dashboard { max-width: 900px; margin: 0 auto; }
.fcm-dashboard-header { margin-bottom: 24px; }
.fcm-dashboard-header h2 { margin: 0 0 4px; font-size: 1.6rem; }
.fcm-dashboard-email { color: #6b7280; margin: 0; }

.fcm-stat-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
}
.fcm-stat {
    flex: 1;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}
.fcm-stat-num { display: block; font-size: 2rem; font-weight: 700; color: #111; }
.fcm-stat-num.fcm-green { color: #059669; }
.fcm-stat-num.fcm-red   { color: #dc2626; }
.fcm-stat-label { font-size: .82rem; color: #6b7280; }

.fcm-section-title { font-size: 1.2rem; font-weight: 600; margin: 0 0 16px; }

.fcm-dashboard-courses { display: flex; flex-direction: column; gap: 20px; }

.fcm-dashboard-course-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.fcm-dashboard-course-card.expired { border-color: #fca5a5; }

.fcm-dcc-header {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
}
.fcm-dcc-thumb {
    width: 80px; height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.fcm-dcc-info h4 { margin: 0 0 4px; font-size: 1.05rem; }
.fcm-days-left { font-size: .82rem; color: #059669; margin-left: 8px; }

.fcm-progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.fcm-progress-bar {
    flex: 1;
    background: #e5e7eb;
    border-radius: 99px;
    height: 10px;
    overflow: hidden;
}
.fcm-progress-fill {
    height: 100%;
    background: linear-gradient(to right, #e2136e, #f97316);
    border-radius: 99px;
    transition: width .4s ease;
}
.fcm-progress-label { font-size: .82rem; color: #6b7280; white-space: nowrap; }

.fcm-module-list { margin: 0 0 14px; }
.fcm-module-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 6px;
    overflow: hidden;
}
.fcm-module-item summary {
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    background: #f9fafb;
    user-select: none;
}
.fcm-module-item summary:hover { background: #f3f4f6; }
.fcm-lesson-count { font-weight: normal; color: #6b7280; font-size: .85rem; }
.fcm-lesson-list { list-style: none; padding: 8px 14px; margin: 0; background: #fff; }
.fcm-lesson-item { padding: 6px 0; border-bottom: 1px solid #f3f4f6; font-size: .9rem; }
.fcm-lesson-item:last-child { border-bottom: none; }
.fcm-lesson-item.locked { color: #9ca3af; }
.fcm-lesson-item a { color: #1d4ed8; text-decoration: none; }
.fcm-lesson-item a:hover { text-decoration: underline; }
.fcm-duration { color: #9ca3af; font-size: .8rem; margin-left: 6px; }
.fcm-unlock-info { font-size: .78rem; color: #d97706; margin-left: 8px; }

.fcm-resource-section { font-size: .9rem; margin: 10px 0; }
.fcm-resource-section ul { list-style: none; padding-left: 12px; margin: 4px 0; }
.fcm-resource-section a { color: #1d4ed8; }

.fcm-cert-section {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- Badges ---- */
.fcm-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: .78rem;
    font-weight: 600;
}
.fcm-badge-active,
.fcm-badge-publish,
.fcm-badge-completed { background: #d1fae5; color: #065f46; }
.fcm-badge-expired,
.fcm-badge-cancelled { background: #fee2e2; color: #991b1b; }
.fcm-badge-draft     { background: #f3f4f6; color: #6b7280; }
.fcm-badge-pending   { background: #fef3c7; color: #92400e; }
.fcm-badge-failed    { background: #fee2e2; color: #991b1b; }

/* ---- Notices ---- */
.fcm-notice { padding: 12px 16px; background: #eff6ff; border-left: 4px solid #3b82f6; border-radius: 4px; }
.fcm-error  { padding: 12px 16px; background: #fef2f2; border-left: 4px solid #ef4444; border-radius: 4px; color: #7f1d1d; }

.fcm-empty-state { text-align: center; padding: 48px 16px; color: #6b7280; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .fcm-courses-grid { grid-template-columns: 1fr; }
    .fcm-stat-bar { flex-direction: column; }
    .fcm-dcc-header { flex-direction: column; align-items: flex-start; }
}
