/* =====================================================
   MY ACCOUNT LAYOUT
   ===================================================== */

.woocommerce-MyAccount {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 700px;
    gap: 28px;
    padding: 40px 0;
    align-items: start;
}

/* ── Sidebar Nav ── */
.woocommerce-MyAccount-navigation {
    background: #0f172a;
    border-radius: 20px;
    padding: 8px;
    position: sticky;
    top: 100px;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-MyAccount-navigation li { margin: 0; }

.woocommerce-MyAccount-navigation a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-MyAccount-navigation a:hover {
    background: linear-gradient(135deg, #6366f1, #2563eb);
    color: #fff;
}

/* ── Content Area ── */
.woocommerce-MyAccount-content {
    background: #fff;
    padding: 32px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    min-width: 0;
}

/* ── WooCommerce notices ── */
.woocommerce-MyAccount-content .woocommerce-notices-wrapper,
.woocommerce-MyAccount-content .woocommerce-error,
.woocommerce-MyAccount-content .woocommerce-message,
.woocommerce-MyAccount-content .woocommerce-info {
    margin-bottom: 20px;
}

/* =====================================================
   DASHBOARD PAGE
   ===================================================== */

.bd-ma-dashboard { display: flex; flex-direction: column; gap: 28px; }

/* Welcome Banner */
.bd-ma-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, #6366f1 0%, #2563eb 100%);
    border-radius: 16px;
    padding: 24px 28px;
    color: #fff;
    flex-wrap: wrap;
}

.bd-ma-welcome-left { display: flex; align-items: center; gap: 16px; }

.bd-ma-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.4);
    object-fit: cover;
    flex-shrink: 0;
}

.bd-ma-welcome-text h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #fff;
}

.bd-ma-welcome-text p {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    margin: 0;
}

.bd-ma-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.bd-ma-edit-btn:hover { background: rgba(255,255,255,0.28); color: #fff; }

/* Stats Grid */
.bd-ma-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.bd-ma-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid transparent;
}

