/* ============================================
   إضافة الدورات التدريبية - Stylesheet
   ============================================ */

/* ── رمز الريال (الخط محمّل محلياً عبر saudi-riyal-font.css) ── */
.tc-sar-icon,
.icon-saudi_riyal_new {
    font-size: .85em;
    line-height: 1;
    vertical-align: baseline;
    display: inline-block;
}

*, *::before, *::after { box-sizing: border-box; }

/* القيم الافتراضية — تُستبدل بـ CSS variables من PHP عبر wp_head */
:root {
    --tc-primary:    #0073aa;
    --tc-primary-dk: #005f8e;
    --tc-success:    #27ae60;
    --tc-warning:    #f39c12;
    --tc-danger:     #e74c3c;
    --tc-text:       #333;
    --tc-heading:    #333;
    --tc-muted:      #666;
    --tc-border:     #dce3e8;
    --tc-bg:         #f8f9fa;
    --tc-radius:     8px;
    --tc-shadow:     0 2px 12px rgba(0,0,0,.09);
}

/* ── تخطيط صفحة الدورة (Mharty-compatible) ── */
.tc-page-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
    margin-top: 20px;
}
.tc-page-main    { min-width: 0; }
.tc-page-sidebar { min-width: 0; }
@media (max-width: 900px) {
    .tc-page-layout  { grid-template-columns: 1fr; }
    .tc-page-sidebar { order: -1; }
}

/* ── هيدر الدورة ── */
.tc-course-header {
    position: relative;
    min-height: 280px;
    background: var(--tc-primary);
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    margin-bottom: 0;
}
.tc-course-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.15) 70%);
}
.tc-course-header-inner {
    position: relative;
    z-index: 1;
    padding: 28px 32px;
    width: 100%;
    color: #fff;
}
.tc-course-header-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 8px 0;
    color: #fff !important;
    line-height: 1.3;
}
.tc-course-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
    opacity: .9;
    font-size: 14px;
}
.tc-header-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.tc-header-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}
.tc-badge-ended { background: rgba(0,0,0,.5); color: #fff; }
.tc-badge-full  { background: rgba(231,76,60,.85); color: #fff; }
.tc-badge-early { background: rgba(39,174,96,.85); color: #fff; }

/* ── شريط المعلومات ── */
.tc-info-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #fff;
    border: 1px solid var(--tc-border);
    border-radius: 10px;
    margin: 16px 0;
    overflow: hidden;
    box-shadow: var(--tc-shadow);
}
.tc-info-strip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    flex: 1;
    min-width: 150px;
}
.tc-info-strip-sep {
    width: 1px;
    background: var(--tc-border);
    align-self: stretch;
}
.tc-strip-icon { font-size: 1.5rem; }
.tc-strip-label { font-size: 11px; color: var(--tc-muted); margin-bottom: 2px; }
.tc-strip-value { font-weight: 700; font-size: .95rem; color: var(--tc-text); }
.tc-strip-price { color: var(--tc-primary); font-size: 1.1rem; }
.tc-value-danger { color: var(--tc-danger) !important; }

/* ── المحتوى الرئيسي ── */
.tc-content-section {
    background: #fff;
    border: 1px solid var(--tc-border);
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 20px;
    line-height: 1.85;
}

/* ── قسم التسجيل ── */
.tc-registration-section { margin-bottom: 28px; }
.tc-reg-section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--tc-heading, var(--tc-primary));
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--tc-primary);
}

