/* App-Specific Components - Fluent Up Application
 * Components that are unique to this application and not part of Bootstrap
 * These use CSS variables from bootstrap-theme.css for easy theming
 */

/* ============================================
   Play and Record Buttons
   ============================================ */

.btn-play {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10%;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    background: rgba(var(--bs-success-rgb), 0.95);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    min-width: 60px; /* Minimum touch target size */
    min-height: 60px;
    width: 60px;
    height: 60px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    transition: transform 0.2s ease;
    cursor: pointer;
    /* Android touch optimization */
    -webkit-tap-highlight-color: rgba(0, 168, 150, 0.3);
    touch-action: manipulation;
}

.btn-play.small {
    display: inline-flex !important;
    min-width: 44px !important; /* Minimum touch target for Android */
    min-height: 44px !important;
    width: 44px !important;
    height: 44px !important;
}

.btn-play.small::before {
    font-size: 0.8rem !important;
}

.btn-play:hover {
    transform: scale(1.05);
}

.btn-play:active {
    transform: scale(0.95);
}

/* Add the volume icon using CSS pseudo-element */
.btn-play::before {
    content: "\f483"; /* Bootstrap Icons volume-up unicode */
    font-family: "bootstrap-icons";
    font-size: 1.5rem;
}

.btn-record {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10%;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    background: rgba(var(--bs-danger-rgb), 0.95);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    min-width: 60px; /* Minimum touch target size */
    min-height: 60px;
    width: 60px;
    height: 60px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    transition: transform 0.2s ease;
    cursor: pointer;
    /* Android touch optimization */
    -webkit-tap-highlight-color: rgba(255, 107, 107, 0.3);
    touch-action: manipulation;
}

/* will-change only for active animation state */
.btn-record.recording {
    will-change: transform;
}

.btn-record:hover {
    transform: scale(1.05);
}

.btn-record:active {
    transform: scale(0.95);
}

/* Add the record icon using CSS pseudo-element */
.btn-record::before {
    content: "\f48D"; /* Bootstrap Icons record unicode */
    font-family: "bootstrap-icons";
    font-size: 1.5rem;
}

/* Hide ::before icon when there's an inner icon element */
.btn-record i {
    font-size: 1.5rem;
}

.btn-record:has(i)::before {
    content: none;
}

/* Pulse animation for recording state - optimized with pseudo-element instead of box-shadow */
.btn-record.recording {
    animation: pulse-recording-transform 1.5s ease-in-out infinite;
    background: rgba(var(--bs-danger-rgb), 1);
    position: relative;
}

/* Pseudo-element for pulse effect - much more performant than animating box-shadow */
.btn-record.recording::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 10%;
    background: rgba(var(--bs-danger-rgb), 0.3);
    transform: translate(-50%, -50%) scale(1);
    animation: pulse-recording-ring 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes pulse-recording-transform {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes pulse-recording-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Pulse animation for any recording button */
.recording-pulse {
    animation: pulse-recording-transform 1.5s ease-in-out infinite;
    position: relative;
}

.recording-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 10%;
    background: rgba(var(--bs-danger-rgb), 0.3);
    transform: translate(-50%, -50%) scale(1);
    animation: pulse-recording-ring 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* Toast indicator while speech recognition listens */
.recording-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--bs-zindex-toast, 1080);
    background: rgba(var(--bs-danger-rgb), 0.95);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
    max-width: calc(100vw - 2rem); /* Prevent overflow on small screens */
    box-sizing: border-box;
}

.recording-toast__icon {
    font-size: 1.25rem;
    animation: recording-toast-pulse 1.2s ease-in-out infinite;
}

.recording-toast__label {
    font-weight: 600;
    letter-spacing: 0.02em;
}

@keyframes recording-toast-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.6;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   Selector Component
   ============================================ */

.selector-item {
    padding: 0.7rem;
    background: rgba(var(--bs-body-bg-rgb), 0.95);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    transition: transform 0.2s ease;
    margin-bottom: 6px;
}

.selector-item:hover {
    border-color: var(--bs-primary);
}

/* ============================================
   Card Tiles
   ============================================ */

.card-tile{
    background: var(--bs-secondary-bg);
    border: 2px solid transparent;
    border-radius: var(--bs-border-radius);
}


.card-tile:hover {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-primary);
}

.card-tile i {
    color: var(--bs-primary);
}

/* ============================================
   Coming Soon Card Tiles
   ============================================ */

.card-tile-coming-soon {
    position: relative;
    opacity: 0.85;
    border: 2px dashed var(--bs-warning);
    background: linear-gradient(135deg, var(--bs-secondary-bg) 0%, rgba(var(--bs-warning-rgb), 0.05) 100%);
}

.card-tile-new {
    position: relative;
    opacity: 0.85;
    border: 2px dashed var(--bs-success);
    background: linear-gradient(135deg, var(--bs-secondary-bg) 0%, rgba(var(--bs-warning-rgb), 0.05) 100%);
}

.card-tile-new i {
    color: var(--bs-success);
    /* Removed expensive filter - use text-shadow if needed for small text effects */
}


.card-tile-coming-soon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(var(--bs-warning-rgb), 0.1) 100%);
    border-radius: var(--bs-border-radius);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-tile-coming-soon:hover {
    opacity: 1;
    border-color: var(--bs-warning);
    border-style: solid;
    transform: translateY(-2px);
}

.card-tile-coming-soon:hover::before {
    opacity: 1;
}

.card-tile-coming-soon i {
    color: var(--bs-warning);
    /* Removed expensive filter - use text-shadow if needed for small text effects */
}

.card-tile-coming-soon .small.text-muted {
    color: var(--bs-warning) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

/* ============================================
   Range Option Component
   ============================================ */

.range-option,
.mode-option {
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
}

.range-option:hover,
.mode-option:hover {
    transform: translateY(-8px) scale(1.005);
}

.range-option.selected,
.mode-option.selected {
    border: 3px solid var(--bs-success);
    box-shadow: 0 0 0 3px rgba(var(--bs-success-rgb), 0.25);
}

.range-option.selected::after,
.mode-option.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bs-success);
    color: white;
    min-width: 28px; /* Slightly larger for better touch targets */
    min-height: 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

/* ============================================
   Feature Card Component
   ============================================ */

.feature-card {
    background: var(--bs-primary-transparent, rgba(0, 52, 89, 0.95));
    color: white;
    border-radius: var(--bs-border-radius);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-2px);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card h3,
.feature-card p,
.feature-card .btn {
    position: relative;
    z-index: 1000;
}

.feature-card .btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease;
}

.feature-card .btn:hover {
    transform: translateY(-1px);
}

/* ============================================
   Completion Icon
   ============================================ */

.completion-icon {
    font-size: 4rem;
    color: var(--bs-warning);
    margin-bottom: 1rem;
}

.completion-icon i {
    display: block;
}

/* ============================================
   Progress Container Fixed
   ============================================ */

