/* Card with background image - fills entire card body */
.curriculum-card-body-with-bg {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

/* SVG background for inline SVG images */
.curriculum-card-body-with-bg .curriculum-card-svg-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

.curriculum-card-body-with-bg .curriculum-card-svg-bg svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Washout overlay to ensure content readability */
.curriculum-card-body-with-bg .curriculum-card-washout-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.75);
    z-index: 1;
    pointer-events: none;
}

/* Content wrapper sits above background and overlay */
.curriculum-card-body-with-bg .curriculum-card-content-wrapper {
    position: relative;
    z-index: 2;
}

/* Hover effect - slightly reduce washout to show more image */
.curriculum-card-body-with-bg:hover .curriculum-card-washout-overlay {
    background-color: rgba(255, 255, 255, 0.5);
    transition: background-color 0.3s ease;
}

.curriculum-card-body-with-bg:hover .curriculum-card-svg-bg {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}
/* Base CSS - Common styles shared across all devices */

/* Custom Button Styles */
.btn-join-login, .btn-action {
    background-color: #38bdf8 !important; /* blue */
    color: #fff !important;
    border: none;
}

.btn-join-login:hover, .btn-join-login:focus,
.btn-action:hover, .btn-action:focus {
    background-color: #0ea5e9 !important;
    color: #fff !important;
}

.btn-content {
    background-color: #22c55e !important;
    color: #fff !important;
    border: none;
}

.btn-content:hover, .btn-content:focus {
    background-color: #16a34a !important;
    color: #fff !important;
}

.btn-practice-link {
    background-color: transparent !important;
    color: #6b7280 !important; /* gray-500 */
    border: 1px solid #d1d5db !important; /* gray-300 border */
}

.btn-practice-link:hover, .btn-practice-link:focus {
    background-color: #f9fafb !important; /* gray-50 */
    color: #374151 !important; /* gray-700 */
    border-color: #9ca3af !important; /* gray-400 */
}

.navigator-practice-icon {
    opacity: 0.22;
    transition: opacity 0.18s ease;
}

.navigator-practice-link:hover .navigator-practice-icon,
.navigator-practice-link:focus-visible .navigator-practice-icon {
    opacity: 1;
}

/* Subtle background for outline buttons - similar to navigation buttons */
.btn-outline-primary {
    background-color: rgba(13, 110, 253, 0.05) !important; /* Very light blue background */
    border: none !important;
    color: #0d6efd !important;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: rgba(13, 110, 253, 0.15) !important; /* Slightly darker blue on hover */
    color: #0d6efd !important;
}

.btn-outline-danger {
    background-color: rgba(220, 53, 69, 0.05) !important; /* Very light red background */
    border: none !important;
    color: #dc3545 !important;
}

.btn-outline-danger:hover, .btn-outline-danger:focus {
    background-color: rgba(220, 53, 69, 0.15) !important; /* Slightly darker red on hover */
    color: #dc3545 !important;
}

.btn-outline-success {
    background-color: rgba(25, 135, 84, 0.05) !important; /* Very light green background */
    border: none !important;
    color: #198754 !important;
}

.btn-outline-success:hover, .btn-outline-success:focus {
    background-color: rgba(25, 135, 84, 0.15) !important; /* Slightly darker green on hover */
    color: #198754 !important;
}

.btn-outline-info {
    background-color: rgba(13, 202, 240, 0.05) !important; /* Very light cyan background */
    border: none !important;
    color: #0dcaf0 !important;
}

.btn-outline-info:hover, .btn-outline-info:focus {
    background-color: rgba(13, 202, 240, 0.15) !important; /* Slightly darker cyan on hover */
    color: #0dcaf0 !important;
}

.btn-outline-secondary {
    background-color: rgba(108, 117, 125, 0.05) !important; /* Very light gray background */
    border: none !important;
    color: #6c757d !important;
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: rgba(108, 117, 125, 0.15) !important; /* Slightly darker gray on hover */
    color: #6c757d !important;
}

/* Action bar — clean text-style buttons: no tint, no border, dark readable text */
#navigation-section-row .btn[class*="btn-outline"] {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: 500;
}

#navigation-section-row .btn-outline-secondary {
    color: #1f2937 !important;
}

#navigation-section-row .btn-outline-secondary:hover,
#navigation-section-row .btn-outline-secondary:focus {
    color: #111827 !important;
    background-color: #f3f4f6 !important;
}

