/* 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 */
}

/* 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;
}

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

/* 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;
    z-index: 1060;
    pointer-events: none;
}

.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: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 2.2rem;
    font-weight: 600;
    font-style: italic;
    color: #2a4365;
    letter-spacing: 0.5px;
    line-height: 1;
    transform: skewX(-8deg);
    margin-bottom: 2px;
}

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

.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 {
    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;
}

.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: 0 0 5px rgba(25, 135, 84, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(25, 135, 84, 0.5);
    }
}

/* 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;
}

/* Curriculum Card Background Image Styles */
/* Paragraph that hosts background + overlay */
.curriculum-card-with-image {
    position: relative !important;
    overflow: hidden;
    display: block !important;
    min-height: 60px;
    padding: 0.75rem !important;
    border-radius: 0.375rem;
    margin: 0 !important;
    background-color: transparent;
    z-index: 0;
    isolation: isolate;
}

/* Background image via URL */
/* Background image span (URL) inside the summary paragraph */
.curriculum-card-with-image > .curriculum-card-image {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    z-index: 0 !important;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    border-radius: 0.375rem;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* Inline SVG or image element */
/* Inline SVG/img background span inside the summary paragraph */
.curriculum-card-with-image > .curriculum-card-image-inline {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0.15;
    z-index: 0 !important;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: block !important;
    pointer-events: none;
    border-radius: 0.375rem;
    margin: 0 !important;
    padding: 0 !important;
}

.curriculum-card-with-image > .curriculum-card-image-inline svg,
.curriculum-card-with-image > .curriculum-card-image-inline img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
}

.curriculum-card-with-image:hover > .curriculum-card-image,
.curriculum-card-with-image:hover > .curriculum-card-image-inline {
    opacity: 0.25;
    transform: scale(1.05);
}

/* Text overlay span inside the summary paragraph */
.curriculum-card-with-image > .curriculum-card-overlay {
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    width: 100% !important;
}