/* ── إشعارات ── */
.tc-notice {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    border-right: 4px solid;
}
.tc-notice-warning { background: #fffbf0; color: #6b4800; border-color: var(--tc-warning); }
.tc-notice-error   { background: #fdf2f2; color: #721c24; border-color: var(--tc-danger); }

/* ── الشريط الجانبي ── */
.tc-sidebar-card {
    background: #fff;
    border: 1px solid var(--tc-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: var(--tc-shadow);
}
.tc-sidebar-card-title {
    background: var(--tc-primary);
    color: #fff;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* بطاقة الأسعار */
.tc-active-price-box {
    padding: 20px 18px 14px;
    text-align: center;
    border-bottom: 1px solid var(--tc-border);
}
.tc-active-price-label {
    font-size: 12px;
    color: var(--tc-muted);
    margin-bottom: 4px;
}
.tc-active-price-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--tc-primary);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.tc-sidebar-card .tc-price-list { padding: 12px 14px !important; }
.tc-price-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    background: var(--tc-bg);
    transition: background .2s;
}
.tc-price-row-item.tc-price-active {
    background: #e8f8f0;
    border: 1px solid #a9dfbf;
}
.tc-price-row-name { color: #444; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tc-price-row-val  { font-weight: 700; color: var(--tc-text); white-space: nowrap; }
.tc-price-till { font-size: 10px; color: var(--tc-muted); background: #eee; padding: 1px 6px; border-radius: 10px; }
.tc-price-icon { font-size: 14px; }
.tc-price-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.tc-dot-green  { background: var(--tc-success); }
.tc-dot-orange { background: var(--tc-warning); }

.tc-sidebar-cta {
    display: block;
    margin: 6px 14px 14px;
    padding: 12px;
    text-align: center;
    background: var(--tc-primary);
    color: #fff !important;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none !important;
    font-size: 14px;
    transition: background .2s;
    line-height: 1.4;
}
.tc-sidebar-cta:hover {
    background: var(--tc-primary-dk);
    color: #fff;
    text-decoration: none;
}

/* تفاصيل الدورة — specificity مرتفع لتجاوز إعادة تهيئة الثيم */
.tc-sidebar-card .tc-detail-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 14px 16px !important;
}
.tc-sidebar-card .tc-detail-list li {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    padding: 9px 0 !important;
    margin: 0 !important;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
    list-style: none !important;
}
.tc-sidebar-card .tc-detail-list li:last-child { border-bottom: none; }
.tc-dl-label { color: var(--tc-muted); white-space: nowrap; flex-shrink: 0; }
.tc-dl-val   { font-weight: 600; text-align: right; word-break: break-word; }

/* شريط مقاعد مصغّر */
.tc-mini-seats-bar {
    height: 6px;
    background: #eee;
    margin: 0 16px 16px;
    border-radius: 3px;
    overflow: hidden;
}
.tc-mini-seats-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .5s;
}
.tc-fill-green  { background: var(--tc-success); }
.tc-fill-orange { background: var(--tc-warning); }
.tc-fill-red    { background: var(--tc-danger); }

/* مميزات الدورة — specificity مرتفع */
.tc-sidebar-card .tc-features-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 14px 16px !important;
}
.tc-sidebar-card .tc-features-list li {
    padding: 8px 0 !important;
    margin: 0 !important;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    color: #2d6a4f;
    font-weight: 600;
    list-style: none !important;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tc-sidebar-card .tc-features-list li:last-child { border-bottom: none; }
.tc-feat-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--tc-success);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── صفحة الدورة (القديم للتوافق) ── */
.tc-course-page { direction: rtl; font-family: inherit; color: var(--tc-text); }

.tc-course-banner {
    position: relative;
    min-height: 320px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}
.tc-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.1) 60%);
}
.tc-hero-content {
    position: relative;
    z-index: 1;
    padding: 32px 40px;
    color: #fff;
}
.tc-hero-plain {
    background: var(--tc-primary);
    color: #fff;
    padding: 48px 40px;
    text-align: center;
}
.tc-course-name { font-size: 2rem; margin: 0 0 8px; }
.tc-course-date-hero { margin: 0; opacity: .9; font-size: 1.1rem; }

.tc-course-container { max-width: 1160px; margin: 0 auto; padding: 0 20px 60px; }

/* شريط المعلومات */
.tc-course-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #fff;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    margin: 24px 0;
    overflow: hidden;
    box-shadow: var(--tc-shadow);
}
.tc-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 28px;
    flex: 1;
    min-width: 180px;
    border-left: 1px solid var(--tc-border);
}
.tc-info-item:last-child { border-left: 0; }
.tc-info-icon { font-size: 1.6rem; }
.tc-info-label { font-size: 12px; color: var(--tc-muted); }
.tc-info-value { font-weight: 700; font-size: 1rem; margin-top: 2px; }
.tc-info-value.tc-full { color: var(--tc-danger); }

/* تخطيط الصفحة */
.tc-course-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}
@media (max-width: 860px) {
    .tc-course-layout { grid-template-columns: 1fr; }
    .tc-course-sidebar { order: -1; }
}