.progress-container-fixed {
    position: fixed;
    top: 56px; /* Match navbar height - Bootstrap default navbar height */
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw; /* Prevent horizontal overflow */
    z-index: 1020; /* Below navbar (1030) but above content */
    background: var(--bs-body-bg);
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* Small devices */
@media (max-width: 768px) {
    .progress-container-fixed {
        top: 57px; /* Match navbar height for small devices */
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100vw; /* Prevent horizontal overflow */
    }
}

.progress-container-fixed .progress {
    height: 6px;
    --bs-progress-border-radius: 0;
}

/* ============================================
   Narrative Reader
   ============================================ */

/* Sentence container uses Bootstrap utilities: border-start, rounded, p-2, mb-2, active state */
/* Show/hide uses Bootstrap display utilities: d-none, d-block, d-inline */

/* Narrative reader text wrapping - applies to all screen sizes */
[data-sentence-index] {
    min-width: 0; /* Allow flex item to shrink below content size */
    overflow-x: hidden; /* Prevent horizontal overflow */
}

[data-sentence-index] .flex-grow-1 {
    min-width: 0; /* Critical for flex items to allow text wrapping */
    overflow-wrap: break-word;
    word-wrap: break-word; /* Fallback for older Android browsers */
    word-break: normal; /* Use normal to avoid issues on Android, rely on overflow-wrap */
    max-width: 100%;
}

[data-sentence-index] .sentence-target,
[data-sentence-index] .sentence-translation,
[data-sentence-index] .speech-comparison {
    overflow-wrap: break-word;
    word-wrap: break-word; /* Fallback for older Android browsers */
    word-break: normal; /* Use normal to avoid issues on Android, rely on overflow-wrap */
    max-width: 100%;
    min-width: 0; /* Allow shrinking */
}

.sentence-target {
    hyphens: auto; /* May not work on all Android browsers, but safe to include */
    -webkit-hyphens: auto; /* WebKit prefix for better Android support */
    white-space: normal; /* Ensure text wraps */
}

/* Mobile-specific fixes for narrative reader using Bootstrap responsive utilities */
@media (max-width: 768px) {
    /* Ensure text wrapping on mobile */
    [data-sentence-index] .flex-grow-1,
    [data-sentence-index] .sentence-target,
    [data-sentence-index] .sentence-translation,
    [data-sentence-index] .speech-comparison {
        overflow-wrap: break-word;
        word-wrap: break-word; /* Fallback for older Android browsers */
        word-break: normal; /* Use normal to avoid issues on Android, rely on overflow-wrap */
        max-width: 100%;
        min-width: 0;
    }

    .sentence-target {
        hyphens: auto; /* May not work on all Android browsers, but safe to include */
        -webkit-hyphens: auto; /* WebKit prefix for better Android support */
        white-space: normal;
    }

    /* Ensure sentence containers don't overflow */
    [data-sentence-index] {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Mobile viewport fixes for zoom - Android HyperOS specific */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%; /* Standard property */
        height: 100%;
        height: -webkit-fill-available;
        overflow-x: hidden; /* Prevent horizontal scroll */
        width: 100%;
        max-width: 100vw;
    }

    /* Android text rendering optimizations */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
        min-height: 100%;
        min-height: -webkit-fill-available;
        min-height: 100dvh;
        min-height: 100vh;
        overflow-x: hidden; /* Prevent horizontal scroll on Android */
        width: 100%;
        max-width: 100vw;
        position: relative;
    }

    /* Ensure all containers respect viewport on Android */
    .container-fluid,
    .main-content,
    .main-content .card {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
}

/* Word highlighting classes - kept as semantic classes with Bootstrap-like styling */
.highlighted,
.word-correct,
.word-incorrect,
.word-missing,
.word-extra,
.word-recognized,
.word-not-recognized {
    border-radius: var(--bs-border-radius-sm);
    padding: 0.15rem 0.35rem;
}

.highlighted {
    background-color: rgba(255, 193, 7, 0.3);
}

.word-correct {
    background-color: rgba(var(--bs-success-rgb), 0.2);
    color: var(--bs-success);
}

.word-incorrect,
.word-extra {
    background-color: rgba(var(--bs-danger-rgb), 0.2);
    color: var(--bs-danger);
}

.word-incorrect {
    text-decoration: line-through;
}

.word-missing {
    background-color: rgba(var(--bs-warning-rgb), 0.2);
    color: var(--bs-warning);
}

.word-recognized {
    background-color: rgba(var(--bs-success-rgb), 0.3);
    color: var(--bs-success);
    font-weight: 600;
}

.word-not-recognized {
    background-color: rgba(var(--bs-warning-rgb), 0.25);
    color: var(--bs-warning);
}

/* Vocabulary word tooltip styling - uses Bootstrap variables */
.vocab-word {
    border-bottom: 1px dotted var(--bs-primary);
    cursor: help;
}

.vocab-word:hover {
    background-color: var(--bs-primary-bg-subtle);
    border-bottom-color: var(--bs-secondary);
}

/* ============================================
   High DPI / Retina Display Optimizations
   ============================================ */

/* High-DPI devices (2x and above) */
@media screen and (min-resolution: 192dpi),
       screen and (min-resolution: 2dppx),
       screen and (-webkit-min-device-pixel-ratio: 2) {
    /* Ensure buttons and interactive elements are crisp */
    .btn-play,
    .btn-record,
    .selector-item,
    .card-tile,
    .range-option,
    .mode-option,
    .feature-card {
        /* Optimize border rendering for high DPI */
        border-image: none;
        border-image-width: 1;
        -webkit-border-image: none;
    }

    /* Optimize icon rendering */
    .btn-play::before,
    .btn-record::before {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Ensure progress bar is visible */
    .progress-container-fixed .progress {
        height: 8px; /* Slightly thicker for high DPI visibility */
    }
}

/* Very High-DPI devices (3x and above) */
@media screen and (min-resolution: 288dpi),
       screen and (min-resolution: 3dppx),
       screen and (-webkit-min-device-pixel-ratio: 3) {
    /* Enhanced rendering for very high DPI */
    .btn-play,
    .btn-record,
    .selector-item,
    .card-tile,
    .range-option,
    .mode-option,
    .feature-card {
        border-image: none;
        border-image-width: 1;
        -webkit-border-image: none;
    }

    /* Optimize progress bar */
    .progress-container-fixed .progress {
        height: 10px;
    }

    /* Ensure recording toast is crisp */
    .recording-toast {
        border-width: 0.5px;
    }
}

/* Ultra High-DPI devices (4x and above) */
@media screen and (min-resolution: 384dpi),
       screen and (min-resolution: 4dppx),
       screen and (-webkit-min-device-pixel-ratio: 4) {
    /* Maximum quality for ultra high DPI */
    .btn-play,
    .btn-record,
    .selector-item,
    .card-tile,
    .range-option,
    .mode-option,
    .feature-card,
    .recording-toast {
        border-image: none;
        border-image-width: 1;
        -webkit-border-image: none;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
    display: none !important;
}

.card-header{
    border-bottom: none;
}

/* ============================================
   System Diagnostics Widget
   ============================================ */

.system-diagnostics-widget {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: var(--bs-spacer);
    background: transparent;
}

.system-diagnostics-widget .diagnostic-item {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.system-diagnostics-widget .diagnostic-item.success {
    background-color: rgba(var(--bs-success-rgb), 0.1);
    border-color: rgba(var(--bs-success-rgb), 0.3);
}

.system-diagnostics-widget .diagnostic-item.error {
    background-color: rgba(var(--bs-danger-rgb), 0.1);
    border-color: rgba(var(--bs-danger-rgb), 0.3);
}

/* Dark mode styles for system diagnostics widget */
[data-bs-theme="dark"] .system-diagnostics-widget {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .system-diagnostics-widget p,
[data-bs-theme="dark"] .system-diagnostics-widget li {
    color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .system-diagnostics-widget h6 {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .system-diagnostics-widget .diagnostics-checklist li {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .system-diagnostics-widget .diagnostic-item {
    background-color: var(--bs-secondary-bg-subtle);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .system-diagnostics-widget .diagnostic-item.success {
    background-color: rgba(var(--bs-success-rgb), 0.15);
    border-color: rgba(var(--bs-success-rgb), 0.4);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .system-diagnostics-widget .diagnostic-item.error {
    background-color: rgba(var(--bs-danger-rgb), 0.15);
    border-color: rgba(var(--bs-danger-rgb), 0.4);
    color: var(--bs-body-color);
}

.practiced {
    color: var(--bs-success);
}

.modal-dialog{
    max-width: 90vw; /* Use viewport width instead of height for better Android support */
    max-width: min(90vw, 600px); /* Cap at 600px for larger screens */
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Ensure modal doesn't overflow on very small screens */
@media (max-width: 480px) {
    .modal-dialog {
        max-width: calc(100vw - 1rem); /* Leave small margin on very small screens */
        margin: 0.5rem;
    }
}

/* ============================================
   Chat Interface Components
   ============================================ */

/* Chat container - uses Bootstrap flex utilities */
.chat-container {
    height: 100%;
    min-height: 0;
    background: var(--bs-body-bg);
    overflow: hidden;
    box-shadow: var(--bs-box-shadow);
}

/* Chat header - uses Bootstrap gradient utilities */
.chat-header {
    background: var(--bs-primary);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* Chat messages area - uses Bootstrap overflow utilities */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    background: var(--bs-body-bg);
    -webkit-overflow-scrolling: touch;
}

/* Chat message - uses Bootstrap flex utilities */
.chat-message {
    display: flex;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    flex-direction: row-reverse;
}

/* Chat message avatar - uses Bootstrap border utilities */
.chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.chat-message.user .chat-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chat-message.assistant .chat-message-avatar {
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
}

/* Chat message content - uses Bootstrap border-radius utilities */
.chat-message-content {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--bs-border-radius);
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 0.95rem;
    position: relative;
    overflow: visible; /* Allow absolutely positioned buttons to be visible */
}

.chat-message.user .chat-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chat-message.assistant .chat-message-content {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    padding-right: 2.5rem; /* Make room for vertical action buttons and vertical line */
    min-height: 7.5rem; /* Ensure enough height: top padding (0.75rem) + button top offset (0.75rem) + 3 buttons (1.5rem × 3 = 4.5rem) + 2 gaps (0.5rem × 2 = 1rem) + bottom padding (0.75rem) = 7.75rem, rounded to 7.5rem */
}

/* Chat message content header for action buttons - Mobile: vertical */
.chat-message-content-header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
}

/* Vertical line separator for action buttons - Mobile */
.chat-message-content-header::after {
    content: '';
    position: absolute;
    right: 0;
    top: -0.25rem;
    bottom: -0.25rem;
    width: 1px;
    /* background: var(--bs-border-color); */
    height: calc(100% + 0.5rem);
}

/* Chat message time - uses Bootstrap text utilities */
.chat-message-time {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    margin-top: 0.25rem;
    opacity: 0.7;
}

/* Chat suggestion - uses Bootstrap alert-like styling */
.chat-suggestion {
    padding: 0.75rem 1rem;
    background: rgba(var(--bs-warning-rgb), 0.1);
    border-left: 3px solid var(--bs-warning);
    border-radius: var(--bs-border-radius);
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-suggestion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--bs-warning-text-emphasis);
}

.chat-suggestion-text {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .chat-suggestion {
    background: rgba(var(--bs-warning-rgb), 0.15);
    border-left-color: var(--bs-warning);
}

/* Chat message translation - uses Bootstrap border utilities */
.chat-message-translation {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(var(--bs-info-rgb), 0.2);
    font-size: 0.9rem;
    color: var(--bs-info-text-emphasis);
    font-style: italic;
}

[data-bs-theme="dark"] .chat-message-translation {
    border-top-color: rgba(var(--bs-info-rgb), 0.3);
}

/* Chat action buttons - minimal styling, uses Bootstrap button utilities */
.chat-translation-toggle,
.chat-audio-button,
.chat-favorite-button {
    background: none;
    border: none;
    color: var(--bs-secondary-color);
    cursor: pointer;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, opacity 0.2s ease;
    font-size: 0.875rem;
    opacity: 0.7;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    box-sizing: border-box;
}

.chat-translation-toggle:hover,
.chat-audio-button:hover,
.chat-favorite-button:hover {
    opacity: 1;
}

.chat-translation-toggle:hover {
    color: var(--bs-info);
}

.chat-translation-toggle.active {
    color: var(--bs-info);
    opacity: 1;
}

.chat-audio-button:hover,
.chat-audio-button.playing {
    color: var(--bs-primary);
    opacity: 1;
}

.chat-favorite-button:hover {
    color: var(--bs-danger);
}

.chat-suggestion-header .chat-favorite-button {
    margin-left: auto;
}

/* Chat input container - uses Bootstrap border utilities */
.chat-input-container {
    padding: 0.5rem;
    background: var(--bs-body-bg);
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    min-height: 65px;
    max-height: 180px;
    padding: 0.6rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    resize: none;
    font-size: 1rem;
    line-height: 1.5;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Chat mic button - reuses btn-record styles */
.chat-mic-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    flex-shrink: 0;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.chat-mic-button:hover:not(:disabled) {
    transform: scale(1.05);
    background: var(--bs-secondary);
    color: white;
    box-shadow: var(--bs-box-shadow);
}

.chat-mic-button:active:not(:disabled) {
    transform: scale(0.95);
}

.chat-mic-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-mic-button.recording {
    background: var(--bs-danger);
    color: white;
    border-color: var(--bs-danger);
    animation: pulse-recording-transform 1.5s ease-in-out infinite;
}

/* Chat send button - uses Bootstrap gradient */
.chat-send-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.chat-send-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0.25rem 0.5rem rgba(102, 126, 234, 0.3);
}

.chat-send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.chat-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Chat typing indicator - uses Bootstrap utilities */
.chat-typing-indicator {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bs-secondary-bg);
    border-radius: var(--bs-border-radius-lg);
    max-width: 70px;
}

.chat-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bs-secondary-color);
    animation: typing 1.4s infinite;
}

.chat-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat empty state - uses Bootstrap text utilities */
.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: var(--bs-secondary-color);
}

.chat-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Chat header mobile menu */
.chat-header-menu {
    display: none;
}

.chat-hamburger-button {
    width: 38px;
    height: 38px;
    border-radius: var(--bs-border-radius);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.chat-hamburger-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-header-dropdown {
    position: absolute;
    top: 100%;
    right: 1rem;
    margin-top: 0.5rem;
    background: white;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow-lg);
    min-width: 180px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.chat-header-dropdown.show {
    display: block;
}

.chat-header-dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--bs-body-color);
    text-decoration: none;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

.chat-header-dropdown-item:last-child {
    border-bottom: none;
}

.chat-header-dropdown-item:hover {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

.chat-header-dropdown-item i {
    margin-right: 0.5rem;
    width: 1.25rem;
}

[data-bs-theme="dark"] .chat-header-dropdown {
    background: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .chat-header-dropdown-item {
    color: var(--bs-body-color);
    border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .chat-header-dropdown-item:hover {
    background: var(--bs-secondary-bg);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .chat-message.user .chat-message-content {
    background: var(--bs-gray-900);
}

[data-bs-theme="dark"] .chat-message.assistant .chat-message-content {
    background: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}

/* [data-bs-theme="dark"] .chat-message-content-header::after {
    background: var(--bs-border-color);
} */

/* Chat scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bs-secondary-bg);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--bs-border-color);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary-color);
}

/* Responsive adjustments */
@media (min-width: 769px) {
    .chat-message-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .chat-message-content {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    /* Desktop: horizontal button alignment */
    .chat-message-content-header {
        flex-direction: row;
        align-items: center;
        top: 0.75rem;
        right: 0.75rem;
        gap: 0.5rem;
    }

    /* Horizontal line separator for desktop */
    .chat-message-content-header::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: auto;
        width: calc(100% + 0.5rem);
        height: 1px;
        /* background: var(--bs-border-color); */
    }

    /* Reduce padding-right for desktop since buttons are horizontal */
    .chat-message.assistant .chat-message-content {
        padding-right: 2.5rem;
        min-height: auto; /* Let content determine height on desktop */
    }

    .chat-mic-button,
    .chat-send-button {
        width: 48px;
        height: 48px;
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .chat-header-actions {
        display: none !important;
    }

    .chat-header-menu {
        display: block;
        position: relative;
    }

    .chat-header {
        position: relative;
    }
}

/* ============================================
   Context Selector Components
   ============================================ */

/* Context card - minimal customization, uses Bootstrap card utilities */
.context-card {
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
}

.context-card:hover {
    border-color: #667eea !important;
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(102, 126, 234, 0.15);
}

.context-card.selected {
    border-color: #667eea !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.context-card-icon {
    color: #667eea;
}

.context-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.context-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Custom context toggle - minimal customization */
.custom-context-toggle {
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-context-toggle:hover {
    border-color: #667eea !important;
}

.custom-context-toggle.active {
    border-color: #667eea !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

/* Custom context form - uses Bootstrap utilities */
.custom-context-form {
    display: none;
}

.custom-context-form.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom submit button - minimal gradient customization */
.btn-submit-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: all 0.3s ease;
    min-width: 200px;
}

.btn-submit-custom:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(102, 126, 234, 0.3);
}

/* ============================================
   Circular Progress Indicator
   ============================================ */

.circular-progress {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.circular-progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-progress-bg {
    fill: none;
    stroke: var(--bs-secondary-bg);
    stroke-width: 8;
}

.circular-progress-bar {
    fill: none;
    stroke: var(--bs-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283; /* 2 * π * 45 (radius) */
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.6s ease-in-out;
}

.circular-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.875rem;
    color: var(--bs-body-color);
    text-align: center;
}

/* Small circular progress for compact displays */
.circular-progress.small {
    width: 60px;
    height: 60px;
}

.circular-progress.small .circular-progress-bg,
.circular-progress.small .circular-progress-bar {
    stroke-width: 6;
}

.circular-progress.small .circular-progress-bar {
    stroke-dasharray: 188; /* 2 * π * 30 (radius) */
    stroke-dashoffset: 188;
}

.circular-progress.small .circular-progress-text {
    font-size: 0.75rem;
}

/* Circular progress link style for "more stats" */
.circular-progress-link {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.circular-progress-link:hover {
    transform: scale(1.1);
}

.circular-progress-link .circular-progress-bar-link {
    stroke: var(--bs-primary);
    stroke-dasharray: 283;
    stroke-dashoffset: 0; /* Full circle for link indicator */
}

.circular-progress-link .circular-progress-text {
    color: var(--bs-primary);
}

.circular-progress-link .circular-progress-text i {
    font-size: 1.25rem;
}

/* ============================================
   Activity Progress Bar
   ============================================ */

.activity-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 24px;
    background-color: var(--bs-secondary-bg);
    border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 0.5rem;
    gap: 0.25rem;
}

.activity-progress-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 100%;
    background-color: var(--bs-primary);
    transition: width 0.3s ease, background-color 0.3s ease;
    z-index: 1;
    min-width: 0;
}

.activity-progress-fill[style*="width: 0%"],
.activity-progress-fill[style*="width:0%"] {
    background-color: var(--bs-secondary);
}

.activity-progress-icon {
    position: relative;
    z-index: 2;
    font-size: 0.75rem;
    color: var(--bs-body-color);
    flex-shrink: 0;
}

[data-bs-theme="dark"] .activity-progress-icon {
    color: var(--bs-secondary-color);
}

.activity-progress-text {
    position: relative;
    z-index: 2;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--bs-body-color);
    text-align: center;
    line-height: 1;
    padding: 0 0.25rem;
    flex: 1;
}

/* Ensure card content doesn't overlap with progress bar */
.card-tile.position-relative {
    padding-bottom: 2rem !important;
}

/* ============================================
   Course Marketplace and Overview Styles
   ============================================ */

/* Page Title and Description */
.page-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    margin: 0;
}

.page-description {
    font-size: 1rem;
    color: #86868b;
    margin: 0;
}

/* Dark theme support - using both data-theme and data-bs-theme for compatibility */
[data-theme="dark"] .page-title,
[data-bs-theme="dark"] .page-title {
    color: #f3f4f6;
}

[data-theme="dark"] .page-description,
[data-bs-theme="dark"] .page-description {
    color: #9ca3af;
}

/* Filter Toggles - Minimalistic Style */
.filter-group {
    display: inline-flex;
    gap: 0.5rem;
    background: #f5f5f7;
    padding: 0.25rem;
    border-radius: 10px;
    border: 1px solid rgba(210, 210, 215, 0.3);
    flex-wrap: nowrap;
    min-width: max-content;
}

/* Mobile: Enable horizontal scrolling and adjust sizing */
@media (max-width: 575.98px) {
    .filter-group {
        gap: 0.375rem;
        padding: 0.25rem;
    }

    .filter-label {
        font-size: 0.8125rem;
        padding: 0.5rem 1rem;
    }
}

.filter-input {
    display: none;
}

.filter-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #86868b;
    background: transparent;
    border: none;
    white-space: nowrap;
    user-select: none;
}

.filter-label:hover {
    color: #1d1d1f;
    background: rgba(255, 255, 255, 0.5);
}

.filter-input:checked + .filter-label {
    color: #1d1d1f;
    background: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .filter-group,
[data-bs-theme="dark"] .filter-group {
    background: rgba(26, 35, 50, 0.6);
    border-color: rgba(31, 41, 55, 0.6);
}

[data-theme="dark"] .filter-label,
[data-bs-theme="dark"] .filter-label {
    color: #9ca3af;
}

[data-theme="dark"] .filter-label:hover,
[data-bs-theme="dark"] .filter-label:hover {
    color: #f3f4f6;
    background: rgba(17, 24, 39, 0.6);
}

[data-theme="dark"] .filter-input:checked + .filter-label,
[data-bs-theme="dark"] .filter-input:checked + .filter-label {
    color: #f3f4f6;
    background: rgba(17, 24, 39, 0.8);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}

/* Subscription Access Pill - Elegant upgrade/courses link (shared with chat upgrade style) */
.subscription-access-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 50rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.subscription-access-pill:hover {
    text-decoration: none;
}

.subscription-access-pill.subscription-s {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.12) 0%, rgba(48, 209, 88, 0.12) 100%);
    border: 1px solid rgba(52, 199, 89, 0.35);
    color: #228b22;
}

.subscription-access-pill.subscription-s:hover {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.18) 0%, rgba(48, 209, 88, 0.18) 100%);
    border-color: rgba(52, 199, 89, 0.5);
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.2);
}

.subscription-access-pill.subscription-m {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.12) 0%, rgba(0, 122, 255, 0.12) 100%);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.35);
    color: var(--bs-primary);
}

