/* CB Portal Thinkific Bridge - Course Catalog Styles */

/* ===========================
   CATALOG PAGE LAYOUT
   =========================== */

.cbp-catalog-container {
    min-height: 100vh;
    background: #f8f9fa;
}

.cbp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Catalog Header */
.cbp-catalog-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0 3rem;
    margin-bottom: 3rem;
}

.cbp-catalog-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.cbp-catalog-description {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
}

/* ===========================
   FILTERS AND SEARCH
   =========================== */

.cbp-catalog-filters {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.cbp-filter-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: end;
}

.cbp-filter-group {
    display: flex;
    flex-direction: column;
}

.cbp-filter-group label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.cbp-search-input,
.cbp-filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.cbp-search-input:focus,
.cbp-filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cbp-search-input {
    width: 100%;
}

.cbp-filter-select {
    min-width: 150px;
}

/* View Controls */
.cbp-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cbp-view-toggle {
    display: flex;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.cbp-view-btn {
    padding: 0.75rem 1rem;
    border: none;
    background: white;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cbp-view-btn:hover {
    background: #f7fafc;
    color: #2d3748;
}

.cbp-view-btn.active {
    background: #667eea;
    color: white;
}

.cbp-results-info {
    color: #718096;
    font-weight: 500;
}

.cbp-results-count {
    font-weight: 700;
    color: #2d3748;
}

/* ===========================
   COURSE GRID LAYOUT
   =========================== */

.cbp-catalog-courses {
    margin-bottom: 3rem;
}

.cbp-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.cbp-courses-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Course Cards */
.cbp-course-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cbp-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.cbp-courses-list .cbp-course-card {
    flex-direction: row;
    height: auto;
}

.cbp-course-image {
    position: relative;
    overflow: hidden;
    background: #f7fafc;
}

.cbp-courses-grid .cbp-course-image {
    height: 200px;
}

.cbp-courses-list .cbp-course-image {
    width: 280px;
    height: 180px;
    flex-shrink: 0;
}

.cbp-course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cbp-course-card:hover .cbp-course-image img {
    transform: scale(1.05);
}

.cbp-course-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cbp-courses-list .cbp-course-content {
    padding: 2rem;
}

.cbp-course-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.cbp-courses-list .cbp-course-title {
    font-size: 1.5rem;
}

.cbp-course-description {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.cbp-course-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.cbp-course-instructor {
    color: #718096;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cbp-course-instructor::before {
    content: "👨‍🏫";
    font-size: 1rem;
}

.cbp-course-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cbp-price-free {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.cbp-price-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
}

.cbp-course-actions {
    margin-top: auto;
}

/* ===========================
   BUTTONS
   =========================== */

.cbp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.2;
}

.cbp-button-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.cbp-button-primary:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.cbp-button-outline {
    background: transparent;
    color: #667eea;
    border-color: #667eea;
}

.cbp-button-outline:hover {
    background: #667eea;
    color: white;
    text-decoration: none;
}

.cbp-button-block {
    width: 100%;
}

.cbp-button-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.cbp-load-more-btn {
    display: block;
    margin: 2rem auto 0;
    padding: 1rem 2rem;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cbp-load-more-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* ===========================
   NO RESULTS STATE
   =========================== */

.cbp-no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.cbp-no-results-icon {
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.cbp-no-results h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 0.5rem 0;
}

.cbp-no-results p {
    color: #718096;
    margin: 0 0 2rem 0;
}

/* ===========================
   LOADING STATES
   =========================== */

.cbp-loading-placeholder {
    text-align: center;
    padding: 4rem 2rem;
    color: #718096;
}

.cbp-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: cbp-spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes cbp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================
   SINGLE COURSE PAGE
   =========================== */

.cbp-course-container {
    min-height: 100vh;
    background: #f8f9fa;
}

/* Course Hero */
.cbp-course-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0 3rem;
    margin-bottom: 3rem;
}

.cbp-course-breadcrumb {
    margin-bottom: 2rem;
}

.cbp-breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
}

.cbp-breadcrumb-list li:not(:last-child)::after {
    content: "→";
    margin-left: 0.5rem;
    opacity: 0.7;
}

.cbp-breadcrumb-list a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.cbp-breadcrumb-list a:hover {
    color: white;
}

.cbp-course-hero-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.cbp-course-categories {
    margin-bottom: 1rem;
}

.cbp-course-category {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.cbp-course-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.cbp-course-excerpt {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.cbp-course-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 1rem;
}

.cbp-detail-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.cbp-price {
    font-size: 1.25rem;
    font-weight: 700;
}

.cbp-price-free {
    color: #48bb78;
}

.cbp-price-paid {
    color: #ffd700;
}

.cbp-course-featured-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.cbp-course-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Course Main Content */
.cbp-course-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: start;
}

.cbp-course-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.cbp-course-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 1.5rem 0;
}

