/* =========================================================
   Subject Courses Widget
   ========================================================= */

/* ---------- Variables ---------- */
:root {
    --scw-study-bg: #E8DEF8;
    --scw-study-bg-light: #F3EEFF;
    --scw-study-main-bg-light: #E6F8FF;
    --scw-study-accent: #6225CB;
    --scw-study-btn: #6225CB;
    --scw-study-main-btn: #00B5FF;
    --scw-revision-bg: #FFF7DE;
    --scw-revision-bg-light: #FFFCF0;
    --scw-revision-accent: #704D00;
    --scw-revision-btn: #C9A227;
    --scw-tab-active-study: #E8DEF8;
    --scw-tab-active-revision: #FCEEB5;
    --scw-tab-inactive: #F3F3F3;
    --scw-text-primary: #1A1A1A;
    --scw-text-secondary: #555;
    --scw-text-muted: #888;
    --scw-border-radius: 20px;
    --scw-card-gap: 16px;
    --scw-badge-subscribed: #2E7D32;
    --scw-badge-subscribed-bg: #E8F5E9;
    --scw-font-family: 'Almarai', 'Inter', sans-serif;
}

/* ---------- Container ---------- */
.scw-container {
    width: 100%;
    margin: 0 auto;
    padding: 20px 16px;
    font-family: var(--scw-font-family);
}

/* ---------- Tab Bar ---------- */
.scw-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 4px;
    /* background: #F5F5F5; */
    border-radius: 50px;
    justify-content: center;
    width: 100%;
}

.scw-tab {
    /* flex: 1; */
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 400;
    font-family: var(--scw-font-family);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #F5F5F5;
    color: var(--scw-text-secondary);
    position: relative;
    overflow: hidden;
    width: 177px;
}

.scw-tab::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scw-tab:hover {
    color: var(--scw-text-primary);
}

html[lang="ar"] .scw-tab.active[data-classification="1"] {
    border-radius: 8px 50px 50px 8px;
}
.scw-tab.active[data-classification="1"] {
    border-radius: 50px 8px 8px 50px;
}

html[lang="ar"] .scw-tab.active[data-classification="3"] {
    border-radius: 50px 8px 8px 50px;
}
.scw-tab.active[data-classification="3"] {
    border-radius: 8px 50px 50px 8px;

}
.scw-tab.active {
    background: var(--scw-tab-active-revision);
    color: var(--scw-revision-accent);
    box-shadow: 0 2px 8px rgba(201, 162, 39, 0.15);
}

/* ---------- Content Area ---------- */
.scw-content {
    min-height: 200px;
    position: relative;
}

/* ---------- Course Cards List ---------- */
.scw-courses-list {
    display: flex;
    gap: var(--scw-card-gap);
    width: 100%;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .scw-courses-list {
        flex-direction: column;
    }

}

/* ---------- Single Course Card ---------- */
.scw-course-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.scw-course-card-link:hover {
    color: inherit;
}

.scw-course-card {
    border-radius: var(--scw-border-radius);
    padding: 20px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: scwFadeInUp 0.4s ease both;
    width: 32.33%;
}

.scw-course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Study card colors */
.scw-course-card.scw-study {
    background: var(--scw-study-bg-light);
    border: 1px solid rgba(98, 37, 203, 0.08);

}

/* Revision card colors */
.scw-course-card.scw-revision {
    background: var(--scw-revision-bg-light);
    border: 1px solid rgba(112, 77, 0, 0.08);
}
.scw-study:nth-child(1) .scw-buy-btn {
    background: var(--scw-study-main-btn);
}
.scw-study:nth-child(2) .scw-buy-btn {
    background: var(--scw-study-btn);
}
.scw-study:nth-child(3) .scw-buy-btn {
    background: var(--scw-revision-btn);
}
.scw-study .scw-buy-btn:hover {
    opacity: 0.9;
}
/* Staggered animation */
.scw-course-card:nth-child(1) {
    animation-delay: 0s;
    background: var(--scw-study-main-bg-light);

}

.scw-course-card:nth-child(2) {
    animation-delay: 0.08s;
    background: var(--scw-study-bg-light);
}

.scw-course-card:nth-child(3) {
    animation-delay: 0.16s;
    background: var(--scw-revision-bg-light);
}

.scw-course-card:nth-child(4) {
    animation-delay: 0.24s;
    background: var(--scw-revision-bg-light);
}

