/* Shared styles for all course landing pages */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    margin: 0;
    padding: 0;
}

.wrap {
    max-width: 1000px;
    margin: 32px auto;
    padding: 16px;
}

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    overflow: hidden;
}

.hero {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding: 40px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

/* Prevent global .hero { height:100vh } from affecting course pages */
.wrap .card > .hero,
.card .hero {
    height: auto !important;
    min-height: 0 !important;
}

.hero-copy {
    flex: 1;
    min-width: 300px;
}

.hero-calendar {
    flex: 0 0 280px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.title {
    margin: 0 0 8px !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.subtitle {
    margin: 0 0 12px !important;
    color: #64748b !important;
    font-size: 1.1rem !important;
}

.price {
    font-weight: 800;
    color: #2563eb;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

/* Small stock badge under price */
.stock-badge {
    display: inline-block;
    margin-top: 4px;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

/* Disabled/greyed primary button */
.btn.btn-disabled,
.btn[aria-disabled="true"],
.btn.disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.soldout-note {
    margin-top: 8px;
    color: #64748b;
    font-size: 0.95rem;
}

.cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(37,99,235,0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(37,99,235,0.35);
}

.btn-outline {
    background: white;
    color: #2563eb;
    border: 2px solid #2563eb;
    box-shadow: 0 2px 8px rgba(37,99,235,0.1);
}

.btn-outline:hover {
    background: #eff6ff;
    border-color: #1d4ed8;
    color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37,99,235,0.2);
}

/* Subtle outline button - smaller and lighter */
.btn-outline-subtle {
    background: white;
    color: #64748b;
    border: 1px solid #cbd5e1;
    box-shadow: none;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 400;
}

.btn-outline-subtle:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Wide primary button */
.btn-wide {
    width: 100%;
    text-align: center;
}

/* Other options section - between snippets and content */
.other-options-section {
    padding: 24px 32px 20px;
    background: white;
    border-bottom: 1px solid #f1f5f9;
}

.other-options-section .course-options-subtitle {
    margin: 0 0 12px;
}

.other-options-section .small-links {
    margin: 0;
}

@media (max-width: 768px) {
    .other-options-section {
        padding: 16px 24px;
        text-align: center;
    }

    .other-options-section .small-links {
        justify-content: center;
    }
}

.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
    cursor: not-allowed;
    opacity: .7;
}

.content {
    padding: 32px; /* Restored original padding */
    border-top: 1px solid #f1f5f9;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.aside {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 20px;
}

.content h2 {
    color: #0f172a;
    font-size: 1.5rem;
    margin-bottom: 16px; /* Restored original margins */
}

.content p {
    line-height: 1.6;
    color: #475569;
    margin-bottom: 16px;
    font-size: 1rem;
}

.aside h3 {
    color: #0f172a;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.aside ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.8;
    color: #64748b;
}

.small-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px; /* Reduced margin since it follows subtitle directly */
    margin-bottom: 24px; /* Add space before main content */
}

.pill {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 999px;
    font-size: .9rem;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pill:hover {
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-1px);
}

/* Course option subtitle styling */
.course-options-subtitle {
    margin: 8px 0 8px; /* small top margin under CTA */
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left !important; /* ensure left alignment even when hero text is centered on mobile */
    display: block;
}

/* Calendar styling for group courses */
.calendar-section {
    color: #0f172a;
    font-size: 1.2rem;
    margin-bottom: 16px;
    text-align: center;
}

.calendar {
    display: flex;
    gap: 12px;
    overflow: auto;
    padding-bottom: 8px;
    justify-content: center;
}

.month {
    min-width: 240px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    flex-shrink: 0;
}

.month-header {
    background: #2563eb;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px 10px 0 0;
    font-weight: 700;
    text-align: center;
    font-size: .9rem;
}

.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.d {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f8fafc;
    font-size: .85rem;
}

.d.header {
    font-weight: 600;
    background: #f8fafc;
    font-size: .75rem;
    color: #64748b;
}

.hit {
    background: #2563eb;
    font-weight: 700;
    color: white;
}

/* Responsive design */
@media(min-width: 900px) {
    .grid {
        grid-template-columns: 2fr 1fr;
    }
}

@media(max-width: 768px) {
    .hero {
        padding: 24px;
        flex-direction: column;
        text-align: center;
    }
    
    .hero-calendar {
        flex: none;
        align-self: center;
    }
    
    .cta {
        justify-content: center;
    }
    
    .small-links {
        justify-content: center;
    }
    
    .calendar {
        justify-content: center;
    }
}

/* ========================================
   Review Snippets Carousel
   ======================================== */
.snippets-carousel {
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 24px 0;
    overflow: hidden;
    border-bottom: 1px solid #e2e8f0;
}

.snippets-carousel::before,
.snippets-carousel::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 2;
    pointer-events: none;
}

.snippets-carousel::before {
    left: 0;
    background: linear-gradient(to right, #f8fafc 0%, transparent 100%);
}

.snippets-carousel::after {
    right: 0;
    background: linear-gradient(to left, #f8fafc 0%, transparent 100%);
}

.snippets-track {
    display: flex;
    gap: 16px;
    animation: scroll-snippets 40s linear infinite;
    width: max-content;
}

.snippets-track:hover {
    animation-play-state: paused;
}

.snippet-chip {
    flex-shrink: 0;
    padding: 12px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 0.9rem;
    color: #475569;
    font-style: italic;
    white-space: nowrap;
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.snippet-chip:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37,99,235,0.12);
    transform: translateY(-2px);
}

.snippets-read-all {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    position: relative;
    z-index: 3;
}

.snippets-read-all:hover {
    text-decoration: underline;
}

/* Empty state */
.snippets-carousel.snippets-empty {
    text-align: center;
    padding: 20px;
}

.snippets-carousel.snippets-empty p {
    color: #94a3b8;
    font-style: italic;
    margin: 0 0 8px;
}

@keyframes scroll-snippets {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .snippets-carousel {
        padding: 16px 0;
    }

    .snippet-chip {
        padding: 10px 16px;
        font-size: 0.85rem;
        max-width: 380px;
    }

    .snippets-carousel::before,
    .snippets-carousel::after {
        width: 30px;
    }
}

/* ========================================
   Responsive Snippet Display Wrappers
   (For group course page: mobile flip, desktop scroll)
   ======================================== */
.snippets-mobile-only {
    display: block;
}

.snippets-desktop-only {
    display: none;
}

@media (min-width: 769px) {
    .snippets-mobile-only {
        display: none;
    }
    .snippets-desktop-only {
        display: block;
    }
}

/* ========================================
   Course Navigation
   ======================================== */
.course-nav {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 16px 0;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-back:hover {
    color: #2563eb;
    border-color: #2563eb;
    background: #f8fafc;
}

@media (max-width: 768px) {
    .course-nav {
        padding: 12px 12px 0;
    }

    .nav-back {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}
