/* Course Builder - Single Course Page */
/* Design inspired by Masteriyo LMS, but using our own classes */

/* Override Astra theme containers - but allow entry-content for Gutenberg blocks */
/* .ast-container,
.site-content {
    padding: 0 !important;
    margin: 0 !important;
} */

/* Container */
.cb-container {
    /* max-width: 1200px !important; */
    width: 100% !important;
    margin: 0 auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* Main Grid Layout - FIXED WIDTHS */
.cb-course-wrapper {
    display: grid !important;
    grid-template-columns: calc(100% - 380px) 350px !important;
    gap: 30px !important;
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100% !important;
    max-width: 100% !important;
}

@media (max-width: 1024px) {
    .cb-course-wrapper {
        grid-template-columns: 1fr !important;
    }
    
    .cb-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .cb-course-image {
        height: 250px;
    }
}

/* Main Content - FIXED WIDTH */
.cb-main-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Featured Image */
.cb-course-image {
    position: relative !important;
    width: 100% !important;
    height: 400px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    margin-bottom: 24px !important;
}

.cb-course-image img {
    position: absolute !important;
    /* Obrázek v původní velikosti, min-width/height zajistí pokrytí kontejneru */
    width: auto !important;
    height: auto !important;
    min-width: 100% !important;
    min-height: 100% !important;
    /* Umístíme focal point do středu kontejneru pomocí translate */
    left: 50% !important;
    top: 50% !important;
    transform: translate(
        calc(-1 * var(--focus-x, 50%)),
        calc(-1 * var(--focus-y, 50%))
    ) !important;
}

.cb-level-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* Course Title & Author */
.cb-course-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
    color: #1a202c;
}

/* Tabs Navigation */
.cb-tabs {
    margin-top: 24px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.cb-tab-nav {
    display: flex;
    gap: 32px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.cb-tab-link {
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #718096;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
    cursor: pointer;
    outline: none;
}

.cb-tab-link:hover {
    color: #7c3aed;
}

.cb-tab-link:focus {
    outline: none;
}

.cb-tab-link.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

/* Tab Content */
.cb-tab-content {
    display: none;
    width: 100% !important;
    min-height: 400px;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.cb-tab-content.active {
    display: block;
}

/* Course Description */
.cb-description {
    font-size: 16px;
    line-height: 1.8;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Let Gutenberg styles handle the block formatting */
.cb-description.entry-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Description headings */
.cb-description h1,
.cb-description h2,
.cb-description h3,
.cb-description h4,
.cb-description h5,
.cb-description h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #1a202c;
}

.cb-description h1 { font-size: 2em; }
.cb-description h2 { font-size: 1.5em; }
.cb-description h3 { font-size: 1.25em; }
.cb-description h4 { font-size: 1.1em; }

/* Description lists - override Gutenberg/Astra resets */
.cb-description ul,
.cb-description ol,
.cb-description .wp-block-list {
    padding-left: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 1em !important;
    list-style-position: inside !important;
}

.cb-description ul,
.cb-description ul.wp-block-list {
    list-style: disc inside !important;
}

.cb-description ol,
.cb-description ol.wp-block-list {
    list-style: decimal inside !important;
}

.cb-description li,
.cb-description .wp-block-list li {
    margin-bottom: 0.5em !important;
    display: list-item !important;
}

/* Description paragraphs */
.cb-description p {
    margin-bottom: 1em;
}

/* Tight spacing when paragraph is followed by a list (same visual block) */
.cb-description p:has(+ ul),
.cb-description p:has(+ ol),
.cb-description p:has(+ .wp-block-list) {
    margin-bottom: 0.25em !important;
}

/* Curriculum Timeline */
.cb-curriculum-timeline {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0;
    box-sizing: border-box !important;
    position: relative;
}

/* Main Timeline Line */
.cb-curriculum-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 8px;
    bottom: 48px;
    width: 2px;
    background: #e5e7eb;
    z-index: 0;
}

/* Timeline Topic Header */
.cb-timeline-topic {
    display: flex;
    gap: 32px;
    margin-bottom: 16px;
    margin-top: 0;
    position: relative;
    padding-left: 0;
    align-items: flex-start;
}

.cb-timeline-topic:not(:first-child) {
    margin-top: 64px;
}

.cb-timeline-marker {
    flex-shrink: 0;
    width: 40px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 0;
    position: relative;
    z-index: 1;
}

.cb-marker-topic {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 3px solid #7c3aed;
    margin-left: 13px;
    margin-top: 2px;
}

.cb-timeline-content {
    flex: 1;
    min-width: 0;
    padding-top: 0;
}

.cb-topic-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.cb-topic-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: #718096;
    flex-wrap: wrap;
}

.cb-dot {
    color: #cbd5e0;
}

/* Timeline Item */
.cb-timeline-item {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    position: relative;
}

.cb-timeline-item .cb-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    background: white;
    border: 2px solid #e5e7eb;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.cb-item-icon.cb-icon-lesson,
.cb-item-icon.cb-icon-activity,
.cb-item-icon.cb-icon-quiz {
    color: #4a5568;
    background: white;
    border-color: #cbd5e0;
}

.cb-item-icon.cb-icon-material {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #d97706;
}

.cb-item-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    flex: 1;
}