.subscription-access-pill.subscription-m:hover {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.18) 0%, rgba(0, 122, 255, 0.18) 100%);
    border-color: rgba(var(--bs-primary-rgb), 0.5);
    box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.2);
}

.subscription-access-pill.training-store {
    background: linear-gradient(135deg, rgba(142, 142, 147, 0.1) 0%, rgba(174, 174, 178, 0.1) 100%);
    border: 1px solid rgba(142, 142, 147, 0.3);
    color: var(--bs-body-color);
}

.subscription-access-pill.training-store:hover {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.1) 0%, rgba(var(--bs-secondary-rgb), 0.08) 100%);
    border-color: rgba(var(--bs-primary-rgb), 0.35);
    color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.15);
}

[data-theme="dark"] .subscription-access-pill.subscription-s,
[data-bs-theme="dark"] .subscription-access-pill.subscription-s {
    color: #4ade80;
}

[data-theme="dark"] .subscription-access-pill.subscription-m,
[data-bs-theme="dark"] .subscription-access-pill.subscription-m {
    color: #60a5fa;
}

[data-theme="dark"] .subscription-access-pill.training-store,
[data-bs-theme="dark"] .subscription-access-pill.training-store {
    color: var(--bs-body-color);
}

/* Subscription Banner - Base Styles */
.subscription-banner {
    border-radius: 12px;
    padding: 1rem 1.5rem;
}

