/* ================================================================
   MFR MASTER INTEGRATED CSS (v3.0 - CLEANED)
   - Zero Duplicates
   - Fully Responsive
   - Fixed Slider Logic
   ================================================================ */

:root {
    --mfr-teal: #008080;
    --mfr-dark: #004d40;
    --mfr-light: #e6f1ef;
    --white: #ffffff;
    --bg: #f4f7f6;
    --red: #d9534f;
    --whatsapp: #25d366;
}

/* --- BASIC STRUCTURE --- */
body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    padding-top: 110px; /* Space for the fixed header */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    width: 100%;
}

/* --- HEADER (FIXED TOP) --- */
header {
    background: var(--white);
    padding: 12px 20px;
    text-align: center;
    border-bottom: 5px solid var(--mfr-teal);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.header-logo {
    height: 60px;
    max-width: 70%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.footer-logo {
    height: 55px;
    max-width: 70%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* --- IMAGE SLIDER --- */
.slider-container {
    width: 100%;
    height: 800px; /* Restored original height */
    position: relative;
    overflow: hidden;
    background: #000;
}

.slide {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.slide.active { 
    opacity: 1; 
    z-index: 2;
}

.slide-overlay {
    background: rgba(0, 109, 91, 0.7);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 12px;
    max-width: 80%;
    z-index: 3;
}

.slide-overlay h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* --- SLIDER NAVIGATION --- */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 24px;
    z-index: 100;
    transition: 0.3s;
}

.slider-arrow:hover {
    background: var(--mfr-teal);
}

.slider-arrow.prev { left: 10px; border-radius: 5px; }
.slider-arrow.next { right: 10px; border-radius: 5px; }

.dot-container {
    position: absolute;
    bottom: 25px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 100;
}

.dot {
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.dot.active {
    background: var(--white);
    transform: scale(1.3);
}


/* --- COURSE GRID & CARDS --- */
/* --- COURSE GRID --- */
#course-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
    width: 100%;
}

.course-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow: hidden;
    height: 100%;
}

.course-card:hover { 
    transform: translateY(-5px); 
}

.course-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* --- PULSE ANIMATION --- */
.pulse-circle {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* --- COUNTDOWN TIMER --- */
.countdown-timer {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--red);
    background: #fff5f5;
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    border: 1px solid #ffebeb;
}

/* --- FORM GROUPS --- */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    display: block;
}

input, select {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
}

/* --- PARTICIPANT CARDS --- */
.participant-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 6px solid var(--mfr-teal);
}

.roster-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* --- PAYMENT OPTIONS --- */
.pay-opt {
    padding: 15px;
    background: #eee;
    cursor: pointer;
    border-radius: 8px;
    flex: 1;
    text-align: center;
    transition: 0.3s;
    font-weight: bold;
}

.pay-opt.active-pay {
    background: var(--mfr-teal);
    color: white;
}

/* --- ACCREDITATION --- */
.accreditation-box {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
}

