/* Course page styles extracted from course.templ */

/* Layout & page background */
.course-modern-page {
    background: radial-gradient(circle at 0% 0%, rgba(0, 140, 255, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(0, 140, 255, 0.03) 0%, transparent 50%),
                #f8fafc;
    min-height: 100vh;
    padding-bottom: 80px;
}

.course-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
    position: relative;
    z-index: 10;
}

@media (max-width: 768px) {
    .course-header-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    .course-stats-badges {
        justify-content: center;
    }
    .course-main-title {
        font-size: 2.25rem;
    }
}

.course-icon-container {
    position: relative;
    flex-shrink: 0;
}
.course-icon-container::before {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 40px;
    background: radial-gradient(circle at center, var(--rgba-primary-3, rgba(0,140,255,0.25)) 0%, transparent 70%);
    z-index: -1;
    opacity: 0.9;
}

.course-main-icon {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.28);
    background: #fff;
    padding: 10px;
    border: 1px solid #eef2f6;
    animation: icon-float 5s ease-in-out infinite;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.course-main-icon:hover {
    transform: rotate(-4deg) scale(1.06);
}

@keyframes icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.qualification-badge {
    display: inline-block;
    padding: 5px 14px;
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    box-shadow: 0 6px 14px -4px var(--rgba-primary-4, rgba(0,140,255,0.4));
}

.course-main-title {
    color: #0f172a;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.6);
}

.course-stats-badges {
    display: flex;
    gap: 1rem;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 7px 15px;
    border-radius: 999px;
}
.stat-badge i {
    opacity: 0.85;
}
.stat-label {
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
}
.stat-value {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.8rem;
}

.course-modern-header {
    position: relative;
    padding: 3rem 0 2rem 0;
    margin-bottom: 1rem;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}
.course-modern-header.has-banner {
    background-size: cover;
    background-position: center;
}
.course-modern-header .container-fluid,
.course-modern-header .row,
.course-modern-header .col-12 {
    position: relative;
    z-index: 5;
}

.dz-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(226, 232, 240, 0) 0%, rgba(226, 232, 240, 1) 15%, rgba(226, 232, 240, 1) 85%, rgba(226, 232, 240, 0) 100%);
    margin: 1.25rem 0;
}

.dz-divider span {
    display: inline-block;
    background: #f8fafc;
    padding: 0 12px;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
}

.content-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 12px 24px -12px rgba(15, 23, 42, 0.12);
}

.content-card .card-header {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 16px 16px 0 0 !important;
}

.content-card .card-title {
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.tag-group .swiper-slide {
    width: auto !important;
}

.content-card .list-group-item {
    border: none;
    padding: 0.85rem 1rem;
}
.content-card .list-group-item + .list-group-item {
    border-top: 1px solid #e2e8f0;
}

.icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.content-empty {
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 16px;
}

.progress-card .progress {
    height: 10px;
    background: #e2e8f0;
}
.progress-card .progress-bar {
    background: linear-gradient(90deg, var(--primary) 0%, #4f46e5 100%);
    box-shadow: 0 10px 20px -10px var(--rgba-primary-5, rgba(0,140,255,0.5));
}
.progress-card .score-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.cta-card {
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 32px -12px var(--rgba-primary-6, rgba(0,140,255,0.55));
}
.cta-card .btn-light {
    color: #0f172a !important;
}

.badge-soft {
    background: #f1f5f9;
    color: #475569;
}

/* Footer styles */
.footer.fixed {
    box-shadow: 0 -8px 30px -12px rgba(15, 23, 42, 0.12);
    border-top: 1px solid #eef2f6;
}
.footer.fixed .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover, #0056b3) 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 10px 24px -8px var(--rgba-primary-5, rgba(0,140,255,0.5)) !important;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.footer.fixed .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -8px var(--rgba-primary-6, rgba(0,140,255,0.55)) !important;
}

.pagination-dots .swiper-pagination-bullet-active {
    background: var(--primary) !important;
    width: 26px;
    border-radius: 999px;
    transition: all 0.3s ease;
}

/* Tour popover */
.tour-popover {
  background-color: var(--primary) !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 15px -3px var(--rgba-primary-4) !important;
  /* below the offcanvas (1045) and its backdrop (1040) so modals cover the tour */
  z-index: 1035 !important;
  margin-bottom: 12px !important;
}
.tour-popover .popover-body {
    color: #fff !important;
    font-weight: 700 !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
}
.tour-popover .popover-arrow::after {
    border-bottom-color: var(--primary) !important;
    border-top-color: var(--primary) !important;
}

@keyframes pulse-tour {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--rgba-primary-7);
    }
    70% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(0, 140, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 140, 255, 0);
    }
}
.pulse-tour {
    animation: pulse-tour 2s infinite !important;
}