/* Mobile responsive padding */
@media (max-width: 575.98px) {
    .subscription-banner {
        padding: 0.875rem 1rem;
        border-radius: 10px;
    }
}

/* Subscription Banner - Subscription S (Basic) - Green/Teal Theme */
.subscription-banner.subscription-s,
.course-tile.subscription-s {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.08) 0%, rgba(48, 209, 88, 0.08) 100%);
    border: 1px solid rgba(52, 199, 89, 0.25);
}

.subscription-banner.subscription-s .subscription-banner-icon {
    color: #34c759;
}

.subscription-banner.subscription-s .subscription-banner-btn {
    background: #34c759;
    color: #ffffff;
}

.subscription-banner.subscription-s .subscription-banner-btn:hover {
    background: #28a745;
    box-shadow: 0 4px 12px 0 rgba(52, 199, 89, 0.3);
}

.subscription-banner.subscription-s .subscription-banner-btn:active {
    box-shadow: 0 2px 6px 0 rgba(52, 199, 89, 0.2);
}

/* Subscription Banner - Subscription M (Full) - Blue/Purple Theme */
.subscription-banner.subscription-m,
.course-tile.subscription-m {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08) 0%, rgba(88, 86, 214, 0.08) 100%);
    border: 1px solid rgba(0, 122, 255, 0.25);
}