.scw-course-card:nth-child(5) {
    animation-delay: 0.32s;
    background: #FFF7DE;
}

@keyframes scwFadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Teacher Block ---------- */
.scw-teacher-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    position: relative;
    cursor: pointer;
    border-radius: 14px;
    transition: background 0.2s ease;
}

.scw-teacher-block:hover {
    background: rgba(255, 255, 255, 0.45);
}

.scw-teacher-block:focus {
    outline: 2px solid rgba(0, 181, 255, 0.45);
    outline-offset: 2px;
}

.scw-teacher-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #ddd;
}

.scw-teacher-avatar-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, #c5eaf8, #00B5FF); linear-gradient(135deg, #C9B1FF, #9B7FDB);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.scw-study:nth-child(1) .scw-teacher-avatar-placeholder {
    background: linear-gradient(135deg, #c5eaf8, #00B5FF);
}
.scw-study:nth-child(2) .scw-teacher-avatar-placeholder {
    background: linear-gradient(135deg, #C9B1FF, #9B7FDB);
}
.scw-study:nth-child(3) .scw-teacher-avatar-placeholder {
    background: linear-gradient(135deg, #F0D68A, #C9A227);
}

.scw-teacher-info {
    flex: 1;
    min-width: 0;
}

.scw-teacher-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--scw-text-primary);
    margin: 0 0 2px;
    line-height: 1.3;
}

.scw-teacher-type {
    font-size: 13px;
    color: var(--scw-text-muted);
    margin: 0;
    font-weight: 500;
}

/* ---------- Subscription Badge ---------- */
.scw-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    position: absolute;
    top: 0;
    left: 0;
}

[dir="ltr"] .scw-badge {
    left: auto;
    right: 0;
}

.scw-badge-subscribed {
    background: var(--scw-badge-subscribed-bg);
    color: var(--scw-badge-subscribed);
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.scw-badge-not-subscribed {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid rgba(230, 81, 0, 0.2);
}

/* ---------- Certificates / Expertise ---------- */
.scw-details-list {
    list-style: disc;
    padding-right: 20px;
    padding-left: 0;
    margin: 8px 0 16px;
    font-size: 14px;
    color: var(--scw-text-secondary);
    line-height: 1.7;
}

[dir="ltr"] .scw-details-list {
    padding-right: 0;
    padding-left: 20px;
}

.scw-details-list li {
    margin-bottom: 2px;
}

/* ---------- Price Row ---------- */
.scw-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.scw-price-label {
    font-size: 18px;
    font-weight: 700;
}

.scw-course-card:nth-child(1) .scw-price-label {
    color: var(--scw-study-main-btn);
}

.scw-course-card:nth-child(2) .scw-price-label {
    color: var(--scw-study-accent);
}

.scw-course-card:nth-child(3) .scw-price-label {
    color: var(--scw-revision-accent);
}

.scw-price-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--scw-text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.scw-price-currency {
    font-size: 14px;
    font-weight: 600;
    color: var(--scw-text-muted);
}

.scw-price-original {
    font-size: 14px;
    font-weight: 500;
    color: var(--scw-text-muted);
    text-decoration: line-through;
    margin-left: 8px;
}

[dir="ltr"] .scw-price-original {
    margin-left: 0;
    margin-right: 8px;
}

/* ---------- Buy Now Button ---------- */
.scw-buy-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 400;
    font-family: var(--scw-font-family);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    text-decoration: none;
    color: #fff;
}

.scw-buy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    color: #fff;
    text-decoration: none;
}

.scw-buy-btn:active {
    transform: translateY(0);
}

.scw-study .scw-buy-btn {
    background: var(--scw-study-btn);
}

/* .scw-study .scw-buy-btn:hover {
    background: #531DBF;
} */

/* .scw-revision .scw-buy-btn {
    background: var(--scw-revision-btn);
}

.scw-revision .scw-buy-btn:hover {
    background: #B89420;
} */

.scw-buy-btn.scw-subscribed {
    background: var(--scw-badge-subscribed);
    cursor: default;
    opacity: 0.85;
}

.scw-buy-btn.scw-subscribed:hover {
    transform: none;
    box-shadow: none;
}

.scw-buy-btn.scw-in-cart {
    background: #106F97 !important;
}

.scw-buy-btn.scw-in-cart:hover {
    background: #0d5a7a !important;
    opacity: 1;
}

/* ---------- Separator between teachers in same course ---------- */
/* .scw-teacher-separator {
    border: none;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    margin: 14px 0;
} */

