/* ═════════════════════════════════════════════════════════════════
   DS Bridge - Frontend "My Courses" Tab
   Designed to match Woodmart + WooCommerce My Account dashboard
   RTL-first design
   ═════════════════════════════════════════════════════════════════ */

/* ─── Section Header ─────────────────────────────────────────── */
.dsb-courses-section {
    font-family: inherit;
}

.dsb-courses-header {
    margin-bottom: 28px;
}

.dsb-courses-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
}

.dsb-courses-subtitle {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* ─── Courses Grid ───────────────────────────────────────────── */
.dsb-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ─── Course Card ────────────────────────────────────────────── */
.dsb-course-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.dsb-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15), 0 4px 16px rgba(0, 0, 0, 0.06);
    border-color: #c7d2fe;
}

/* ─── Thumbnail ──────────────────────────────────────────────── */
.dsb-course-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
}

.dsb-course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.dsb-course-card:hover .dsb-course-thumb img {
    transform: scale(1.05);
}

.dsb-no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dsb-thumb-placeholder {
    font-size: 48px;
    opacity: 0.6;
}

/* Overlay with play button */
.dsb-course-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dsb-course-card:hover .dsb-course-overlay {
    opacity: 1;
}

.dsb-play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.dsb-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
    color: #4f46e5;
}

.dsb-play-btn i {
    margin-right: -3px;
    /* RTL: visual adjustment for play icon */
}

/* ─── Course Info ────────────────────────────────────────────── */
.dsb-course-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dsb-course-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Progress Bar ───────────────────────────────────────────── */
.dsb-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.dsb-progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.dsb-progress-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.dsb-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: dsb-shimmer 2s ease-in-out infinite;
}

@keyframes dsb-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.dsb-progress-text {
    font-size: 12px;
    font-weight: 700;
    color: #6366f1;
    min-width: 36px;
    text-align: center;
}

/* ─── Course Meta ────────────────────────────────────────────── */
.dsb-course-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 12px;
    color: #94a3b8;
}

.dsb-meta-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── Course Button ──────────────────────────────────────────── */
.dsb-course-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.dsb-course-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
    color: #fff !important;
}

.dsb-course-btn:active {
    transform: translateY(0);
}

.dsb-course-btn i {
    font-size: 13px;
}

/* ─── Empty State ────────────────────────────────────────────── */
.dsb-empty-courses {
    text-align: center;
    padding: 60px 24px;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #e2e8f0;
}

.dsb-empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: dsb-float 3s ease-in-out infinite;
}

@keyframes dsb-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.dsb-empty-courses h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
}

.dsb-empty-courses p {
    color: #64748b;
    font-size: 14px;
    margin: 0 0 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.dsb-browse-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff !important;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.dsb-browse-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    color: #fff !important;
}

/* ─── Error Notice ───────────────────────────────────────────── */
.dsb-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.dsb-notice-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.dsb-notice .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.dsb-notice p {
    margin: 0;
    font-size: 14px;
}

/* ─── Active menu item highlight ─────────────────────────────── */
.woocommerce-MyAccount-navigation-link--my-courses.is-active a,
.woocommerce-MyAccount-navigation-link--my-courses a:hover {
    color: #6366f1 !important;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .dsb-courses-grid {
        grid-template-columns: 1fr;
    }

    .dsb-courses-header h2 {
        font-size: 20px;
    }

    .dsb-course-info {
        padding: 16px;
    }

    .dsb-empty-courses {
        padding: 40px 16px;
    }
}

@media (max-width: 480px) {
    .dsb-course-card:hover {
        transform: none;
    }
}