.subscription-banner.subscription-m .subscription-banner-icon {
    color: #007aff;
}

.subscription-banner.subscription-m .subscription-banner-btn {
    background: #007aff;
    color: #ffffff;
}

.subscription-banner.subscription-m .subscription-banner-btn:hover {
    background: #0051d5;
    box-shadow: 0 4px 12px 0 rgba(0, 122, 255, 0.3);
}

.subscription-banner.subscription-m .subscription-banner-btn:active {
    box-shadow: 0 2px 6px 0 rgba(0, 122, 255, 0.2);
}

/* Subscription Banner - One-time Payment - Neutral/Gray Theme */
.subscription-banner.one-time {
    background: linear-gradient(135deg, rgba(142, 142, 147, 0.08) 0%, rgba(174, 174, 178, 0.08) 100%);
    border: 1px solid rgba(142, 142, 147, 0.25);
}

.subscription-banner.one-time .subscription-banner-icon {
    color: #8e8e93;
}

/* Subscription Banner - Free - Success Theme */
.subscription-banner.free {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.12) 0%, rgba(48, 209, 88, 0.12) 100%);
    border: 1px solid rgba(52, 199, 89, 0.35);
}

.subscription-banner.free .subscription-banner-icon {
    color: #34c759;
}

[data-theme="dark"] .subscription-banner.free,
[data-bs-theme="dark"] .subscription-banner.free {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.18) 0%, rgba(48, 209, 88, 0.18) 100%);
    border-color: rgba(52, 199, 89, 0.45);
}

[data-theme="dark"] .subscription-banner.free .subscription-banner-icon,
[data-bs-theme="dark"] .subscription-banner.free .subscription-banner-icon {
    color: #5cd27c;
}

/* Dark Mode - One-time Payment */
[data-theme="dark"] .subscription-banner.one-time,
[data-bs-theme="dark"] .subscription-banner.one-time {
    background: linear-gradient(135deg, rgba(142, 142, 147, 0.15) 0%, rgba(174, 174, 178, 0.15) 100%);
    border-color: rgba(142, 142, 147, 0.35);
}

[data-theme="dark"] .subscription-banner.one-time .subscription-banner-icon,
[data-bs-theme="dark"] .subscription-banner.one-time .subscription-banner-icon {
    color: #a8a8ad;
}

.subscription-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

/* Mobile: Stack content vertically on very small screens */
@media (max-width: 575.98px) {
    .subscription-banner-content {
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .subscription-banner-content form {
        width: 100%;
    }

    .subscription-banner-content .subscription-banner-btn {
        width: 100%;
        justify-content: center;
    }
}

.subscription-banner-icon {
    font-size: 1.5rem;
    color: #007aff;
    flex-shrink: 0;
}

.subscription-banner-text {
    color: var(--bs-gray-600);
    flex: 1;
}

.subscription-banner-btn {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    border: none;
    background: #007aff;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.subscription-banner-btn:hover {
    background: #0051d5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px 0 rgba(0, 122, 255, 0.3);
}

.subscription-banner-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px 0 rgba(0, 122, 255, 0.2);
}


.subscription-banner-text strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.25rem;
}

.subscription-banner-text small {
    font-size: 0.875rem;
    color: #86868b;
}

/* Dark Mode - Subscription S */
[data-theme="dark"] .subscription-banner.subscription-s,
[data-bs-theme="dark"] .subscription-banner.subscription-s,
[data-theme="dark"] .course-tile.subscription-s,
[data-bs-theme="dark"] .course-tile.subscription-s {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.15) 0%, rgba(48, 209, 88, 0.15) 100%);
    border-color: rgba(52, 199, 89, 0.35);
}

[data-theme="dark"] .subscription-banner.subscription-s .subscription-banner-icon,
[data-bs-theme="dark"] .subscription-banner.subscription-s .subscription-banner-icon {
    color: #4ade80;
}

[data-theme="dark"] .subscription-banner.subscription-s .subscription-banner-btn,
[data-bs-theme="dark"] .subscription-banner.subscription-s .subscription-banner-btn {
    background: #4ade80;
    color: #1d1d1f;
}

[data-theme="dark"] .subscription-banner.subscription-s .subscription-banner-btn:hover,
[data-bs-theme="dark"] .subscription-banner.subscription-s .subscription-banner-btn:hover {
    background: #5ee884;
    box-shadow: 0 4px 12px 0 rgba(74, 222, 128, 0.3);
}

/* Dark Mode - Subscription M */
[data-theme="dark"] .subscription-banner.subscription-m,
[data-bs-theme="dark"] .subscription-banner.subscription-m,
[data-theme="dark"] .course-tile.subscription-m,
[data-bs-theme="dark"] .course-tile.subscription-m {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15) 0%, rgba(88, 86, 214, 0.15) 100%);
    border-color: rgba(0, 122, 255, 0.35);
}

[data-theme="dark"] .subscription-banner.subscription-m .subscription-banner-icon,
[data-bs-theme="dark"] .subscription-banner.subscription-m .subscription-banner-icon {
    color: #5ac8fa;
}