.bd-ma-stat-blue  { background: #eff6ff; border-color: #bfdbfe; }
.bd-ma-stat-green { background: #f0fdf4; border-color: #bbf7d0; }
.bd-ma-stat-purple{ background: #faf5ff; border-color: #e9d5ff; }
.bd-ma-stat-orange{ background: #fff7ed; border-color: #fed7aa; }

.bd-ma-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.bd-ma-stat-blue  .bd-ma-stat-icon { background: #2563eb; color: #fff; }
.bd-ma-stat-green .bd-ma-stat-icon { background: #16a34a; color: #fff; }
.bd-ma-stat-purple.bd-ma-stat-card .bd-ma-stat-icon { background: #7c3aed; color: #fff; }
.bd-ma-stat-orange.bd-ma-stat-card .bd-ma-stat-icon { background: #ea580c; color: #fff; }

.bd-ma-stat-info { display: flex; flex-direction: column; gap: 2px; }

.bd-ma-stat-num {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.bd-ma-stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Section Heading */
.bd-ma-section { display: flex; flex-direction: column; gap: 16px; }

.bd-ma-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bd-ma-section-head h3 {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bd-ma-section-head h3 i { color: #6366f1; }

.bd-ma-section-head a {
    font-size: 13px;
    font-weight: 600;
    color: #6366f1;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bd-ma-section-head a:hover { color: #4f46e5; }

/* Continue Learning Grid */
.bd-ma-continue-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.bd-ma-continue-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.bd-ma-continue-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.bd-ma-cc-thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #e5e7eb;
}

.bd-ma-cc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bd-ma-cc-thumb-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #9ca3af;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
}

.bd-ma-cc-badge-done {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #16a34a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bd-ma-cc-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }

.bd-ma-cc-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bd-ma-cc-prog-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bd-ma-cc-prog-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.bd-ma-cc-prog-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #2563eb);
    border-radius: 999px;
    transition: width 0.4s;
}

.bd-ma-cc-prog-pct {
    font-size: 12px;
    font-weight: 700;
    color: #6366f1;
    white-space: nowrap;
}

.bd-ma-cc-frac {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

.bd-ma-cc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #6366f1, #2563eb);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
    align-self: flex-start;
}

.bd-ma-cc-btn:hover { opacity: 0.88; color: #fff; }

/* Quick Links */
.bd-ma-quick-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.bd-ma-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    color: #374151;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}

.bd-ma-quick-link i {
    font-size: 20px;
    color: #6366f1;
}

.bd-ma-quick-link:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
    transform: translateY(-2px);
}

.bd-ma-quick-link:hover i { color: #2563eb; }

/* =====================================================
   MY COURSES PAGE
   ===================================================== */

.bd-ma-mycourses,
.bd-ma-mydownloads,
.bd-ma-certificates { display: flex; flex-direction: column; gap: 24px; }

.bd-ma-course-count {
    background: #e0e7ff;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

.bd-ma-mc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.bd-ma-mc-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.bd-ma-mc-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.09);
    transform: translateY(-2px);
}

.bd-ma-mc-thumb-link {
    position: relative;
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #e5e7eb;
}

.bd-ma-mc-thumb-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.bd-ma-mc-card:hover .bd-ma-mc-thumb-link img { transform: scale(1.04); }

.bd-ma-mc-thumb-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #9ca3af;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
}

.bd-ma-mc-completed-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #16a34a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bd-ma-mc-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.bd-ma-mc-level {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bd-ma-mc-level-beginner     { background: #dcfce7; color: #15803d; }
.bd-ma-mc-level-intermediate { background: #fef9c3; color: #a16207; }
.bd-ma-mc-level-expert       { background: #fee2e2; color: #dc2626; }
.bd-ma-mc-level-all_levels   { background: #e0e7ff; color: #4f46e5; }

.bd-ma-mc-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.4;
}

.bd-ma-mc-title a { color: inherit; text-decoration: none; }
.bd-ma-mc-title a:hover { color: #6366f1; }

.bd-ma-mc-instructor {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bd-ma-mc-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.bd-ma-mc-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #9ca3af;
}

.bd-ma-mc-meta i { color: #6366f1; }

.bd-ma-mc-prog-wrap { display: flex; flex-direction: column; gap: 6px; }

.bd-ma-mc-prog-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 600;
}

.bd-ma-mc-prog-bar {
    height: 7px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.bd-ma-mc-prog-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #2563eb);
    border-radius: 999px;
    transition: width 0.4s;
}

.bd-ma-mc-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #6366f1, #2563eb);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
    margin-top: auto;
    align-self: flex-start;
}

.bd-ma-mc-btn:hover { opacity: 0.88; color: #fff; }

/* Empty state */
.bd-ma-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    text-align: center;
}

.bd-ma-empty i {
    font-size: 48px;
    color: #d1d5db;
}

.bd-ma-empty h4 {
    font-size: 18px;
    color: #374151;
    margin: 0;
}

.bd-ma-empty p {
    font-size: 14px;
    color: #9ca3af;
    margin: 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1200px) {
    .bd-ma-quick-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991px) {
    .woocommerce-MyAccount {
        grid-template-columns: 1fr;
    }

    .woocommerce-MyAccount-navigation { position: static; }

    .woocommerce-MyAccount-navigation ul {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .woocommerce-MyAccount-navigation a {
        padding: 8px 14px;
        font-size: 13px;
    }

    .bd-ma-stats { grid-template-columns: repeat(2, 1fr); }
    .bd-ma-continue-grid { grid-template-columns: repeat(2, 1fr); }
    .bd-ma-mc-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .woocommerce-MyAccount-content { padding: 20px 16px; }
    .bd-ma-welcome { padding: 18px; }
    .bd-ma-welcome-text h2 { font-size: 16px; }
    .bd-ma-stats { grid-template-columns: repeat(2, 1fr); }
    .bd-ma-continue-grid { grid-template-columns: 1fr; }
    .bd-ma-quick-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .bd-ma-stats { grid-template-columns: 1fr; }
    .bd-ma-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================
   DARK MODE
   ===================================================== */

body.dark-mode .woocommerce-MyAccount-content {
    background: #1e293b;
    border-color: rgba(255,255,255,0.08);
}

body.dark-mode .woocommerce-MyAccount-navigation { background: #0f172a; }

body.dark-mode .bd-ma-stat-blue  { background: rgba(37,99,235,0.15);  border-color: rgba(37,99,235,0.25); }
body.dark-mode .bd-ma-stat-green { background: rgba(22,163,74,0.15);  border-color: rgba(22,163,74,0.25); }
body.dark-mode .bd-ma-stat-purple{ background: rgba(124,58,237,0.15); border-color: rgba(124,58,237,0.25); }
body.dark-mode .bd-ma-stat-orange{ background: rgba(234,88,12,0.15);  border-color: rgba(234,88,12,0.25); }

body.dark-mode .bd-ma-stat-num   { color: #f1f5f9; }
body.dark-mode .bd-ma-stat-label { color: #94a3b8; }

body.dark-mode .bd-ma-section-head h3 { color: #f1f5f9; }

body.dark-mode .bd-ma-continue-card {
    background: #0f172a;
    border-color: rgba(255,255,255,0.08);
}

body.dark-mode .bd-ma-cc-title { color: #f1f5f9; }
body.dark-mode .bd-ma-cc-prog-bar { background: rgba(255,255,255,0.1); }
body.dark-mode .bd-ma-cc-frac { color: #64748b; }

body.dark-mode .bd-ma-quick-link {
    background: #0f172a;
    border-color: rgba(255,255,255,0.08);
    color: #94a3b8;
}

body.dark-mode .bd-ma-quick-link:hover {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.3);
    color: #a5b4fc;
}

body.dark-mode .bd-ma-mc-card {
    background: #0f172a;
    border-color: rgba(255,255,255,0.08);
}

body.dark-mode .bd-ma-mc-title,
body.dark-mode .bd-ma-mc-title a { color: #f1f5f9; }

body.dark-mode .bd-ma-mc-instructor { color: #94a3b8; }
body.dark-mode .bd-ma-mc-meta span { color: #64748b; }
body.dark-mode .bd-ma-mc-prog-bar  { background: rgba(255,255,255,0.1); }
body.dark-mode .bd-ma-mc-prog-row  { color: #64748b; }
body.dark-mode .bd-ma-mc-thumb-ph  { background: linear-gradient(135deg, #1e293b, #0f172a); }

body.dark-mode .bd-ma-empty i { color: #374151; }
body.dark-mode .bd-ma-empty h4 { color: #94a3b8; }
body.dark-mode .bd-ma-empty p  { color: #475569; }

/* =====================================================
   MY DOWNLOADS
   ===================================================== */

.bd-ma-dl-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bd-ma-dl-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px 20px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.bd-ma-dl-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.bd-ma-dl-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #6366f1;
}

.bd-ma-dl-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bd-ma-dl-body { flex: 1; min-width: 0; }

.bd-ma-dl-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bd-ma-dl-meta {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bd-ma-dl-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: linear-gradient(135deg, #6366f1, #2563eb);
    color: #fff !important;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.bd-ma-dl-btn:hover { opacity: 0.88; }

/* ── Dark mode for downloads ── */
body.dark-mode .bd-ma-dl-card {
    background: #0f172a;
    border-color: rgba(255,255,255,0.08);
}
body.dark-mode .bd-ma-dl-title { color: #f1f5f9; }
body.dark-mode .bd-ma-dl-meta  { color: #64748b; }

/* =====================================================
   CERTIFICATES
   ===================================================== */

.bd-ma-cert-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.bd-ma-cert-card {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.bd-ma-cert-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.09);
    transform: translateY(-2px);
}

.bd-ma-cert-ribbon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(245,158,11,.4);
    z-index: 1;
}

.bd-ma-cert-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #e5e7eb;
}

.bd-ma-cert-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.bd-ma-cert-card:hover .bd-ma-cert-thumb img { transform: scale(1.04); }

.bd-ma-cert-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #9ca3af;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
}

.bd-ma-cert-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bd-ma-cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #15803d;
    background: #dcfce7;
    padding: 3px 10px;
    border-radius: 999px;
    width: fit-content;
}

.bd-ma-cert-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.4;
}

.bd-ma-cert-title a { color: inherit; text-decoration: none; }
.bd-ma-cert-title a:hover { color: #6366f1; }

.bd-ma-cert-instructor {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Dark mode for certificates ── */
body.dark-mode .bd-ma-cert-card {
    background: #0f172a;
    border-color: rgba(255,255,255,0.08);
}
body.dark-mode .bd-ma-cert-title,
body.dark-mode .bd-ma-cert-title a { color: #f1f5f9; }
body.dark-mode .bd-ma-cert-instructor { color: #94a3b8; }
body.dark-mode .bd-ma-cert-ph { background: linear-gradient(135deg, #1e293b, #0f172a); }

/* ── Responsive ── */
@media (max-width: 640px) {
    .bd-ma-cert-grid { grid-template-columns: 1fr; }
    .bd-ma-dl-card { flex-wrap: wrap; }
    .bd-ma-dl-btn { width: 100%; justify-content: center; }
}