/* ---------- Empty State ---------- */
.scw-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    animation: scwFadeInUp 0.4s ease both;
}

.scw-empty-state svg,
.scw-empty-state img {
    width: 180px;
    height: auto;
    margin-bottom: 24px;
    opacity: 0.85;
}

.scw-empty-state p {
    font-size: 15px;
    color: var(--scw-text-muted);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

/* ---------- Loading Skeleton ---------- */
.scw-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--scw-card-gap);
}

.scw-skeleton-card {
    border-radius: var(--scw-border-radius);
    padding: 20px;
    background: #F5F5F5;
    animation: scwPulse 1.5s ease-in-out infinite;
}

.scw-skeleton-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.scw-skeleton-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #E0E0E0;
}

.scw-skeleton-lines {
    flex: 1;
}

.scw-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: #E0E0E0;
    margin-bottom: 8px;
}

.scw-skeleton-line:first-child {
    width: 60%;
}

.scw-skeleton-line:last-child {
    width: 40%;
    margin-bottom: 0;
}

.scw-skeleton-body .scw-skeleton-line {
    width: 90%;
}

.scw-skeleton-body .scw-skeleton-line:nth-child(2) {
    width: 75%;
}

.scw-skeleton-body .scw-skeleton-line:nth-child(3) {
    width: 50%;
}

.scw-skeleton-btn {
    height: 48px;
    border-radius: 50px;
    background: #E0E0E0;
    margin-top: 16px;
}

@keyframes scwPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ---------- Error State ---------- */
.scw-error {
    text-align: center;
    padding: 40px 20px;
    color: #D32F2F;
    font-size: 14px;
}

.scw-error button {
    margin-top: 12px;
    padding: 10px 24px;
    border: 1px solid #D32F2F;
    background: transparent;
    color: #D32F2F;
    border-radius: 50px;
    font-family: var(--scw-font-family);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scw-error button:hover {
    background: #D32F2F;
    color: #fff;
}

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
    .scw-container {
        padding: 30px 24px;
    }

    .scw-course-card {
        padding: 24px;
    }

    /* .scw-tabs {
        max-width: 400px;
    } */
}

@media (max-width: 480px) {
    .scw-tab {
        padding: 10px 16px;
        font-size: 14px;
    }

    .scw-teacher-avatar,
    .scw-teacher-avatar-placeholder {
        width: 44px;
        height: 44px;
        font-size: 17px;
    }

    .scw-teacher-name {
        font-size: 15px;
    }

    .scw-price-value {
        font-size: 20px;
    }

    .scw-course-card {
        padding: 16px;
    }
}

/* ---------- Teacher Profile Modal ---------- */
body.scw-teacher-modal-open {
    overflow: hidden;
}

.scw-teacher-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.scw-teacher-modal.is-open {
    display: flex;
}

.scw-teacher-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

.scw-teacher-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 24px;
    padding: 32px 24px 28px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    animation: scwFadeInUp 0.3s ease both;
}

.scw-teacher-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #1A1A1A;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

[dir="rtl"] .scw-teacher-modal-close {
    right: auto;
    left: 16px;
}

.scw-teacher-modal-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.scw-teacher-modal-avatar,
.scw-teacher-modal-avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #E6F8FF;
    box-shadow: 0 8px 24px rgba(0, 181, 255, 0.18);
}

.scw-teacher-modal-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #c5eaf8, #00B5FF);
    color: #fff;
    font-size: 34px;
    font-weight: 700;
}

.scw-teacher-modal-name {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: var(--scw-text-primary);
    line-height: 1.3;
}

.scw-teacher-modal-subject {
    margin: 0 0 20px;
    font-size: 15px;
    color: var(--scw-text-muted);
}

.scw-teacher-modal-highlights {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    text-align: left;
}

[dir="rtl"] .scw-teacher-modal-highlights {
    text-align: right;
}

.scw-teacher-modal-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--scw-text-secondary);
    line-height: 1.5;
}

.scw-teacher-modal-highlights li:last-child {
    margin-bottom: 0;
}

.scw-teacher-modal-icon {
    flex-shrink: 0;
    display: inline-flex;
    margin-top: 1px;
}

.scw-teacher-modal-about {
    text-align: left;
}

[dir="rtl"] .scw-teacher-modal-about {
    text-align: right;
}

.scw-teacher-modal-about h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--scw-text-primary);
}

.scw-teacher-modal-about p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--scw-text-secondary);
}