/* Course actions card (admin section) */
.course-actions-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.action-icon-wrapper {
    transition: all 0.2s ease;
}
.btn-light:hover .action-icon-wrapper {
    transform: scale(1.1);
}

/* Regen/delete icons hover */
.regen-course, .delete-course:hover {
    transform: scale(1.2) translateY(-4px) translateX(3px) !important;
    transform-origin: center;
    transition: all 0.2s ease-in-out;
}
.regen-course, .delete-course {
    transform: scale(1.1) translateY(-4px) translateX(3px) !important;
    transform-origin: center;
    transition: all 0.2s ease-in-out;
}

/* ============ Dark theme ============ */
/* theme.css stamps html[data-theme="dark"] and supplies the --tt-* scale
   (#0b1120 canvas / #111a2e surfaces / #263450 lines). Everything above
   hardcodes the light palette, so this block re-skins each surface. Brand
   gradients (CTA card, footer button, tour popover) stay as-is. */

html[data-theme="dark"] .course-modern-page {
    background: radial-gradient(circle at 0% 0%, rgba(0, 140, 255, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(0, 140, 255, 0.05) 0%, transparent 50%),
                var(--tt-bg, #0b1120);
}

/* Header band + wave */
html[data-theme="dark"] .course-modern-header {
    background: linear-gradient(180deg, var(--tt-surface, #111a2e) 0%, var(--tt-bg, #0b1120) 100%);
}

/* Hero icon + title */
html[data-theme="dark"] .course-main-icon {
    background: var(--tt-surface, #111a2e);
    border-color: var(--tt-line, #263450);
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .course-main-title {
    color: var(--tt-ink, #e6ebf5);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* Stat badges: already dark chips - lift them off the dark canvas */
html[data-theme="dark"] .stat-badge {
    background: rgba(23, 35, 59, 0.9);
    border-color: var(--tt-line-strong, #33436a);
}

/* Divider */
html[data-theme="dark"] .dz-divider {
    background: linear-gradient(90deg, rgba(38, 52, 80, 0) 0%, rgba(38, 52, 80, 1) 15%, rgba(38, 52, 80, 1) 85%, rgba(38, 52, 80, 0) 100%);
}
html[data-theme="dark"] .dz-divider span {
    background: var(--tt-bg, #0b1120);
    color: var(--tt-muted, #94a3b8);
}

/* Content cards */
html[data-theme="dark"] .content-card {
    background: var(--tt-surface, #111a2e);
    border-color: var(--tt-line, #263450);
    box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .content-card .card-header {
    background: linear-gradient(180deg, var(--tt-surface, #111a2e) 0%, var(--tt-surface-2, #17233b) 100%);
    border-bottom-color: var(--tt-line, #263450);
}
html[data-theme="dark"] .content-card .card-title {
    color: var(--tt-ink, #e6ebf5);
}
html[data-theme="dark"] .content-card .list-group-item + .list-group-item {
    border-top-color: var(--tt-line, #263450);
}

/* Empty state */
html[data-theme="dark"] .content-empty {
    background: var(--tt-surface-2, #17233b);
    border-color: var(--tt-line, #263450);
}

/* Progress card */
html[data-theme="dark"] .progress-card .progress {
    background: var(--tt-surface-3, #1e2c48);
}
html[data-theme="dark"] .progress-card .score-value {
    color: var(--tt-ink, #e6ebf5);
}

/* Soft badge */
html[data-theme="dark"] .badge-soft {
    background: var(--tt-surface-3, #1e2c48);
    color: #c3cddd;
}

/* Fixed footer */
html[data-theme="dark"] .footer.fixed {
    box-shadow: 0 -8px 30px -12px rgba(0, 0, 0, 0.5);
    border-top-color: var(--tt-line, #263450);
}

/* Admin actions card */
html[data-theme="dark"] .course-actions-card {
    background: var(--tt-surface-2, #17233b);
    border-color: var(--tt-line, #263450);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}
