* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Cairo", sans-serif;
}

.courses-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 15px;
}

.section-header {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 30px;
}

.view-more-btn {
    background-color: #2e357f;
    color: #fff;
    padding: 12px 25px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.course-card {
    background: #f8f9ff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
}

.card-img-wrapper {
    position: relative;
    height: 200px;
}

.course-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #ff5e48;
    color: #fff;
    padding: 5px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.card-content {
    padding: 20px;
    text-align: right;
}

.rating-row {
    margin-bottom: 10px;
}

.stars {
    color: #f9c020;
    letter-spacing: 2px;
}

.rating-num {
    color: #888;
    font-size: 14px;
    margin-right: 5px;
}

.course-title {
    font-size: 18px;
    color: #2e357f;
    line-height: 1.6;
    margin-bottom: 15px;
    height: 60px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-bottom: 15px;
}

.icon {
    font-style: normal;
}

.divider {
    border-top: 1px dashed #ddd;
    margin: 15px 0;
}

.instructor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.instructor-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.instructor-name {
    font-size: 13px;
    color: #777;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.old-price {
    color: #888;
    text-decoration: line-through;
    font-size: 16px;
}

.current-price {
    color: #2e357f;
    font-size: 20px;
    font-weight: 800;
}

.enroll-btn {
    background-color: #2e357f;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}
:root {
    --primary-color: #2e357f;
    --bg-light: #f8f9ff;
    --border-color: #eaebf2;
}

.text-primary {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1c2357;
}

/* التباعد للأيقونات */
i {
    width: 25px;
    text-align: center;
}

.sidebar-card {
    background-color: white;
    z-index: 10;
}

.lh-lg {
    line-height: 2 !important;
}

.bg-light {
    background-color: var(--bg-light) !important;
}

.card {
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05) !important;
}

/* للموبايل: ترتيب العناصر */
@media (max-width: 991px) {
    .order-lg-2 {
        margin-bottom: 2rem;
    }
    .sidebar-card {
        position: relative !important;
        top: 0 !important;
    }
}

.payment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.payment-modal {
    background: #fff;
    width: 100%;
    max-width: 480px;
    padding: 30px;
    border-radius: 25px;
    position: relative;
}

/* تصميم طرق الدفع كـ Tabs */
.method-card {
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.method-card img {
    max-width: 80%;
    max-height: 40px;
}

/* تحديد الخيار المفعل */
input[type="radio"]:checked + .method-card {
    border-color: #2e357f;
    box-shadow: 0 4px 10px rgba(46, 53, 127, 0.1);
}

/* تنسيق الحقول النصية */
.custom-input {
    border: 1.5px solid #d8dbe4;
    border-radius: 12px;
    padding: 12px;
    background-color: #fff;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.custom-input::placeholder {
    color: #333;
    opacity: 0.6;
}

.custom-input:focus {
    box-shadow: none;
    border-color: #2e357f;
}

/* زر التبديل (Switch) */
.custom-switch-container .custom-switch {
    width: 60px;
    height: 30px;
    cursor: pointer;
    border-color: #e2e2e2;
}

.form-check-input:checked {
    background-color: #2e357f;
    border-color: #2e357f;
}

/* زر ادفع الآن */
.pay-btn {
    background-color: #2e357f;
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    border-radius: 18px;
    border: none;
    transition: 0.3s;
}

.pay-btn:hover {
    background-color: #1c2250;
    color: white;
}

/* Responsive للجوال */
@media (max-width: 500px) {
    .payment-modal {
        margin: 15px;
        padding: 20px;
    }
    .pay-btn {
        font-size: 18px;
    }
}
/* Hero Banner Styles */

.btn-primary {
    background-color: #2e357f;
    border: none;
    transition: 0.3s;
}
.btn-primary:hover {
    background-color: #1a205a;
    transform: scale(1.02);
}

/* Modal & Payment Overlay */
.payment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* مخفي */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
}
.payment-overlay.show {
    display: flex;
}

.payment-modal {
    background: #fff;
    width: 90%;
    max-width: 450px;
    padding: 30px;
    border-radius: 25px;
    text-align: right;
    animation: slideUp 0.3s ease-out;
}

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

.method-card {
    border: 1.5px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
}
input[type="radio"]:checked + .method-card {
    border-color: #2e357f;
    background-color: #f8f9ff;
}

.custom-input {
    border: 1.5px solid #eee;
    border-radius: 12px;
    padding: 12px;
    font-weight: bold;
    font-size: 16px;
}
.pay-btn {
    background-color: #2e357f;
    color: #fff;
    border-radius: 15px;
    font-size: 20px;
}
:root {
    --primary: #2e357f;
    --bg-color: #f7f9fc;
    --text-main: #333;
    --text-muted: #888;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

/* --- القائمة الجانبية (Sidebar) --- */
.sidebar {
    flex: 1;
    min-width: 320px;
    background: white;
    border-radius: 25px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    max-height: 850px;
    overflow-y: auto;
}

.chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.chapter-info h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-main);
}
.chapter-info p {
    margin: 5px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.chapter-icon {
    width: 30px;
    height: 30px;
    border: 1.5px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ddd;
}

.chapter-icon.active {
    color: #2ecc71;
    border-color: #2ecc71;
}
.chapter-icon.playing {
    border-color: transparent;
    color: var(--text-main);
}

.lesson-list {
    padding: 10px 20px;
    background: #fafafa;
    border-radius: 15px;
    list-style: none;
    font-size: 12px;
    color: #666;
}
.lesson-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

/* --- منطقة المحتوى الرئيسي --- */
.content-area {
    flex: 2.5;
    min-width: 450px;
}

.video-card {
    background: white;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}
.play-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
}
.play-button i {
    color: var(--primary);
    font-size: 30px;
    margin-right: 5px;
}