/* وصف الدورة */
.tc-course-description {
    background: #fff;
    padding: 28px;
    border-radius: var(--tc-radius);
    border: 1px solid var(--tc-border);
    margin-bottom: 28px;
    line-height: 1.8;
}
.tc-course-description h2 { color: var(--tc-primary); margin-top: 0; }

/* ── الشريط الجانبي ── */
.tc-pricing-box {
    background: #fff;
    border: 2px solid var(--tc-primary);
    border-radius: var(--tc-radius);
    overflow: hidden;
    box-shadow: var(--tc-shadow);
    margin-bottom: 20px;
}
.tc-pricing-box h3 {
    background: var(--tc-primary);
    color: #fff;
    margin: 0;
    padding: 16px 20px;
    font-size: 1rem;
    text-align: center;
}
.tc-current-price {
    text-align: center;
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--tc-border);
}
.tc-price-badge {
    display: inline-block;
    background: var(--tc-warning);
    color: #fff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.tc-price-big { font-size: 2.4rem; font-weight: 800; color: var(--tc-primary); line-height: 1; }
.tc-price-big span { font-size: 1rem; font-weight: 400; color: var(--tc-muted); }

.tc-all-prices { padding: 16px 20px; }
.tc-price-row {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--tc-bg);
    font-size: 13px;
}
.tc-price-row strong { font-size: 1.1rem; color: var(--tc-text); }
.tc-price-row small { color: var(--tc-muted); }
.tc-price-row.tc-active-price {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
}
.tc-price-row.tc-active-price strong { color: var(--tc-success); }

.tc-btn-full { display: block; margin: 16px 20px; text-align: center; }

.tc-sidebar-info {
    background: #fff;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    padding: 20px;
}
.tc-sidebar-info h4 { margin-top: 0; color: var(--tc-primary); }
.tc-sidebar-info ul { padding-right: 0; list-style: none; margin: 0; }
.tc-sidebar-info li { padding: 6px 0; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
.tc-sidebar-info li:last-child { border-bottom: none; }

/* ── نموذج التسجيل ── */
#tc-registration-form-wrapper {
    background: #fff;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    padding: 32px;
    box-shadow: var(--tc-shadow);
}

.tc-price-info {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.tc-price-card {
    flex: 1;
    min-width: 140px;
    border: 2px solid var(--tc-border);
    border-radius: var(--tc-radius);
    padding: 16px;
    text-align: center;
    transition: border-color .2s;
}
.tc-price-card.active {
    border-color: var(--tc-primary);
    background: #f0f7ff;
}
.tc-price-label { font-size: 12px; color: var(--tc-muted); margin-bottom: 6px; }
.tc-price-value { font-size: 1.4rem; font-weight: 700; color: var(--tc-primary); }
.tc-price-date { font-size: 11px; color: var(--tc-muted); margin-top: 4px; }

.tc-section { margin-bottom: 28px; }
.tc-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--tc-primary);
    color: var(--tc-primary);
}

/* اختيار نوع التسجيل */
.tc-reg-type-selector { display: flex; gap: 16px; flex-wrap: wrap; }
.tc-type-option input[type="radio"] { display: none; }
.tc-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 32px;
    border: 2px solid var(--tc-border);
    border-radius: var(--tc-radius);
    cursor: pointer;
    transition: all .2s;
    min-width: 160px;
    text-align: center;
}
.tc-type-option input:checked + .tc-type-card,
.tc-type-card.tc-card-selected {
    border-color: var(--tc-primary);
    background: #f0f7ff;
    box-shadow: 0 0 0 3px rgba(0,115,170,.15);
}
.tc-type-option { cursor: pointer; }
.tc-type-icon { font-size: 2rem; }
.tc-type-label { font-weight: 700; font-size: 1rem; }
.tc-type-price { font-size: 12px; color: var(--tc-muted); }

/* اختيار عدد المجموعة */
.tc-count-selector { display: flex; gap: 12px; }
.tc-count-option input[type="radio"] { display: none; }
.tc-count-card {
    padding: 12px 28px;
    border: 2px solid var(--tc-border);
    border-radius: var(--tc-radius);
    cursor: pointer;
    font-weight: 600;
    transition: all .2s;
}
.tc-count-option input:checked + .tc-count-card {
    border-color: var(--tc-primary);
    background: var(--tc-primary);
    color: #fff;
}