[data-theme="dark"] .subscription-banner.subscription-m .subscription-banner-btn,
[data-bs-theme="dark"] .subscription-banner.subscription-m .subscription-banner-btn {
    background: #5ac8fa;
    color: #1d1d1f;
}

[data-theme="dark"] .subscription-banner.subscription-m .subscription-banner-btn:hover,
[data-bs-theme="dark"] .subscription-banner.subscription-m .subscription-banner-btn:hover {
    background: #7dd3fc;
    box-shadow: 0 4px 12px 0 rgba(90, 200, 250, 0.3);
}

[data-theme="dark"] .subscription-banner-text strong,
[data-bs-theme="dark"] .subscription-banner-text strong {
    color: #f3f4f6;
}

[data-theme="dark"] .subscription-banner-text small,
[data-bs-theme="dark"] .subscription-banner-text small {
    color: #9ca3af;
}

/* Bottom Checkout Navbar */
.checkout-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffffff;
    border-top: 1px solid rgba(210, 210, 215, 0.5);
    box-shadow: 0 -2px 10px 0 rgba(0, 0, 0, 0.05);
    padding: 0;
}

.checkout-navbar-content {
    max-width: 100%;
    margin: 0 auto;
}

.checkout-navbar-cart-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.checkout-navbar-cart-toggle:hover {
    background: rgba(0, 0, 0, 0.02);
}

.checkout-navbar-cart-toggle i {
    font-size: 1.25rem;
}

.checkout-navbar-cart-toggle .badge {
    background: #34c759;
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
}

.checkout-navbar-items {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid rgba(210, 210, 215, 0.5);
    background: #ffffff;
}

.checkout-navbar-items-header {
    padding: 1rem 2rem 0.75rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(210, 210, 215, 0.3);
    margin-bottom: 0.5rem;
}

.checkout-navbar-items-list {
    padding: 0.5rem 0;
    max-height: 250px;
    overflow-y: auto;
}

.checkout-navbar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    border-bottom: 1px solid rgba(210, 210, 215, 0.2);
    transition: background-color 0.2s;
}

.checkout-navbar-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.checkout-navbar-item-info {
    flex: 1;
    min-width: 0;
}

.checkout-navbar-item-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.checkout-navbar-item-price {
    font-size: 0.875rem;
    color: #86868b;
}

.checkout-navbar-item-remove {
    background: none;
    border: none;
    color: #86868b;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-navbar-item-remove:hover {
    color: #d32f2f;
}

.checkout-navbar-item-remove i {
    font-size: 1.25rem;
}

.checkout-navbar-items-footer {
    padding: 1rem 2rem;
    border-top: 1px solid rgba(210, 210, 215, 0.3);
    background: rgba(0, 0, 0, 0.02);
}

.checkout-navbar-total {
    margin-bottom: 0.75rem;
    text-align: center;
    font-size: 1.125rem;
    color: #1d1d1f;
}

.checkout-navbar-button {
    background: #34c759;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.875rem 2rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px -2px rgba(52, 199, 89, 0.3), 0 2px 4px -1px rgba(52, 199, 89, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
}

.checkout-navbar-button:hover {
    background: #30d158;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px -2px rgba(52, 199, 89, 0.4), 0 4px 6px -1px rgba(52, 199, 89, 0.3);
    color: white;
}

.checkout-navbar-button:active {
    transform: translateY(0);
}

.checkout-navbar-empty {
    padding: 2rem;
    text-align: center;
    color: #86868b;
    font-size: 0.9375rem;
}

[data-theme="dark"] .checkout-navbar,
[data-bs-theme="dark"] .checkout-navbar {
    background: rgba(17, 24, 39, 0.95);
    border-top-color: rgba(31, 41, 55, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .checkout-navbar-cart-toggle:hover,
[data-bs-theme="dark"] .checkout-navbar-cart-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .checkout-navbar-item:hover,
[data-bs-theme="dark"] .checkout-navbar-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .checkout-navbar-item-name,
[data-bs-theme="dark"] .checkout-navbar-item-name {
    color: #f3f4f6;
}

[data-theme="dark"] .checkout-navbar-item-price,
[data-bs-theme="dark"] .checkout-navbar-item-price,
[data-theme="dark"] .checkout-navbar-item-remove,
[data-bs-theme="dark"] .checkout-navbar-item-remove {
    color: #9ca3af;
}

[data-theme="dark"] .checkout-navbar-items-footer,
[data-bs-theme="dark"] .checkout-navbar-items-footer {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .checkout-navbar-total,
[data-bs-theme="dark"] .checkout-navbar-total {
    color: #f3f4f6;
}

@media (max-width: 768px) {
    .checkout-navbar-cart-toggle {
        padding: 0.875rem 1rem;
    }

    .checkout-navbar-items-header,
    .checkout-navbar-item,
    .checkout-navbar-items-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .checkout-navbar-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9375rem;
    }
}

/* Course Tiles (Marketplace) */
.course-tile {
    background: #ffffff;
    border: 1px solid rgba(210, 210, 215, 0.5);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

.course-tile:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
    border-color: rgba(0, 153, 255, 0.3);
}

/* Course Tile - Subscription S (Basic) - Green/Teal Theme */
.course-tile.subscription-s {
    border-color: rgba(52, 199, 89, 0.3);
}

.course-tile.subscription-s:hover {
    border-color: rgba(52, 199, 89, 0.5);
    box-shadow: 0 10px 15px -3px rgba(52, 199, 89, 0.1), 0 4px 6px -2px rgba(52, 199, 89, 0.05);
}

/* Course Tile - Subscription M (Full) - Blue/Purple Theme */
.course-tile.subscription-m {
    border-color: rgba(0, 122, 255, 0.3);
}

.course-tile.subscription-m:hover {
    border-color: rgba(0, 122, 255, 0.5);
    box-shadow: 0 10px 15px -3px rgba(0, 122, 255, 0.1), 0 4px 6px -2px rgba(0, 122, 255, 0.05);
}

/* Course Tile - One-time Payment - Neutral/Gray Theme */
.course-tile.one-time {
    border-color: rgba(142, 142, 147, 0.3);
}

.course-tile.one-time:hover {
    border-color: rgba(142, 142, 147, 0.5);
    box-shadow: 0 10px 15px -3px rgba(142, 142, 147, 0.1), 0 4px 6px -2px rgba(142, 142, 147, 0.05);
}

.course-tile-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868b;
    font-size: 48px;
}

.course-tile-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-tile-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.course-tile-description {
    font-size: 0.9rem;
    color: #424245;
    margin-bottom: 0.75rem;
}

.course-tile-more-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #007acc;
    text-decoration: none;
    margin-left: 0.25rem;
}

.course-tile-more-link:hover {
    text-decoration: underline;
    color: #0051d5;
}

.course-tile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.course-tile-tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    background: #f5f5f7;
    color: #424245;
    border: 1px solid rgba(210, 210, 215, 0.3);
}

.course-tile-tag.course-type {
    background: rgba(0, 153, 255, 0.1);
    color: #007acc;
    border-color: rgba(0, 153, 255, 0.2);
}

.course-tile-tag.level {
    background: rgba(255, 107, 53, 0.1);
    color: #e55a2b;
    border-color: rgba(255, 107, 53, 0.2);
}

.course-tile-tag.status {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
    border-color: rgba(52, 199, 89, 0.2);
}

.course-tile-tag.status.in-cart {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.2);
}

.course-tile-modules {
    font-size: 0.875rem;
    color: #86868b;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.course-tile-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 1rem;
}