#navigation-section-row .btn-outline-primary {
    color: #1f2937 !important;
    font-weight: 600;
}

#navigation-section-row .btn-outline-primary:hover,
#navigation-section-row .btn-outline-primary:focus {
    color: #111827 !important;
    background-color: #f3f4f6 !important;
}

#navigation-section-row .btn-outline-success {
    color: #166534 !important;
}

#navigation-section-row .btn-outline-success:hover,
#navigation-section-row .btn-outline-success:focus {
    color: #14532d !important;
    background-color: #f3f4f6 !important;
}

#navigation-section-row .btn-outline-danger {
    color: #b91c1c !important;
}

#navigation-section-row .btn-outline-danger:hover,
#navigation-section-row .btn-outline-danger:focus {
    color: #991b1b !important;
    background-color: #f3f4f6 !important;
}

#navigation-section-row .btn-outline-warning {
    color: #78350f !important;
}

#navigation-section-row .btn-outline-warning:hover,
#navigation-section-row .btn-outline-warning:focus {
    color: #451a03 !important;
    background-color: #f3f4f6 !important;
}

#navigation-section-row .btn-outline-info {
    color: #374151 !important;
}

#navigation-section-row .btn-outline-info:hover,
#navigation-section-row .btn-outline-info:focus {
    color: #1f2937 !important;
    background-color: #f3f4f6 !important;
}

#navigation-section-row .d-inline-flex.border {
    border: none !important;
}

#navigation-section-row .navigator-practice-link {
    border-right: none !important;
}

#navigation-section-row .navigator-practice-icon {
    opacity: 1;
}

#navigation-section-row .navigator-practice-link:hover .navigator-practice-icon,
#navigation-section-row .navigator-practice-link:focus-visible .navigator-practice-icon {
    opacity: 1;
}

/* Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Override gray text colors in cards + detail views to improve readability */
.card .card-text,
.card .text-muted,
.card .text-secondary,
.detail-mobile-tabs .text-muted,
.detail-mobile-tabs .text-secondary,
.detail-desktop-layout .text-muted,
.detail-desktop-layout .text-secondary {
    color: #000000 !important;
}

/* Description renderer (accordion/pager) uses custom gray palette in templates.
   Force summary/description content to black across course/module/topic detail pages. */
.preview-summary p,
.preview-description,
.preview-description .accordion-body,
.preview-description p,
.preview-description li,
.preview-description span,
.preview-description div,
.preview-description strong {
    color: #000000 !important;
}

/* Common utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Accessible focus styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Card hover effects */
.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Message container styles */
.message-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    z-index: 1060;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.toast-message {
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    position: relative;
}

.message-text {
    font-size: 0.9em;
    line-height: 1.4;
}

.message-close-btn {
    font-size: 0.7em;
}

/* Button helper classes for responsive design */
.btn-responsive {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-responsive .btn-icon {
    flex-shrink: 0;
}

.btn-responsive .btn-text {
    white-space: nowrap;
}

/* Logo styles - shared across all devices */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0d6efd;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 2px;
}

.logo-grok {
    color: #212529;
    font-weight: 700;
}

.tenant-brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.4rem;
    line-height: 1;
    max-width: 100%;
}

.header-tagline-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    width: 100%;
}

.tenant-brand-attribution {
    display: block;
    font-size: 0.72rem;
    line-height: 1.2;
    text-align: center;
}

.tenant-brand-attribution .logo-text {
    font-size: inherit;
    margin-bottom: 0;
}

.tenant-brand-lockup .logo-text,
.tenant-brand-lockup .tenant-brand-separator {
    font-size: inherit;
    line-height: 1;
    margin-bottom: 0;
}

.tenant-brand-lockup .tenant-brand-separator {
    color: #64748b;
    font-weight: 700;
}

.tenant-brand-lockup .tenant-brand-logo {
    height: auto;
    max-height: 2.75rem;
    width: auto;
    max-width: min(12rem, 42vw);
    display: block;
    object-fit: contain;
}

.tenant-footer-wordmark {
    display: inline;
    font-size: inherit;
    line-height: 1;
    margin: 0;
    vertical-align: baseline;
}

.logo-tagline {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 0.3px;
    margin-left: 2px;
}

/* Purchase Button in Navigation - Subtle pulse effect */
.purchase-btn-nav {
    animation: subtle-pulse 3s ease-in-out infinite;
}