/* نماذج المجموعة الإضافية */
#tc-extra-participants { display: none; }

/* نموذج المشارك */
.tc-participant-form {
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.tc-participant-title {
    background: var(--tc-primary);
    color: #fff;
    margin: 0;
    padding: 12px 20px;
    font-size: .95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tc-remove-participant {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tc-remove-participant:hover { background: rgba(255,255,255,.4); }

.tc-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px;
}
@media (max-width: 640px) { .tc-fields-grid { grid-template-columns: 1fr; } }

.tc-field-group { display: flex; flex-direction: column; gap: 5px; }
.tc-span-2 { grid-column: span 2; }
@media (max-width: 640px) { .tc-span-2 { grid-column: span 1; } }

.tc-field-group label { font-size: 13px; font-weight: 600; color: #444; }
.tc-field-group .required { color: var(--tc-danger); }
.tc-field-group small { font-size: 11px; color: var(--tc-muted); }

.tc-input {
    padding: 10px 14px;
    border: 1.5px solid var(--tc-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    background: #fff;
    color: var(--tc-text);
}
.tc-input:focus {
    outline: none;
    border-color: var(--tc-primary);
    box-shadow: 0 0 0 3px rgba(0,115,170,.15);
}
.tc-input.tc-field-error {
    border-color: var(--tc-danger) !important;
    box-shadow: 0 0 0 3px rgba(231,76,60,.18) !important;
    background: #fffafa;
    animation: tc-shake .35s ease;
}
@keyframes tc-shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
}
.tc-inline-error {
    display: block;
    color: var(--tc-danger);
    font-size: 11px;
    margin-top: 3px;
    font-weight: 600;
}

/* ملخص المبلغ */
.tc-total-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f7ff;
    border: 2px solid var(--tc-primary);
    border-radius: var(--tc-radius);
    padding: 16px 24px;
    margin: 24px 0;
}
.tc-total-label { font-size: 1rem; font-weight: 600; }
.tc-total-value { font-size: 1.8rem; font-weight: 800; color: var(--tc-primary); }

/* الشروط */
.tc-terms {
    margin-bottom: 20px;
    font-size: 14px;
}
.tc-terms label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tc-terms a { color: var(--tc-primary); }

/* الأزرار */
.tc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--tc-radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .2s;
}
.tc-btn-primary {
    background: var(--tc-primary);
    color: #fff;
    border-color: var(--tc-primary);
}
.tc-btn-primary:hover {
    background: var(--tc-primary-dk);
    border-color: var(--tc-primary-dk);
    color: #fff;
    text-decoration: none;
}
.tc-btn-lg { padding: 15px 36px; font-size: 1.1rem; width: 100%; }
.tc-btn:disabled, .tc-btn[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

/* الرسائل */
.tc-alert {
    padding: 14px 18px;
    border-radius: var(--tc-radius);
    margin: 16px 0;
    font-size: 14px;
    border-right: 4px solid;
}
.tc-alert-danger  { background: #fdf2f2; color: #721c24; border-color: var(--tc-danger); }
.tc-alert-warning { background: #fffbf0; color: #6b4800; border-color: var(--tc-warning); }
.tc-alert-success { background: #f0fdf4; color: #145a32; border-color: var(--tc-success); }

#tc-form-messages { margin: 12px 0; }

/* ════════════════════════════════════════════════════
   بطاقات الدورات الاحترافية — tc-course-card-v2
   ════════════════════════════════════════════════════ */

/* الغلاف العام */
.tc-listing-wrapper { direction: rtl; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }

/* ── شريط البحث والفلترة ── */
.tc-listing-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    padding: 18px 22px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(0,0,0,.07);
}
.tc-listing-search {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.tc-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    pointer-events: none;
}
.tc-search-field {
    width: 100%;
    padding: 10px 42px 10px 14px;
    border: 2px solid var(--tc-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    direction: rtl;
    transition: border-color .2s;
}
.tc-search-field:focus { outline: none; border-color: var(--tc-primary); }

.tc-listing-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.tc-filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--tc-border);
    border-radius: 20px;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all .18s;
    color: #555;
}
.tc-filter-btn:hover, .tc-filter-active {
    border-color: var(--tc-primary);
    background: var(--tc-primary);
    color: #fff;
}

.tc-layout-toggle { display: flex; gap: 4px; margin-right: auto; }
.tc-layout-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--tc-border); border-radius: 8px;
    background: transparent; cursor: pointer; font-size: 16px;
    transition: all .18s;
}
.tc-layout-btn:hover, .tc-layout-active {
    border-color: var(--tc-primary);
    background: var(--tc-primary);
    color: #fff;
}

/* ── شبكة الدورات ── */
.tc-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.tc-listing-wrapper[data-layout="list"] .tc-courses-grid {
    grid-template-columns: 1fr;
}

/* ── البطاقة ── */
.tc-course-card-v2 {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 18px rgba(0,0,0,.08);
    border: 1px solid #eaecf0;
    transition: transform .22s cubic-bezier(.34,1.2,.64,1), box-shadow .22s;
    display: flex;
    flex-direction: column;
}
.tc-course-card-v2:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 36px rgba(0,0,0,.13);
}
.tc-course-card-v2[data-filter="past"] { opacity: .75; }