.subscription-info {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #007acc;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.subscription-info.text-success {
    color: #34c759;
}

.course-tile-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(210, 210, 215, 0.3);
}

.course-tile-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.course-tile-btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid;
}

.course-tile-btn-primary {
    background: #0099ff;
    border-color: #0099ff;
    color: white;
}

.course-tile-btn-primary:hover {
    background: #007acc;
    border-color: #007acc;
    color: white;
}

.course-tile-btn-secondary {
    background: white;
    border-color: rgba(210, 210, 215, 0.5);
    color: #1d1d1f;
}

.course-tile-btn-secondary:hover {
    background: #f5f5f7;
    border-color: rgba(210, 210, 215, 0.7);
}

.course-tile-btn-danger {
    background: white;
    border-color: rgba(255, 59, 48, 0.3);
    color: #ff3b30;
}

.course-tile-btn-danger:hover {
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.5);
}

/* Dark theme support for course tiles */
[data-theme="dark"] .course-tile,
[data-bs-theme="dark"] .course-tile {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(31, 41, 55, 0.6);
}

[data-theme="dark"] .course-tile:hover,
[data-bs-theme="dark"] .course-tile:hover {
    border-color: rgba(0, 153, 255, 0.4);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .course-tile.subscription-s:hover,
[data-bs-theme="dark"] .course-tile.subscription-s:hover {
    border-color: rgba(52, 199, 89, 0.5);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(52, 199, 89, 0.2);
}

[data-theme="dark"] .course-tile.subscription-m:hover,
[data-bs-theme="dark"] .course-tile.subscription-m:hover {
    border-color: rgba(0, 122, 255, 0.5);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 122, 255, 0.2);
}

[data-theme="dark"] .course-tile.one-time:hover,
[data-bs-theme="dark"] .course-tile.one-time:hover {
    border-color: rgba(142, 142, 147, 0.5);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(142, 142, 147, 0.2);
}

[data-theme="dark"] .course-tile-image,
[data-bs-theme="dark"] .course-tile-image {
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.6) 0%, rgba(17, 24, 39, 0.6) 100%);
    color: #9ca3af;
}

[data-theme="dark"] .course-tile-title,
[data-bs-theme="dark"] .course-tile-title {
    color: #f3f4f6;
}

[data-theme="dark"] .course-tile-description,
[data-bs-theme="dark"] .course-tile-description {
    color: #9ca3af;
}

[data-theme="dark"] .course-tile-more-link,
[data-bs-theme="dark"] .course-tile-more-link {
    color: #33adff;
}

[data-theme="dark"] .course-tile-more-link:hover,
[data-bs-theme="dark"] .course-tile-more-link:hover {
    color: #60a5fa;
}

[data-theme="dark"] .course-tile-tag,
[data-bs-theme="dark"] .course-tile-tag {
    background: rgba(26, 35, 50, 0.6);
    color: #9ca3af;
    border-color: rgba(31, 41, 55, 0.6);
}

[data-theme="dark"] .course-tile-tag.course-type,
[data-bs-theme="dark"] .course-tile-tag.course-type {
    background: rgba(0, 153, 255, 0.15);
    color: #33adff;
    border-color: rgba(0, 153, 255, 0.3);
}

[data-theme="dark"] .course-tile-tag.level,
[data-bs-theme="dark"] .course-tile-tag.level {
    background: rgba(255, 107, 53, 0.15);
    color: #ff8c5a;
    border-color: rgba(255, 107, 53, 0.3);
}

[data-theme="dark"] .course-tile-tag.status,
[data-bs-theme="dark"] .course-tile-tag.status {
    background: rgba(52, 199, 89, 0.15);
    color: #4ade80;
    border-color: rgba(52, 199, 89, 0.3);
}

[data-theme="dark"] .course-tile-tag.status.in-cart,
[data-bs-theme="dark"] .course-tile-tag.status.in-cart {
    background: rgba(255, 193, 7, 0.15);
    color: #ffd43b;
    border-color: rgba(255, 193, 7, 0.3);
}

[data-theme="dark"] .course-tile-modules,
[data-bs-theme="dark"] .course-tile-modules {
    color: #9ca3af;
}

[data-theme="dark"] .course-tile-price,
[data-bs-theme="dark"] .course-tile-price {
    color: #f3f4f6;
}

[data-theme="dark"] .subscription-info,
[data-bs-theme="dark"] .subscription-info {
    color: #33adff;
}

[data-theme="dark"] .subscription-info.text-success,
[data-bs-theme="dark"] .subscription-info.text-success {
    color: #4ade80;
}

[data-theme="dark"] .course-tile-footer,
[data-bs-theme="dark"] .course-tile-footer {
    border-top-color: rgba(31, 41, 55, 0.6);
}

[data-theme="dark"] .course-tile-btn-secondary,
[data-bs-theme="dark"] .course-tile-btn-secondary {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(31, 41, 55, 0.6);
    color: #f3f4f6;
}

[data-theme="dark"] .course-tile-btn-secondary:hover,
[data-bs-theme="dark"] .course-tile-btn-secondary:hover {
    background: rgba(26, 35, 50, 0.8);
    border-color: rgba(31, 41, 55, 0.8);
}

[data-theme="dark"] .course-tile-btn-danger,
[data-bs-theme="dark"] .course-tile-btn-danger {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(255, 59, 48, 0.4);
    color: #ff6b6b;
}

[data-theme="dark"] .course-tile-btn-danger:hover,
[data-bs-theme="dark"] .course-tile-btn-danger:hover {
    background: rgba(255, 59, 48, 0.15);
    border-color: rgba(255, 59, 48, 0.6);
}

/* Enrolled course styling - light mode */
.course-tile.enrolled {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.08) 0%, rgba(52, 199, 89, 0.04) 100%);
    border-color: rgba(52, 199, 89, 0.3);
    box-shadow: 0 1px 3px 0 rgba(52, 199, 89, 0.1), 0 1px 2px 0 rgba(52, 199, 89, 0.05);
}

.course-tile.enrolled:hover {
    border-color: rgba(52, 199, 89, 0.5);
    box-shadow: 0 10px 15px -3px rgba(52, 199, 89, 0.15), 0 4px 6px -2px rgba(52, 199, 89, 0.1);
}

/* Enrolled course styling - dark mode */
[data-theme="dark"] .course-tile.enrolled,
[data-bs-theme="dark"] .course-tile.enrolled {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.12) 0%, rgba(52, 199, 89, 0.06) 100%);
    border-color: rgba(52, 199, 89, 0.4);
    box-shadow: 0 1px 3px 0 rgba(52, 199, 89, 0.2), 0 1px 2px 0 rgba(52, 199, 89, 0.1);
}

[data-theme="dark"] .course-tile.enrolled:hover,
[data-bs-theme="dark"] .course-tile.enrolled:hover {
    border-color: rgba(52, 199, 89, 0.6);
    box-shadow: 0 10px 15px -3px rgba(52, 199, 89, 0.25), 0 4px 6px -2px rgba(52, 199, 89, 0.15);
}

/* Course Header (Course Overview) */
.course-header-modern {
    background: #ffffff;
    border: 1px solid rgba(210, 210, 215, 0.5);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

.course-header-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868b;
    font-size: 72px;
}

.course-header-content {
    padding: 2rem;
}

.course-header-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 0.75rem 0;
    letter-spacing: -0.02em;
}

.course-header-description {
    font-size: 1.125rem;
    color: #424245;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.course-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(210, 210, 215, 0.3);
}

.course-header-tag {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    background: #f5f5f7;
    color: #424245;
    border: 1px solid rgba(210, 210, 215, 0.3);
}

