/* ===================================
   Chapter Enrollment System — Style
   =================================== */

:root {
    --ce-primary:    #E8664A;
    --ce-primary-h:  #d45538;
    --ce-green:      #2ECC71;
    --ce-orange:     #F39C12;
    --ce-dark:       #1a1a2e;
    --ce-text:       #2d2d2d;
    --ce-muted:      #888;
    --ce-border:     #e8e8e8;
    --ce-bg:         #f4f6fb;
    --ce-white:      #ffffff;
    --ce-radius:     16px;
    --ce-shadow:     0 4px 24px rgba(0,0,0,.08);
    --ce-shadow-h:   0 8px 32px rgba(0,0,0,.15);
}

/* ── Wrapper ── */
.ce-wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; font-family: inherit; }

/* ── Filters ── */
/* ── Filters (NEW) ── */
.ce-filters { 
    background: #f5f5f5; 
    border-radius: var(--ce-radius); 
    padding: 16px 24px; 
    margin-bottom: 32px; 
}
.ce-filters-inner { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 16px; 
    align-items: center;
}

/* Button filter group */
.ce-filter-buttons-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 300px;
}

.ce-filter-btn {
    padding: 10px 18px;
    border: 2px solid #ddd;
    background: #fff;
    color: var(--ce-text);
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.ce-filter-btn:hover {
    border-color: var(--ce-primary);
    color: var(--ce-primary);
}

.ce-filter-btn.active {
    background: var(--ce-primary);
    color: #fff;
    border-color: var(--ce-primary);
}

/* Search wrapper */
.ce-search-wrapper {
    flex: 1;
    min-width: 200px;
}

.ce-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
    background: #fff;
}

.ce-search-input:focus {
    border-color: var(--ce-primary);
}

/* Pagination */
.ce-pagination {
    text-align: center;
    margin-top: 32px;
}

.ce-pagination-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ce-pagination-links a,
.ce-pagination-links span {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--ce-border);
    background: #fff;
    color: var(--ce-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all .2s;
}

.ce-pagination-links a:hover {
    border-color: var(--ce-primary);
    color: var(--ce-primary);
}

.ce-pagination-links .current {
    background: var(--ce-primary);
    color: #fff;
    border-color: var(--ce-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .ce-filters-inner {
        flex-direction: column;
    }
    .ce-filter-buttons-group {
        width: 100%;
    }
    .ce-search-wrapper {
        width: 100%;
    }
}

/* ── Grid ── */
.ce-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.ce-empty { grid-column: 1/-1; text-align: center; padding: 64px; color: var(--ce-muted); font-size: 18px; }

/* ── Card ── */
.ce-card { background: var(--ce-white); border-radius: var(--ce-radius); overflow: hidden; box-shadow: var(--ce-shadow); transition: transform .2s, box-shadow .2s; }
.ce-card .more-info{
        padding: 0 !important;
    background-color: transparent !important;
}
.ce-card:hover { transform: translateY(-4px); box-shadow: var(--ce-shadow-h); }
.ce-card.ce-hidden { display: none; }

.ce-card-image { position: relative; height: 200px; background-size: cover; background-position: center; }
.ce-card-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,.1) 50%, transparent 100%); }