/* صورة البطاقة */
.tc-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #0073aa 0%, #005f8e 100%);
    flex-shrink: 0;
}
.tc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
    display: block;
}
.tc-course-card-v2:hover .tc-card-image img { transform: scale(1.06); }

.tc-card-no-image {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--tc-primary) 0%, #003f5e 100%);
}
.tc-card-no-image span { font-size: 3.5rem; opacity: .4; }

/* الشارة */
.tc-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(4px);
}
.tc-badge-past  { background: rgba(0,0,0,.5);       color: #fff; }
.tc-badge-full  { background: rgba(231,76,60,.85);   color: #fff; }
.tc-badge-soon  { background: rgba(230,126,34,.88);  color: #fff; }
.tc-badge-early { background: rgba(39,174,96,.88);   color: #fff; }

/* عداد الأيام */
.tc-card-countdown {
    position: absolute;
    bottom: 12px;
    left: 14px;
    background: rgba(0,0,0,.55);
    color: #fff;
    border-radius: 10px;
    padding: 5px 10px;
    text-align: center;
    backdrop-filter: blur(4px);
    line-height: 1.1;
}
.tc-countdown-number { display: block; font-size: 1.3rem; font-weight: 800; }
.tc-countdown-label  { font-size: 10px; opacity: .8; }

/* محتوى البطاقة */
.tc-card-content {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tc-card-location {
    font-size: 12px;
    color: var(--tc-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tc-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.45;
}
.tc-card-title a { color: var(--tc-text); text-decoration: none; }
.tc-card-title a:hover { color: var(--tc-primary); }

.tc-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 14px;
}
.tc-card-detail {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #555;
}
.tc-detail-icon { font-size: 14px; }

/* شريط المقاعد */
.tc-card-seats { margin-bottom: 16px; }
.tc-seats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--tc-muted);
    margin-bottom: 5px;
}
.tc-seats-header strong { color: var(--tc-text); font-weight: 700; }
.tc-seats-full { color: var(--tc-danger) !important; }

.tc-seats-bar {
    height: 7px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}
.tc-seats-fill {
    height: 100%;
    background: var(--tc-success);
    border-radius: 4px;
    transition: width .5s ease;
}
.tc-seats-warning { background: var(--tc-warning); }
.tc-seats-danger  { background: var(--tc-danger); }

/* السعر وزر التسجيل */
.tc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.tc-card-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tc-price-tag {
    font-size: 11px;
    color: var(--tc-muted);
    background: #f0f7ff;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    width: fit-content;
}
.tc-price-amount {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--tc-primary);
    line-height: 1.1;
}
.tc-price-currency { font-size: 12px; font-weight: 400; color: var(--tc-muted); }
.tc-price-group { font-size: 11px; color: var(--tc-success); }

.tc-card-cta {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all .18s;
    white-space: nowrap;
    font-family: inherit;
}
.tc-cta-register {
    background: var(--tc-primary);
    color: #fff;
}
.tc-cta-register:hover {
    background: var(--tc-primary-dk);
    color: #fff;
    transform: translateX(-3px);
}
.tc-cta-full {
    background: #fde8e8;
    color: var(--tc-danger);
    cursor: default;
}
.tc-cta-disabled {
    background: #f0f0f0;
    color: #aaa;
    cursor: default;
}

/* ── وضع القائمة ── */
.tc-listing-wrapper[data-layout="list"] .tc-course-card-v2 {
    flex-direction: row;
}
.tc-listing-wrapper[data-layout="list"] .tc-card-image {
    width: 220px;
    height: auto;
    min-height: 160px;
    flex-shrink: 0;
}
@media (max-width: 640px) {
    .tc-listing-wrapper[data-layout="list"] .tc-course-card-v2 { flex-direction: column; }
    .tc-listing-wrapper[data-layout="list"] .tc-card-image { width: 100%; height: 180px; }
}

/* الحالة الفارغة */
.tc-empty-state, .tc-no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--tc-muted);
    grid-column: 1 / -1;
}
.tc-empty-icon { font-size: 4rem; margin-bottom: 12px; }
.tc-empty-state h3, .tc-no-results h3 { font-size: 1.2rem; margin: 0 0 8px; color: #555; }
.tc-empty-state p,  .tc-no-results p  { margin: 0; font-size: 14px; }

/* ── للمتجاوبة ── */
@media (max-width: 768px) {
    .tc-listing-header { gap: 10px; }
    .tc-layout-toggle { display: none; }
    .tc-courses-grid { grid-template-columns: 1fr; gap: 16px; }
}
@media (min-width: 769px) and (max-width: 1080px) {
    .tc-courses-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── البطاقات القديمة (للتوافق) ── */
.tc-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.tc-course-card { background: #fff; border: 1px solid var(--tc-border); border-radius: var(--tc-radius); overflow: hidden; box-shadow: var(--tc-shadow); }
.tc-course-thumb img { width: 100%; height: 180px; object-fit: cover; }
.tc-course-body { padding: 20px; }
.tc-course-title { margin: 0 0 14px; font-size: 1.1rem; }
.tc-course-title a { color: var(--tc-text); text-decoration: none; }
.tc-course-meta-list { list-style: none; padding: 0; margin: 0 0 16px; font-size: 13px; color: var(--tc-muted); }
.tc-course-meta-list li { padding: 5px 0; border-bottom: 1px solid #f0f0f0; }
.tc-no-courses { color: var(--tc-muted); text-align: center; padding: 32px; }
.tc-icon { margin-left: 6px; }

/* لوحة التحكم */
.tc-admin-form .tc-form-row { flex-wrap: wrap; }
.tc-admin-form .tc-form-col { min-width: 200px; }

/* ══════════════════════════════════════════════════════
   توافق الجوال — إصلاحات شاملة
══════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    /* منع iOS من تكبير الصفحة عند التركيز على الحقول */
    .tc-input,
    select.tc-input {
        font-size: 16px !important;
    }

    /* حجم الأزرار مناسب للمس */
    .tc-btn,
    .tc-card-cta,
    .tc-sidebar-cta {
        min-height: 48px;
        padding: 14px 20px;
        font-size: 15px;
    }

    /* اختيار نوع التسجيل */
    .tc-reg-type-selector {
        flex-direction: column;
        gap: 10px;
    }
    .tc-type-option { width: 100%; }
    .tc-type-card {
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        padding: 12px 16px;
        min-width: unset;
        width: 100%;
    }
    .tc-type-icon { font-size: 1.5rem; }

    /* بطاقات الأسعار (flex → عمود واحد) */
    .tc-price-info {
        flex-direction: column;
        gap: 10px;
    }
    .tc-price-card { min-width: unset; }

    /* شريط المعلومات */
    .tc-info-strip {
        flex-wrap: wrap;
        gap: 8px 0;
    }
    .tc-info-strip-item { min-width: 50%; }
    .tc-info-strip-sep  { display: none; }

    /* ملخص المبلغ */
    .tc-total-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .tc-total-value { font-size: 1.5rem; }

    /* رسائل الأخطاء */
    .tc-alert { font-size: 13px; padding: 12px 14px; }
    .tc-inline-error { font-size: 12px; }

    /* جدول الحقول عمود واحد */
    .tc-fields-grid { grid-template-columns: 1fr !important; }
    .tc-span-2      { grid-column: span 1 !important; }

    /* نموذج المشارك */
    .tc-participant-form { overflow: hidden; }
    .tc-fields-grid      { padding: 14px; gap: 12px; }

    /* هيدر الدورة */
    .tc-course-header-title { font-size: 1.3rem; line-height: 1.4; }
    .tc-course-header       { min-height: 200px; }

    /* الشريط الجانبي أسفل على الجوال */
    .tc-page-layout         { grid-template-columns: 1fr; }
    .tc-page-sidebar        { order: 2; }

    /* شريط المعلومات السريعة */
    .tc-info-strip { padding: 12px; }
    .tc-strip-value { font-size: .9rem; }

    /* اختيار طريقة الدفع */
    .tc-payment-selector { flex-direction: column; }
    .tc-payment-card     { flex-direction: row; align-items: center; gap: 12px; }
}

/* ════════════════════════════════════════════════════
   طرق الدفع — Payment Methods
   ════════════════════════════════════════════════════ */

/* ── اختيار طريقة الدفع ── */
.tc-payment-selector {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.tc-payment-option { flex: 1; min-width: 200px; cursor: pointer; }
.tc-payment-option input[type="radio"] { display: none; }
.tc-payment-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 16px;
    border: 2px solid var(--tc-border);
    border-radius: var(--tc-radius);
    background: #fff;
    transition: all .2s;
    text-align: center;
}
.tc-payment-card:hover {
    border-color: var(--tc-primary);
    background: #f0f7fb;
}
.tc-payment-card.tc-card-selected {
    border-color: var(--tc-primary);
    background: #e8f4fd;
    box-shadow: 0 0 0 3px rgba(0,115,170,.15);
}
.tc-payment-icon { font-size: 2rem; line-height: 1; }
.tc-payment-label { font-weight: 700; font-size: 1rem; color: var(--tc-heading); }
.tc-payment-desc  { font-size: .82rem; color: var(--tc-muted); }

/* ── بيانات الحساب البنكي ── */
.tc-bank-info-box {
    background: #f0f8ff;
    border: 1.5px solid #b3d9f0;
    border-radius: var(--tc-radius);
    padding: 20px 22px;
    margin: 16px 0;
}
.tc-bank-info-title {
    font-size: .95rem;
    font-weight: 700;
    color: #1a5276;
    margin: 0 0 14px;
}
.tc-bank-details-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tc-bank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #d6ecfa;
    flex-wrap: wrap;
}
.tc-bank-row:last-child { border-bottom: 0; }
.tc-bank-lbl {
    font-weight: 700;
    color: #555;
    font-size: .85rem;
    min-width: 100px;
    flex-shrink: 0;
}
.tc-bank-val {
    font-size: .95rem;
    color: #1a1a1a;
    flex: 1;
}
.tc-iban-val {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    letter-spacing: 1px;
}
.tc-bank-notes .tc-bank-val { font-size: .88rem; color: #555; }
.tc-copy-iban {
    padding: 4px 12px;
    border: 1.5px solid var(--tc-primary);
    border-radius: 4px;
    background: transparent;
    color: var(--tc-primary);
    font-size: .8rem;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.tc-copy-iban:hover { background: var(--tc-primary); color: #fff; }

/* ── رفع الإيصال ── */
.tc-file-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tc-file-input {
    padding: 10px;
    border: 2px dashed var(--tc-border);
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    font-size: 14px;
    transition: border-color .2s;
}
.tc-file-input:hover { border-color: var(--tc-primary); }
.tc-file-hint { font-size: .8rem; color: var(--tc-muted); }

/* ── Toast بسيط ── */
.tc-toast {
    position: fixed;
    bottom: 24px;
    right: 50%;
    transform: translateX(50%) translateY(20px);
    background: #1a1a1a;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    transition: all .25s;
    pointer-events: none;
}
.tc-toast.tc-toast-show {
    opacity: 1;
    transform: translateX(50%) translateY(0);
}

/* ── أعمدة الدفع في جدول الإدارة ── */
.tc-payment-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.tc-pay-bank   { background: #e8f4fd; color: #1a5276; }
.tc-pay-online { background: #e8f8f0; color: #1e6837; }
.tc-badge-orange { background: #fff3cd; color: #856404; }
.tc-action-receipt { background: #f0f0f0; }
.tc-action-confirm { background: #d4edda; color: #155724; }
.tc-action-reject  { background: #f8d7da; color: #721c24; }
.tc-actions-cell   { white-space: nowrap; }