.cbp-course-description {
    color: #4a5568;
    line-height: 1.7;
    font-size: 1.05rem;
}

/* Curriculum Styles */
.cbp-curriculum-chapter {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.cbp-chapter-title {
    background: #f7fafc;
    padding: 1.25rem 1.5rem;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 1px solid #e2e8f0;
}

.cbp-chapter-description {
    padding: 1rem 1.5rem;
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
}

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

.cbp-lesson-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.3s ease;
}

.cbp-lesson-item:last-child {
    border-bottom: none;
}

.cbp-lesson-item:hover {
    background: #f7fafc;
}

.cbp-lesson-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cbp-lesson-icon {
    color: #667eea;
    flex-shrink: 0;
}

.cbp-lesson-name {
    color: #2d3748;
    font-weight: 500;
}

/* Learning Outcomes */
.cbp-outcomes-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.cbp-outcome-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
    color: #2d3748;
    font-weight: 500;
}

.cbp-outcome-icon {
    color: #48bb78;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* ===========================
   SIDEBAR STYLES
   =========================== */

.cbp-course-sidebar {
    position: sticky;
    top: 2rem;
}

.cbp-enrollment-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #f7fafc;
}

.cbp-card-pricing {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f7fafc;
}

.cbp-price-display {
    margin-bottom: 1rem;
}

.cbp-price-main {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    display: block;
}

.cbp-price-main.cbp-price-free {
    background: linear-gradient(135deg, #48bb78, #38a169);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cbp-enrollment-status {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f7fafc;
}

.cbp-status-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.cbp-status-enrolled {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.cbp-progress-section {
    margin-top: 1rem;
}

.cbp-progress-label {
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.cbp-progress-bar {
    background: #e2e8f0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.cbp-progress-fill {
    background: linear-gradient(90deg, #48bb78, #38a169);
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

.cbp-card-actions {
    margin-bottom: 2rem;
}

.cbp-card-actions .cbp-button {
    margin-bottom: 0.75rem;
}

.cbp-card-actions .cbp-button:last-child {
    margin-bottom: 0;
}

.cbp-card-info {
    border-top: 2px solid #f7fafc;
    padding-top: 2rem;
}

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

.cbp-info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: #4a5568;
    font-weight: 500;
}

.cbp-info-item:not(:last-child) {
    border-bottom: 1px solid #f7fafc;
}

.cbp-info-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 1024px) {
    .cbp-course-hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .cbp-course-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .cbp-course-sidebar {
        order: -1;
        position: static;
    }
    
    .cbp-filter-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .cbp-view-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .cbp-catalog-title,
    .cbp-course-title {
        font-size: 2rem;
    }
    
    .cbp-courses-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cbp-courses-list .cbp-course-card {
        flex-direction: column;
    }
    
    .cbp-courses-list .cbp-course-image {
        width: 100%;
        height: 200px;
    }
    
    .cbp-catalog-filters {
        padding: 1.5rem;
    }
    
    .cbp-container {
        padding: 0 15px;
    }
    
    .cbp-course-section {
        padding: 1.5rem;
    }
    
    .cbp-enrollment-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .cbp-catalog-header {
        padding: 2rem 0;
    }
    
    .cbp-catalog-title,
    .cbp-course-title {
        font-size: 1.75rem;
    }
    
    .cbp-catalog-filters {
        padding: 1rem;
    }
    
    .cbp-course-section {
        padding: 1rem;
    }
    
    .cbp-enrollment-card {
        padding: 1rem;
    }
    
    .cbp-filter-group label {
        font-size: 0.85rem;
    }
    
    .cbp-search-input,
    .cbp-filter-select {
        padding: 0.625rem 0.75rem;
        font-size: 0.9rem;
    }
}