.video-details {
    padding: 25px;
    text-align: right;
}
.video-details h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-main);
}
.video-details p {
    color: var(--text-muted);
    margin: 10px 0;
    font-size: 16px;
}

.meta-data {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* --- بطاقات المصادر --- */
.resource-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #f0f0f0;
}

.resource-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.resource-info h5 {
    margin: 0;
    font-size: 18px;
    color: var(--text-main);
}
.resource-icon {
    width: 45px;
}

.btn-action {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 12px;
    font-family: "Cairo";
    font-weight: 700;
    cursor: pointer;
    min-width: 120px;
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column-reverse;
    }
    .sidebar,
    .content-area {
        width: 100%;
        min-width: 100%;
    }
}
.custom-textarea {
    border: 2px solid #f0f3f9;
    background-color: #f8faff;
    border-radius: 12px;
    padding: 15px;
    resize: none;
    transition: 0.3s;
}

.custom-textarea:focus {
    background-color: white;
    border-color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(0, 212, 199, 0.1);
}

.add-discussion-box {
    border: 1px solid #eef2f8 !important;
}

/* لون مخصص للأفاتار التلقائي للمستخدم المسجل */
.user-avatar-small.bg-secondary {
    background-color: var(--secondary-color) !important;
}
.reply-item {
    background-color: #fdfdfd;
    border: 1px solid #f1f1f1 !important;
    border-right: 4px solid var(--secondary-color) !important; /* لتمييز الرد */
}

.reply-form input {
    border-radius: 10px 0 0 10px !important;
    padding: 10px 15px;
    font-size: 12px;
}

.reply-form button {
    border-radius: 0 10px 10px 0 !important;
    padding: 0 20px;
}

.replies-section {
    border-right: 2px solid #eee;
}
.input-group
    > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(
        .valid-feedback
    ):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.input-group:not(.has-validation) > .dropdown-toggle:nth-last-child(n + 3),
.input-group:not(.has-validation)
    > .form-floating:not(:last-child)
    > .form-control,
.input-group:not(.has-validation)
    > .form-floating:not(:last-child)
    > .form-select,
.input-group:not(.has-validation)
    > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(
        .form-floating
    ) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