.cb-item-link:hover {
    border-color: #7c3aed;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
}

.cb-item-link[href="#"] {
    cursor: not-allowed;
    opacity: 0.6;
}

.cb-item-link[href="#"]:hover {
    border-color: #e5e7eb;
    box-shadow: none;
}

.cb-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cb-item-title {
    font-size: 16px;
    font-weight: 500;
    color: #1a202c;
    margin: 0;
}

.cb-item-status {
    flex-shrink: 0;
}

.cb-icon-check {
    color: #10b981;
}

.cb-icon-check-circle {
    color: #10b981;
}

.cb-icon-circle-empty {
    color: #9ca3af;
}

.cb-icon-lock {
    color: #9ca3af;
}

.cb-icon-unlock {
    color: #2271b1;
}

/* Material Highlight */
.cb-timeline-material {
    margin-bottom: 12px;
}

.cb-timeline-material .cb-item-link {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e9 100%);
    border-color: #f59e0b;
    border-width: 2px;
}

.cb-timeline-material .cb-item-link:hover {
    border-color: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.cb-material-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 0;
    background: transparent;
    color: #f59e0b;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar - FIXED WIDTH */
.cb-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
    width: 100% !important;
    max-width: 350px !important;
    min-width: 350px !important;
    flex: none !important;
}

@media (max-width: 1024px) {
    .cb-sidebar {
        position: static;
        max-width: 100% !important;
        min-width: auto !important;
    }
}

.cb-sidebar-content {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
}

.cb-sidebar-content form {
    margin: 0;
}

.cb-register-btn,
.cb-register-btn:focus {
    width: 100%;
    background: #7c3aed;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 24px;
    display: block;
    text-align: center;
    text-decoration: none;
}

.cb-register-btn:hover {
    background: #6d28d9;
    color: white;
}

.cb-register-btn.cb-enrolled {
    background: #10b981;
}

.cb-register-btn.cb-enrolled:hover {
    background: #059669;
    color: white;
}

/* Course Info */
.cb-course-info {
    margin-bottom: 0;
}

.cb-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #4a5568;
}

.cb-info-item:last-child {
    margin-bottom: 0;
}

.cb-info-item svg {
    color: #718096;
    flex-shrink: 0;
}

/* Info Separator */
.cb-info-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 24px 0;
}

/* Curriculum Statistics in Sidebar */
.cb-curriculum-stats-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.cb-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
}

.cb-stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #7c3aed;
    line-height: 1;
    margin-bottom: 4px;
}

.cb-stat-label {
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

.cb-stat-materials {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e9 100%);
    border: 1px solid #f59e0b;
}

.cb-stat-materials .cb-stat-number {
    color: #d97706;
}

.cb-stat-materials .cb-stat-label {
    color: #92400e;
    font-size: 14px;
}

/* Lead Trainers & Supporting Trainers */
.cb-trainers,
.cb-lead-trainers,
.cb-supporting-trainers {
    margin-bottom: 24px;
}

.cb-trainers:last-child,
.cb-lead-trainers:last-child,
.cb-supporting-trainers:last-child {
    margin-bottom: 0;
}

.cb-trainers h3,
.cb-lead-trainers h3,
.cb-supporting-trainers h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a202c;
}

.cb-trainers ul,
.cb-lead-trainers ul,
.cb-supporting-trainers ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cb-trainers ul li,
.cb-lead-trainers ul li,
.cb-supporting-trainers ul li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #4a5568;
}

.cb-trainers ul li svg,
.cb-lead-trainers ul li svg,
.cb-supporting-trainers ul li svg {
    flex-shrink: 0;
    color: #718096;
}

.cb-trainers ul li:last-child,
.cb-lead-trainers ul li:last-child,
.cb-supporting-trainers ul li:last-child {
    margin-bottom: 0;
}

.cb-no-trainers {
    font-style: italic;
    color: #9ca3af !important;
}

/* Changelog Timeline */
.cb-changelog-timeline {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0;
    box-sizing: border-box !important;
    position: relative;
}