.ce-card-status-badge { position: absolute; top: 14px; right: 14px; z-index: 2; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.ce-badge-open-now  { background: var(--ce-green);  color: #fff; }
.ce-badge-forming   { background: var(--ce-orange); color: #fff; }
.ce-badge-closed    { background: #bbb;              color: #fff; }

.ce-card-location { position: absolute; bottom: 14px; left: 14px; right: 14px; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; }
.ce-card-city  { font-size: 20px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: .04em; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.ce-card-state { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.85); }

.ce-card-body { padding: 18px 20px 20px; }
.ce-card-date { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--ce-primary); margin-bottom: 6px; text-transform: uppercase; }
.ce-card-title { font-size: 18px; font-weight: 700; color: var(--ce-text); margin: 0 0 0; line-height: 1.3; }

/* Progress bar */
.ce-spots-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ce-spots-label { font-size: 12px; font-weight: 700; color: var(--ce-text); white-space: nowrap; }
.ce-progress-bar { flex: 1; height: 6px; background: #e8e8e8; border-radius: 3px; overflow: hidden; }
.ce-progress-fill { height: 100%; background: linear-gradient(90deg, var(--ce-green), #27ae60); border-radius: 3px; transition: width .4s ease; }
.ce-spots-left { font-size: 12px; font-weight: 700; color: var(--ce-muted); white-space: nowrap; }
.ce-spots-left.ce-urgent { color: var(--ce-primary); }

/* Members row */
.ce-members-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.ce-avatars { display: flex; }
.ce-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ce-white); margin-left: -8px; object-fit: cover; }
.ce-avatars .ce-avatar:first-child { margin-left: 0; }
.ce-avatar-count { background: var(--ce-bg); color: var(--ce-muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ce-members-label { font-size: 13px; color: var(--ce-muted); }

/* Buttons */
.ce-btn { display: block; width: 100%; padding: 13px 20px; border-radius: 10px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-align: center; text-transform: uppercase; text-decoration: none; cursor: pointer; border: none; transition: background .2s, transform .1s, opacity .2s; }
.ce-btn:active { transform: scale(.98); }
.ce-btn-enroll  { background: var(--ce-primary); color: #fff; }
.ce-btn-enroll:hover { background: var(--ce-primary-h); color: #fff; }
.ce-btn-enrolled { background: var(--ce-primary); color: #fff; }
.ce-btn-enrolled:hover { background: var(--ce-primary-h); color: #fff; }
.ce-btn-full { background: #eee; color: #999; cursor: not-allowed; }
.ce-btn-full-w { width: 100%; }

/* ── Auth pages ── */
.ce-auth-wrap { display: flex; justify-content: center; padding: 40px 16px; }
.ce-auth-box { background: var(--ce-white); border-radius: var(--ce-radius); box-shadow: var(--ce-shadow-h); padding: 40px; width: 100%; max-width: 440px; }
.ce-auth-logo { font-size: 40px; text-align: center; margin-bottom: 12px; }
.ce-auth-box h2 { text-align: center; font-size: 26px; font-weight: 800; margin: 0 0 6px; color: var(--ce-text); }
.ce-auth-sub { text-align: center; color: var(--ce-muted); margin: 0 0 28px; font-size: 14px; }
.ce-auth-switch { text-align: center; font-size: 13px; color: var(--ce-muted); margin-top: 20px; }
.ce-auth-switch a { color: var(--ce-primary); text-decoration: none; font-weight: 600; }

.ce-form { display: flex; flex-direction: column; gap: 16px; }
.ce-field { display: flex; flex-direction: column; gap: 6px; }
.ce-field label { font-size: 13px; font-weight: 600; color: var(--ce-text); }
.ce-field input[type="text"],
.ce-field input[type="email"],
.ce-field input[type="password"],
.ce-field input[type="number"],
.ce-field input[type="date"] {
    padding: 12px 14px;
    border: 1.5px solid var(--ce-border);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color .2s;
    width: 100%;
    box-sizing: border-box;
}
.ce-field input:focus { border-color: var(--ce-primary); }
.ce-field-row { flex-direction: row; justify-content: space-between; align-items: center; }
.ce-field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ce-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ce-text); cursor: pointer; }
.ce-forgot { font-size: 13px; color: var(--ce-primary); text-decoration: none; }
.ce-required { color: var(--ce-primary); }

.ce-alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.ce-alert-error   { background: #ffeaea; color: #c0392b; border-left: 4px solid #c0392b; }
.ce-alert-success { background: #eafaf1; color: #27ae60; border-left: 4px solid #27ae60; }

/* ── Dashboard ── */
.ce-dashboard { max-width: 960px; margin: 0 auto; padding: 0 16px; font-family: inherit; }

.ce-dash-header { display: flex; align-items: center; gap: 20px; background: var(--ce-white); border-radius: var(--ce-radius); padding: 24px 28px; box-shadow: var(--ce-shadow); margin-bottom: 24px; flex-wrap: wrap; }
.ce-dash-avatar img { border-radius: 50%; }
.ce-dash-info { flex: 1; }
.ce-dash-info h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; color: var(--ce-text); }
.ce-dash-info p  { margin: 0; color: var(--ce-muted); font-size: 14px; }
.ce-dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ce-btn-secondary { padding: 9px 18px; border-radius: 8px; border: 1.5px solid var(--ce-border); background: transparent; color: var(--ce-text); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s; }
.ce-btn-secondary:hover { background: var(--ce-bg); }
.ce-btn-logout { border-color: #ffc0b8; color: var(--ce-primary); }
.ce-btn-logout:hover { background: #fff0ee; }

.ce-dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.ce-stat-box { background: var(--ce-white); border-radius: var(--ce-radius); padding: 20px; text-align: center; box-shadow: var(--ce-shadow); }
.ce-stat-num { font-size: 32px; font-weight: 800; color: var(--ce-primary); line-height: 1; }
.ce-stat-label { font-size: 12px; color: var(--ce-muted); margin-top: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* Tabs */
.ce-dash-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--ce-border); margin-bottom: 24px; }
.ce-tab-btn { padding: 10px 24px; border: none; background: transparent; font-size: 14px; font-weight: 700; color: var(--ce-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .2s, border-color .2s; }
.ce-tab-btn.active { color: var(--ce-primary); border-bottom-color: var(--ce-primary); }
.ce-hidden { display: none !important; }

/* Enrolled grid */
.ce-enrolled-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.ce-enrolled-card { background: var(--ce-white); border-radius: var(--ce-radius); overflow: hidden; box-shadow: var(--ce-shadow); }
.ce-enrolled-thumb { height: 140px; background-size: cover; background-position: center; position: relative; }
.ce-badge-mini { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.ce-enrolled-body { padding: 16px; }
.ce-enrolled-body h4 { margin: 0 0 8px; font-size: 16px; font-weight: 700; color: var(--ce-text); }
.ce-enrolled-meta { font-size: 13px; color: var(--ce-muted); margin-bottom: 4px; }

.ce-enrolled-updates { margin-top: 12px; border-top: 1px solid var(--ce-border); padding-top: 10px; }
.ce-updates-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ce-muted); font-weight: 700; margin-bottom: 8px; }
.ce-update-item { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--ce-bg); }
.ce-update-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.ce-update-title { font-size: 13px; font-weight: 700; color: var(--ce-text); }
.ce-update-date { font-size: 11px; color: var(--ce-muted); margin-bottom: 2px; }
.ce-update-excerpt { font-size: 12px; color: var(--ce-muted); }

.ce-enrolled-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ce-border); }
.ce-btn-link { font-size: 13px; color: var(--ce-primary); text-decoration: none; font-weight: 600; }
.ce-btn-danger { background: none; border: 1.5px solid #ffc0b8; color: #c0392b; padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .15s; }
.ce-btn-danger:hover { background: #ffeaea; }

.ce-browse-more { text-align: center; margin-top: 28px; }
.ce-browse-more .ce-btn { display: inline-block; width: auto; padding: 13px 40px; }

/* Empty state */
.ce-dash-empty { text-align: center; padding: 60px 20px; background: var(--ce-white); border-radius: var(--ce-radius); box-shadow: var(--ce-shadow); }
.ce-empty-icon { font-size: 48px; margin-bottom: 16px; }
.ce-dash-empty h3 { font-size: 20px; font-weight: 700; color: var(--ce-text); margin: 0 0 8px; }
.ce-dash-empty p  { color: var(--ce-muted); margin: 0 0 24px; }
.ce-dash-empty .ce-btn { display: inline-block; width: auto; padding: 13px 36px; }

/* Updates feed */
.ce-updates-feed { display: flex; flex-direction: column; gap: 16px; }
.ce-feed-item { background: var(--ce-white); border-radius: var(--ce-radius); padding: 20px 24px; box-shadow: var(--ce-shadow); }
.ce-feed-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ce-feed-chapter { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ce-primary); }
.ce-feed-date { font-size: 12px; color: var(--ce-muted); }
.ce-feed-title { font-size: 17px; font-weight: 700; color: var(--ce-text); margin: 0 0 10px; }
.ce-feed-content { font-size: 14px; color: var(--ce-muted); line-height: 1.6; }
.ce-empty-updates { text-align: center; padding: 48px; color: var(--ce-muted); }

/* Toast */
.ce-toast { position: fixed; bottom: 24px; right: 24px; background: var(--ce-dark); color: #fff; padding: 14px 22px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 9999; transform: translateY(80px); opacity: 0; transition: transform .3s, opacity .3s; pointer-events: none; }
.ce-toast.ce-toast-show { transform: translateY(0); opacity: 1; }
.ce-toast.ce-toast-success { background: var(--ce-green); }
.ce-toast.ce-toast-error   { background: #e74c3c; }

.ce-filter-btn-state{ background-color: transparent !important; font-family: 'Montserrat', sans-serif; }
.ce-filter-btn-state.active{
    background: radial-gradient(circle,rgba(179, 224, 242, 1) 0%, rgba(107, 140, 163, 1) 100%);
}

/* Popup Modal */
.ce-popup-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.ce-popup-modal {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ce-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.ce-popup-close:hover {
    color: #333;
}

.ce-popup-content h2 {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 800;
    color: var(--ce-text);
}

.ce-popup-content > p {
    margin: 0 0 20px;
    color: var(--ce-muted);
    font-size: 15px;
}

.ce-popup-body {
    margin: 20px 0;
    padding: 16px;
    background: var(--ce-bg);
    border-radius: 10px;
}

.ce-popup-body p {
    margin: 0;
    color: var(--ce-text);
    line-height: 1.6;
}

.ce-popup-btn {
    display: block;
    width: 100%;
    padding: 13px 20px;
    margin-bottom: 10px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.ce-popup-btn.ce-btn-enroll {
    background: var(--ce-primary);
    color: #fff;
}

.ce-popup-btn.ce-btn-enroll:hover {
    background: var(--ce-primary-h);
}

.ce-popup-btn-close {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    border: 1.5px solid var(--ce-border);
    border-radius: 10px;
    color: var(--ce-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ce-popup-btn-close:hover {
    border-color: var(--ce-primary);
    color: var(--ce-primary);
}

/* Mobile */
@media (max-width: 640px) {
    .ce-popup-modal {
        padding: 24px;
        max-width: 95%;
    }

    .ce-popup-content h2 {
        font-size: 20px;
    }
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .ce-grid { grid-template-columns: 1fr; }
    .ce-dash-stats { grid-template-columns: 1fr 1fr; }
    .ce-dash-header { flex-direction: column; text-align: center; }
    .ce-dash-actions { justify-content: center; }
    .ce-field-row-2 { grid-template-columns: 1fr; }
    .ce-filters-inner { flex-direction: column; }
}





/* Enrollment Success Popup */
.ce-enrollment-popup-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.ce-enrollment-popup-overlay.active {
    display: flex;
}

.ce-enrollment-popup {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 95%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideDown 0.4s ease;
    text-align: center;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.ce-enrollment-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    transition: color 0.2s;
}

.ce-enrollment-popup-close:hover {
    color: #333;
}

.ce-enrollment-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ce-enrollment-popup-content h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: 0.5px;
}

.ce-enrollment-subtitle {
    font-size: 16px;
    color: var(--ce-primary);
    font-weight: 700;
    margin-bottom: 20px;
}

.ce-enrollment-popup-content p {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
}

.ce-enrollment-popup-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 24px 0 16px;
}

.ce-enrollment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    text-align: left;
}

.ce-enrollment-list li {
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.6;
    padding-left: 0;
}

.ce-enrollment-popup-content .ce-btn {
    display: inline-block;
    padding: 14px 40px;
    width: auto;
}

/* Mobile */
@media (max-width: 640px) {
    .ce-enrollment-popup {
        padding: 28px;
    }
    
    .ce-enrollment-popup-content h2 {
        font-size: 20px;
    }
    
    .ce-enrollment-popup-content p {
        font-size: 13px;
    }
}