/* Course Detail Page Styles */

/* Hero */
.course-detail-hero {
    margin-top: 70px;
    padding: 80px 0 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #c43f00 100%);
    color: var(--white);
}

.course-detail-hero .container {
    max-width: 1100px;
}

.breadcrumbs-bar {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.breadcrumbs-bar a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs-bar a:hover {
    color: var(--white);
    text-decoration: underline;
}

.breadcrumbs-bar span[aria-current="page"] {
    color: var(--white);
    font-weight: 500;
}

.course-detail-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    font-weight: 800;
    margin: 0 0 1rem;
    color: var(--white);
}

.course-detail-hero .lead {
    font-size: 1.2rem;
    line-height: 1.55;
    margin: 0 0 1.75rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 720px;
}

.course-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.course-meta-badges span {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--white);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.course-meta-badges i {
    font-size: 0.85rem;
}

/* Content layout: 2-col on desktop, stack on mobile */
.course-detail-body {
    padding: 60px 0 80px;
    background: var(--white);
}

.course-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 3rem;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .course-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Main content (markdown rendered) */
.course-content {
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 1.05rem;
}

.course-content h2 {
    font-size: 1.8rem;
    margin: 2.5rem 0 1rem;
    color: var(--text-dark);
    font-weight: 700;
}

.course-content h2:first-child {
    margin-top: 0;
}

.course-content h3 {
    font-size: 1.35rem;
    margin: 1.75rem 0 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
}

.course-content h4 {
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.course-content p {
    margin: 0 0 1rem;
}

.course-content ul {
    margin: 0 0 1.25rem;
    padding-left: 1.5rem;
}

.course-content li {
    margin-bottom: 0.4rem;
}

.course-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

.course-content hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 2rem 0;
}

.course-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Sidebar with cohorts */
.course-sidebar {
    position: sticky;
    top: 90px;
    background: var(--background-light);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: var(--shadow);
}

.course-sidebar h2 {
    font-size: 1.25rem;
    margin: 0 0 1rem;
    color: var(--text-dark);
    font-weight: 700;
}

.cohort-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cohort-item {
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    transition: border-color 0.2s ease;
}

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

.cohort-item.sold-out {
    opacity: 0.6;
}

.cohort-modality {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.cohort-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.cohort-detail {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cohort-detail i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.cohort-spots {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0.5rem 0 1rem;
    font-weight: 500;
}

.cohort-spots.limited {
    color: #d97706;
    font-weight: 600;
}

.cohort-spots.sold-out {
    color: #dc2626;
    font-weight: 600;
}

.cohort-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
}

.cohort-cta:hover {
    background: #c43f00;
}

.cohort-empty {
    text-align: center;
    padding: 1.5rem 0.75rem;
    color: var(--text-light);
}

.cohort-empty i {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.cohort-empty p {
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

.sidebar-extra-cta {
    border-top: 1px solid #e2e8f0;
    padding-top: 1.25rem;
    margin-top: 0.5rem;
    text-align: center;
}

.sidebar-extra-cta p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0 0 0.75rem;
}

.sidebar-extra-cta a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.sidebar-extra-cta a:hover {
    text-decoration: underline;
}

/* FAQ accordion */
.course-faq {
    background: var(--background-light);
    padding: 60px 0;
}

.course-faq-inner {
    max-width: 820px;
    margin: 0 auto;
}

.course-faq h2 {
    text-align: center;
    font-size: 2rem;
    margin: 0 0 2rem;
    color: var(--text-dark);
}

.faq-item {
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-item summary {
    padding: 1.1rem 1.4rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--primary-color);
    transition: transform 0.2s ease;
    font-size: 0.85rem;
}

.faq-item[open] summary::after {
    transform: rotate(180deg);
}

.faq-item .faq-answer {
    padding: 0 1.4rem 1.2rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Related courses */
.related-courses {
    padding: 60px 0;
    background: var(--white);
}

.related-courses h2 {
    text-align: center;
    font-size: 2rem;
    margin: 0 0 2.5rem;
    color: var(--text-dark);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.related-card {
    background: var(--white);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.related-card .related-icon {
    color: var(--primary-color);
    font-size: 1.75rem;
}

.related-card h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-dark);
}

.related-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

.related-card .related-link {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Final CTA banner */
.course-final-cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, #c43f00 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.course-final-cta h2 {
    font-size: 2rem;
    margin: 0 0 1rem;
    color: var(--white);
}

.course-final-cta p {
    font-size: 1.1rem;
    margin: 0 0 1.75rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.course-final-cta .btn {
    background: var(--white);
    color: var(--primary-color);
    padding: 0.9rem 1.75rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease;
}

.course-final-cta .btn:hover {
    transform: translateY(-2px);
}

/* Loading and error states for cohorts */
.cohort-loading {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.cohort-loading i {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
    color: var(--primary-color);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .course-detail-hero {
        padding: 60px 0 40px;
    }

    .course-detail-hero h1 {
        font-size: 1.8rem;
    }

    .course-detail-hero .lead {
        font-size: 1rem;
    }

    .course-content {
        font-size: 1rem;
    }

    .course-content h2 {
        font-size: 1.45rem;
    }

    .course-sidebar {
        position: static;
    }
}