/* Main Timeline Line for Changelog */
.cb-changelog-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 8px;
    bottom: 48px;
    width: 2px;
    background: #e5e7eb;
    z-index: 0;
}

/* Hide timeline line if there's only one entry */
.cb-changelog-timeline:has(.cb-changelog-entry:only-child)::before {
    display: none;
}

/* Changelog Entry */
.cb-changelog-entry {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    position: relative;
    padding-left: 0;
    align-items: flex-start;
}

.cb-changelog-entry:last-child {
    margin-bottom: 0;
}

/* Changelog Marker */
.cb-changelog-marker {
    flex-shrink: 0;
    width: 42px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 0;
}

.cb-changelog-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: white;
    border: 2px solid #805ad5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 0;
    position: relative;
    z-index: 1;
}

.cb-changelog-icon svg {
    color: #805ad5;
}

/* Changelog Content */
.cb-changelog-content {
    flex: 1;
    min-width: 0;
}

.cb-changelog-date {
    font-weight: 600;
    font-size: 16px;
    color: #1a202c;
    margin-top: 7px;
    margin-bottom: 12px;
}

.cb-changelog-text {
    font-size: 15px;
    line-height: 1.7;
    color: #4a5568;
}

.cb-changelog-text p {
    margin: 0 0 12px 0;
}

.cb-changelog-text p:last-child {
    margin-bottom: 0;
}

.cb-changelog-text ul,
.cb-changelog-text ol {
    margin: 0 0 12px 0;
    padding-left: 1.5em;
}

.cb-changelog-text li {
    margin-bottom: 6px;
}

.cb-changelog-text li:last-child {
    margin-bottom: 0;
}

.cb-changelog-text strong {
    font-weight: 600;
    color: #2d3748;
}

.cb-changelog-text a {
    color: #805ad5;
    text-decoration: underline;
}

.cb-changelog-text a:hover {
    color: #6b46c1;
}

/* Empty State */
.cb-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.cb-empty-state p {
    font-size: 16px;
    margin: 0;
}

/* =========================================================================
   COURSES LIST (page-courses.php)
   ========================================================================= */

/* Course Cards Layout */
.cb-courses-container {
    /* max-width: 1200px; */
    margin: 0 auto;
    padding: 40px 20px;
}

.cb-section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1a202c;
}

.cb-courses-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 48px;
}

.cb-course-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cb-course-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .cb-course-card {
        flex-direction: row;
        min-height: 240px;
    }
}

.cb-course-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
}

@media (min-width: 768px) {
    .cb-course-card-image {
        width: 320px;
        height: auto;
        min-height: 100%;
    }
}

.cb-course-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-course-card-content {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.cb-course-card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1a202c;
}

.cb-course-card-title a {
    color: inherit;
    text-decoration: none !important;
    transition: color 0.2s;
}

.cb-course-card-title a:hover {
    color: #2563eb;
    text-decoration: none !important;
}

.cb-course-instructors {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #6b7280;
}

.cb-instructor-badge {
    background: #e5e7eb;
    color: #374151;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
}

.cb-course-excerpt {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cb-course-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #9ca3af;
    margin-top: auto;
}

.cb-course-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cb-course-stat svg {
    width: 16px;
    height: 16px;
}

.cb-course-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    justify-content: center;
    border-top: 1px solid #e5e7eb;
    min-width: 180px;
}

@media (min-width: 768px) {
    .cb-course-card-actions {
        border-top: none;
        border-left: 1px solid #e5e7eb;
    }
}

.cb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.15s ease;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    color: #fff;
}

.cb-btn-primary:hover {
    color: #fff;
    text-decoration: none !important;
}

.cb-btn-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.cb-btn-primary {
    background: #2563eb;
    color: white;
}

.cb-btn-primary:hover {
    background: #1d4ed8;
}

.cb-btn-success {
    background: #16a34a;
    color: white;
}

.cb-btn-success:hover {
    background: #15803d;
    color: white !important;
}

.cb-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.cb-btn-secondary:hover {
    background: #d1d5db;
}

.cb-btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.cb-progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}

.cb-progress-bar {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.cb-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
    color: #6b7280;
}

.cb-progress-percentage {
    font-weight: 600;
    color: #1a202c;
}

.cb-no-courses {
    background: #fff;
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cb-no-courses-icon {
    width: 64px;
    height: 64px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.cb-no-courses-icon svg {
    width: 32px;
    height: 32px;
    color: #9ca3af;
}

.cb-no-courses-text {
    color: #6b7280;
    font-size: 16px;
}