.accreditation-logos {
    display: flex;
    justify-content: center;
    gap: 30px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.accreditation-logos img {
    height: 80px;
    max-width: 140px;
    object-fit: contain;
}


/* --- FOOTER & FLOATING --- */
footer { background: #1a1a1a; color: #fff; padding: 60px 20px; text-align: center; }

.social-links-row {
    display: flex; justify-content: center; gap: 25px; flex-wrap: wrap; margin-bottom: 30px;
}
.social-links-row a { color: #fff; text-decoration: none; font-size: 1.2rem; transition: 0.3s; }
.social-links-row a:hover { color: var(--mfr-teal); }

.floating-wa {
    position: fixed; bottom: 24px; right: 20px;
    background-color: var(--whatsapp); color: white;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; z-index: 9999; text-decoration: none;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.floating-wa:hover { transform: scale(1.1); }

/* --- BUTTONS --- */
.reg-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-select { background: var(--mfr-teal); color: white; }
.btn-remove { background: var(--red); color: white; }
.reg-btn:hover { opacity: 0.9; }

/* --- COURSE CARD COMPONENT STYLES (moved from inline HTML) --- */
.status-row { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; font-weight: bold; color: #22c55e; margin-bottom: 12px; text-transform: uppercase; }
.status-row.closed-row { color: #ef4444; }

.pulse-dot { width: 9px; height: 9px; background-color: #22c55e; border-radius: 50%; animation: pulse-glow 2s infinite; }
.pulse-dot.closed-dot { background-color: #ef4444; animation: none; }

@keyframes pulse-glow {
    0%   { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70%  { transform: scale(1);   box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.course-desc {
    font-size: 0.9rem; color: #555; line-height: 1.5;
    margin-bottom: 15px;
    /* Full description shown — no height cap, no line clamp */
}

.course-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 15px; min-height: 85px; }
.meta-item { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: #666; background: #f8fbfb; padding: 6px; border-radius: 4px; border: 1px solid #eef5f5; }
.meta-item i { color: #008080; width: 14px; text-align: center; }

.early-bird-badge { background: #fff3cd; border: 1px solid #ffc107; color: #856404; padding: 6px 10px; border-radius: 5px; font-size: 0.75rem; font-weight: bold; margin-bottom: 10px; text-align: center; }
.cert-badge { display: inline-block; background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; padding: 3px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; margin-bottom: 8px; }
.accred-badge { display: inline-block; background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; padding: 3px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; margin-bottom: 8px; margin-left: 4px; }
.waitlist-notice { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 8px; border-radius: 5px; font-size: 0.78rem; font-weight: bold; text-align: center; margin-bottom: 10px; }

/* --- SUCCESS OVERLAY --- */
#success-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 10000;
    justify-content: center; align-items: center; padding: 20px;
    box-sizing: border-box;
}

/* --- PAYMENT ROW --- */
.squeezed-payment-row { display: flex; gap: 8px; margin: 20px 0; }

/* ================================================================
   MASTER RESPONSIVE RULES
   Breakpoints: 768px (tablet), 480px (large phone), 360px (small phone)
   ================================================================ */

/* --- TABLET (≤768px) --- */
@media (max-width: 768px) {
    body { padding-top: 78px; }

    .header-logo { height: 48px; max-width: 65%; }
    .footer-logo { height: 46px; max-width: 65%; }

    /* Slider */
    .slider-container { height: 320px; }
    .slide-overlay { padding: 20px; max-width: 90%; }
    .slide-overlay h1 { font-size: 1.4rem; margin-bottom: 6px; }
    .slide-overlay p { font-size: 0.9rem; margin: 0; }
    .slider-arrow { padding: 10px 14px; font-size: 18px; }

    /* Course grid — 2 columns on tablet */
    #course-list { grid-template-columns: repeat(2, 1fr); gap: 20px; }

    /* Accreditation logos */
    .accreditation-logos img { height: 60px; max-width: 110px; }
    .accreditation-box { padding: 40px 15px; }
}

/* --- LARGE PHONE (≤480px) --- */
@media (max-width: 480px) {
    body { padding-top: 65px; }

    /* Header & logos */
    header { padding: 8px 15px; }
    .header-logo { height: 40px; max-width: 62%; }
    .footer-logo { height: 38px; max-width: 62%; }

    /* Slider */
    .slider-container { height: 250px; }
    .slide-overlay { padding: 14px; max-width: 92%; border-radius: 8px; }
    .slide-overlay h1 { font-size: 1.1rem; }
    .slide-overlay p { font-size: 0.78rem; }
    .slider-arrow { padding: 8px 12px; font-size: 16px; }
    .dot { width: 10px; height: 10px; }

    /* Course grid — single column */
    #course-list { grid-template-columns: 1fr; gap: 16px; margin-top: 24px; }
    .course-img { height: 170px; }
    .course-meta { grid-template-columns: 1fr 1fr; gap: 6px; min-height: unset; }
    .course-desc { /* full description — no clamp */ }

    /* Container */
    .container { padding: 0 12px; }

    /* Section headings */
    h2 { font-size: 1.1rem !important; }

    /* Registration section — BUG 5 */
    #registration-section { padding: 18px 12px !important; margin: 24px 0 !important; border-radius: 10px !important; }

    /* Registration type toggle buttons — BUG 6: stack on small screens */
    #registration-section > div:first-of-type { flex-direction: column; gap: 8px; }

    /* Leader form grid — single column */
    #registration-section div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Participant cards */
    .participant-card { padding: 14px; }
    .roster-grid { grid-template-columns: 1fr; }

    /* BUG 7: license+whatsapp row — stack on small screens */
    .participant-card > div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 8px !important;
    }

    /* Payment row */
    .squeezed-payment-row { flex-wrap: wrap; gap: 8px; }
    .pay-opt { flex: 1 1 45%; font-size: 0.8rem; padding: 10px 4px; }

    /* Summary box */
    .summary-box { font-size: 0.9rem; }

    /* Submit button */
    #submitBtn { padding: 16px; font-size: 0.95rem; }

    /* WhatsApp — fully on screen */
    .floating-wa { width: 50px; height: 50px; font-size: 24px; bottom: 16px; right: 14px; }

    /* Footer */
    footer { padding: 36px 15px 24px 15px; }

    /* Accreditation */
    .accreditation-logos { gap: 16px; }
    .accreditation-logos img { height: 50px; max-width: 90px; }
    .accreditation-box { padding: 30px 12px; }
}

/* --- SMALL PHONE (≤360px) --- */
@media (max-width: 360px) {
    body { padding-top: 60px; }

    header { padding: 6px 10px; }
    .header-logo { height: 34px; max-width: 60%; }
    .footer-logo { height: 32px; max-width: 60%; }

    .slider-container { height: 200px; }
    .slide-overlay { padding: 10px; max-width: 94%; }
    .slide-overlay h1 { font-size: 0.9rem; }
    .slide-overlay p { display: none; }

    #course-list { gap: 12px; }
    .course-img { height: 150px; }
    .meta-item { font-size: 0.65rem; }

    /* Registration section */
    #registration-section { padding: 12px 8px !important; }

    /* BUG 6: toggle buttons always stacked on tiny screens */
    #registration-section > div:first-of-type {
        flex-direction: column !important;
        gap: 8px !important;
    }

    /* BUG 5: toggle button font size */
    #type-single, #type-group {
        font-size: 0.82rem !important;
        padding: 12px 8px !important;
    }

    /* Stack payment options vertically */
    .pay-opt { flex: 1 1 100%; }

    /* BUG 7: always stack license+whatsapp inputs */
    .participant-card > div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 8px !important;
    }

    /* Prevent iOS auto-zoom on input focus */
    input, select, textarea { font-size: 16px !important; }

    .container { padding: 0 8px; }

    .floating-wa { width: 44px; height: 44px; font-size: 21px; bottom: 12px; right: 10px; }
}
/* ── Body selector buttons (MDC / NMC) on course cards ── */
.body-select-btn {
    flex: 1;
    padding: 10px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.body-btn-mdc {
    border: 2px solid #c5e0da;
    background: #fff;
    color: #008080;
}
.body-btn-mdc:hover {
    border-color: #008080;
    background: #e6f4f1;
}
.body-btn-mdc-active {
    border: 2px solid #008080;
    background: #008080;
    color: #fff;
}
.body-btn-nmc {
    border: 2px solid #c7d2fe;
    background: #fff;
    color: #3730a3;
}
.body-btn-nmc:hover {
    border-color: #3730a3;
    background: #e0e7ff;
}
.body-btn-nmc-active {
    border: 2px solid #3730a3;
    background: #3730a3;
    color: #fff;
}