.purchase-btn-nav:hover {
    animation: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(25, 135, 84, 0.2) !important;
}

@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.2);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
    }
}
/* Enhanced Purchase Button (Curriculum Detail) - Shimmer + Glow effects */
.purchase-cta-btn {
    position: relative;
    overflow: hidden;
    border-radius: var(--bs-btn-border-radius);
    background: linear-gradient(
        90deg,
        rgba(25, 135, 84, 0.05) 0%,
        rgba(25, 135, 84, 0.15) 25%,
        rgba(25, 135, 84, 0.25) 50%,
        rgba(25, 135, 84, 0.15) 75%,
        rgba(25, 135, 84, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite, glow-pulse 2s ease-in-out infinite;
    will-change: background-position, box-shadow;
}

.purchase-cta-btn:hover {
    animation: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(25, 135, 84, 0.3) !important;
}

@keyframes shimmer {
    0% {
        background-position: 200% center;
    }
    100% {
        background-position: -200% center;
    }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: inset 0 0 0 1px rgba(25, 135, 84, 0.20), inset 0 0 8px rgba(25, 135, 84, 0.18);
    }
    50% {
        box-shadow: inset 0 0 0 1px rgba(25, 135, 84, 0.35), inset 0 0 14px rgba(25, 135, 84, 0.30);
    }
}

/* Learning Streak Day Boxes */
.streak-day-wrapper {
    width: 28px;
    height: 28px;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.streak-day-wrapper:hover {
    transform: scale(1.2);
}

.streak-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* Start from top */
}

.streak-circle-bg {
    opacity: 0.3;
}

.streak-circle-progress {
    transition: stroke-dasharray 0.3s ease, stroke 0.3s ease;
}

/* Add a subtle glow effect for completed days */
.streak-day-wrapper:has(.streak-circle-progress[stroke-dasharray*="100"]) .streak-circle-progress {
    filter: drop-shadow(0 0 3px currentColor);
}

/* Premium Card Styles - for trial/premium content distinction */
.card-premium {
    opacity: 0.65;
    position: relative;
    cursor: not-allowed;
    transition: opacity 0.2s ease;
}

.card-premium:hover {
    opacity: 0.75;
}

.card-premium .btn,
.card-premium a {
    pointer-events: none !important;
    cursor: not-allowed !important;
}

/* Badge styles for trial and premium content */
.badge.bg-success {
    background-color: #22c55e !important;
    color: #fff !important;
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
    color: #fff !important;
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
}

/* Lock icon for premium cards */
.card-premium .bi-lock-fill {
    font-size: 1.2em;
    opacity: 0.6;
}

/* Shared course/curriculum browse cards (fragments/content_*_card.html) */
.explore-course-surface {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.explore-course-surface::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0d6efd 0%, #38bdf8 100%);
    opacity: 0.9;
}

.course-card:hover .explore-course-surface {
    transform: translateY(-4px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.1), 0 4px 10px rgba(15, 23, 42, 0.06);
}

.quiz-card:hover .explore-course-surface,
.curriculum-card:hover .explore-course-surface {
    transform: translateY(-4px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.1), 0 4px 10px rgba(15, 23, 42, 0.06);
}

.explore-quiz-surface::before {
    background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 100%);
}

.explore-course-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    height: 100%;
}

.explore-course-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    align-items: start;
}

.explore-course-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.8rem;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.1rem;
}

.explore-course-heading {
    min-width: 0;
}

.explore-course-kicker {
    margin-bottom: 0.28rem;
    font-size: 0.68rem;
    line-height: 1.1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.explore-course-title {
    display: block;
    color: #0f172a;
    font-size: 1.02rem;
    line-height: 1.25;
    font-weight: 700;
    text-decoration: none;
}

.explore-course-title:hover {
    color: #0d6efd;
}

.explore-course-summary {
    margin: 0;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 auto;
}

.explore-course-footer {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-top: auto;
}

.explore-course-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.explore-course-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.explore-course-chip.is-free {
    background: #ecfeff;
    border-color: #a5f3fc;
    color: #0f766e;
}

.explore-course-chip.is-paid {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

.explore-course-chip.is-upcoming {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.explore-course-chip.is-support {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

@media (max-width: 767.98px) {
    .explore-course-body {
        padding: 1rem;
    }

    .explore-course-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