.course-header-tag.course-type {
    background: rgba(0, 153, 255, 0.1);
    color: #007acc;
    border-color: rgba(0, 153, 255, 0.2);
}

.course-header-tag.level {
    background: rgba(255, 107, 53, 0.1);
    color: #e55a2b;
    border-color: rgba(255, 107, 53, 0.2);
}

.course-header-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-left: auto;
}

.course-header-subscription {
    font-size: 1rem;
    font-weight: 500;
    color: #007acc;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.course-header-subscription.text-success {
    color: #34c759;
}

.course-header-subscription small {
    font-size: 0.875rem;
    font-weight: 400;
}

.course-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.course-header-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    border: 1px solid;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.course-header-btn-primary {
    background: #0099ff;
    border-color: #0099ff;
    color: white;
}

.course-header-btn-primary:hover {
    background: #007acc;
    border-color: #007acc;
    color: white;
}

.course-header-btn-secondary {
    background: white;
    border-color: rgba(210, 210, 215, 0.5);
    color: #1d1d1f;
}

.course-header-btn-secondary:hover {
    background: #f5f5f7;
    border-color: rgba(210, 210, 215, 0.7);
}

.course-header-btn-danger {
    background: white;
    border-color: rgba(255, 59, 48, 0.3);
    color: #ff3b30;
}

.course-header-btn-danger:hover {
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.5);
}

/* Dark theme support for course header */
[data-theme="dark"] .course-header-modern,
[data-bs-theme="dark"] .course-header-modern {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(31, 41, 55, 0.6);
}

[data-theme="dark"] .course-header-title,
[data-bs-theme="dark"] .course-header-title {
    color: #f3f4f6;
}

[data-theme="dark"] .course-header-description,
[data-bs-theme="dark"] .course-header-description {
    color: #9ca3af;
}

[data-theme="dark"] .course-header-image,
[data-bs-theme="dark"] .course-header-image {
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.6) 0%, rgba(17, 24, 39, 0.6) 100%);
    color: #9ca3af;
}

[data-theme="dark"] .course-header-tag,
[data-bs-theme="dark"] .course-header-tag {
    background: rgba(26, 35, 50, 0.6);
    color: #9ca3af;
    border-color: rgba(31, 41, 55, 0.6);
}

[data-theme="dark"] .course-header-tag.course-type,
[data-bs-theme="dark"] .course-header-tag.course-type {
    background: rgba(0, 153, 255, 0.15);
    color: #33adff;
    border-color: rgba(0, 153, 255, 0.3);
}

[data-theme="dark"] .course-header-tag.level,
[data-bs-theme="dark"] .course-header-tag.level {
    background: rgba(255, 107, 53, 0.15);
    color: #ff8c5a;
    border-color: rgba(255, 107, 53, 0.3);
}

[data-theme="dark"] .course-header-price,
[data-bs-theme="dark"] .course-header-price {
    color: #f3f4f6;
}

[data-theme="dark"] .course-header-subscription,
[data-bs-theme="dark"] .course-header-subscription {
    color: #33adff;
}

[data-theme="dark"] .course-header-subscription.text-success,
[data-bs-theme="dark"] .course-header-subscription.text-success {
    color: #4ade80;
}

[data-theme="dark"] .course-header-meta,
[data-bs-theme="dark"] .course-header-meta {
    border-bottom-color: rgba(31, 41, 55, 0.6);
}

[data-theme="dark"] .course-header-btn-secondary,
[data-bs-theme="dark"] .course-header-btn-secondary {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(31, 41, 55, 0.6);
    color: #f3f4f6;
}

[data-theme="dark"] .course-header-btn-secondary:hover,
[data-bs-theme="dark"] .course-header-btn-secondary:hover {
    background: rgba(26, 35, 50, 0.8);
    border-color: rgba(31, 41, 55, 0.8);
}

[data-theme="dark"] .course-header-btn-danger,
[data-bs-theme="dark"] .course-header-btn-danger {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(255, 59, 48, 0.4);
    color: #ff6b6b;
}

[data-theme="dark"] .course-header-btn-danger:hover,
[data-bs-theme="dark"] .course-header-btn-danger:hover {
    background: rgba(255, 59, 48, 0.15);
    border-color: rgba(255, 59, 48, 0.6);
}

/* Enrolled course header styling - light mode */
.course-header-modern.enrolled {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.08) 0%, rgba(52, 199, 89, 0.04) 100%);
    border-color: rgba(52, 199, 89, 0.3);
    box-shadow: 0 1px 3px 0 rgba(52, 199, 89, 0.1), 0 1px 2px 0 rgba(52, 199, 89, 0.05);
}

/* Enrolled course header styling - dark mode */
[data-theme="dark"] .course-header-modern.enrolled,
[data-bs-theme="dark"] .course-header-modern.enrolled {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.12) 0%, rgba(52, 199, 89, 0.06) 100%);
    border-color: rgba(52, 199, 89, 0.4);
    box-shadow: 0 1px 3px 0 rgba(52, 199, 89, 0.2), 0 1px 2px 0 rgba(52, 199, 89, 0.1);
}

/* Module Group Cards */
.module-group-card {
    background: #ffffff;
    border: 1px solid rgba(210, 210, 215, 0.5);
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.02);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.module-group-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
}

.module-group-card .card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Module Group Header */
.module-group-icon {
    font-size: 3rem;
    display: inline-block;
}

.module-group-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 0.5rem 0;
}

.module-group-description {
    font-size: 0.875rem;
    color: #86868b;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.module-group-badge {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
}

/* Module List */
.module-group-list {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(210, 210, 215, 0.3);
}

.module-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.module-item {
    display: flex;
    align-items: flex-start;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.module-item:not(:last-child) {
    border-bottom: 1px solid rgba(210, 210, 215, 0.2);
}

.module-item-icon {
    color: #34c759;
    font-size: 0.875rem;
    margin-right: 0.75rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.module-item-text {
    color: #424245;
    flex: 1;
}

/* Dark theme support for module group cards */
[data-theme="dark"] .module-group-card,
[data-bs-theme="dark"] .module-group-card {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(31, 41, 55, 0.6);
}

[data-theme="dark"] .module-group-card .card-body,
[data-bs-theme="dark"] .module-group-card .card-body {
    color: #f3f4f6;
}

[data-theme="dark"] .module-group-title,
[data-bs-theme="dark"] .module-group-title {
    color: #f3f4f6;
}

[data-theme="dark"] .module-group-description,
[data-bs-theme="dark"] .module-group-description {
    color: #9ca3af;
}

[data-theme="dark"] .module-group-list,
[data-bs-theme="dark"] .module-group-list {
    border-top-color: rgba(31, 41, 55, 0.6);
}

[data-theme="dark"] .module-item,
[data-bs-theme="dark"] .module-item {
    border-bottom-color: rgba(31, 41, 55, 0.4);
}

[data-theme="dark"] .module-item-icon,
[data-bs-theme="dark"] .module-item-icon {
    color: #4ade80;
}

[data-theme="dark"] .module-item-text,
[data-bs-theme="dark"] .module-item-text {
    color: #9ca3af;
}

/* Alert Info Styling for Dark Mode */
[data-theme="dark"] .alert-info,
[data-bs-theme="dark"] .alert-info {
    background-color: rgba(0, 153, 255, 0.1);
    border-color: rgba(0, 153, 255, 0.3);
    color: #33adff;
}

/* Padding for body content when navbar is visible */
.body-content-with-navbar {
    padding-bottom: 6rem;
}