/* Platform Program Detail Page Styles */

/* General Styles */
.tpd-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Program Header */
.tpd-header {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    min-height: 230px;
}

/* Header layout with large route icon on the right */
.tpd-header-with-icon{
    display: flex;
    align-items: stretch;
    gap: 1.25rem;
}
.tpd-header-left{
    flex: 1 1 80%;
    min-width: 0;
}
.tpd-header-right{
    flex: 0 0 20%;
    min-width: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-route-icon{
    width: 100%;
    max-width: 180px;
    aspect-ratio: 1/1;
    border: 8px solid var(--level-color, #007bff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 3rem;
    color: var(--level-color, #007bff);
    background: #fff;
}

@media (max-width: 992px){
    .tpd-header-with-icon{ flex-direction: column; }
    .tpd-header-right{ flex: 0 0 auto; min-width: 0; }
    .header-route-icon{ max-width: 120px; font-size: 1.5rem; border-width: 5px; }
}

.tpd-title {
    font-size: 2.25rem;
    font-weight: 300;
    color: #1a202c;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Level Row - H2 and blob on same line */
.tpd-level-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Level Blob - Positioned after H2 */
.level-blob {
    width: 25px;
    height: 25px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    background: var(--level-color);
    flex-shrink: 0;
}

/* Utility classes for inline styles */
.tpd-margin-top {
    margin-top: 16px;
}

.tpd-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tpd-program-info {
    margin-bottom: 1rem;
    padding-right: 230px;
}

.tpd-program-placeholder {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 210px;
    height: 210px;
    background: #f3f3f3;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ddd;
}

.tpd-program-image {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 210px;
    height: 210px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #ddd;
}

.tpd-program-details {
    width: 100%;
}

.tpd-program-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.tpd-cefr-level-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.tpd-cefr-text {
    font-size: 0.95rem;
    color: #4a5568;
    font-weight: 500;
}

.tpd-program-actions {
    display: none;
    gap: 1rem;
    margin-top: 1rem;
}

.tpd-description {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #4a5568;
    font-size: 0.95rem;
    padding-right: 230px;
    clear: none;
}

/* Section Headers */
.tpd-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

/* Content Cards */
.tpd-content-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;

}

.tpd-content-overview {
    margin-bottom: 2rem;
}

.tpd-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Progress Cards */
.progress-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.progress-icon {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
}

.progress-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #2d3748;
}

.progress-info p {
    color: #6b7280;
    margin: 0;
    font-size: 0.9rem;
}

.progress-details {
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-label {
    font-weight: 600;
    color: #2d3748;
    min-width: 80px;
    font-size: 0.9rem;
}

.chart-canvas-container-lg {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Route Tabs */
.route-tabs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1.5rem 0;
}

.route-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 0.5rem;
    min-width: 80px;
}

.route-tab:hover {
    transform: translateY(-2px);

}

.route-icon {
    width: 60px;
    height: 60px;
    border: 3px solid;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    background: white;
    transition: all 0.3s ease;
}

/* Override for header icon: declare AFTER generic .route-icon so it wins */
.route-icon.header-route-icon {
    width: 100%;
    max-width: 180px;
    height: auto;
    aspect-ratio: 1 / 1;
    border-width: 8px;
    border-color: var(--level-color, #007bff);
    color: var(--level-color, #007bff);
    font-size: 3rem;
    font-weight: 800;
    margin: 0; /* center nicely in header */
}

.route-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

/* Ensure CEFR colors are properly applied */
.route-tab[data-level="pre-a1"] .route-icon {
    border-color: var(--cefr-pre-a1) !important;
    color: var(--cefr-pre-a1) !important;
}

.route-tab[data-level="a1"] .route-icon {
    border-color: var(--cefr-a1) !important;
    color: var(--cefr-a1) !important;
}

.route-tab[data-level="a2"] .route-icon {
    border-color: var(--cefr-a2) !important;
    color: var(--cefr-a2) !important;
}

.route-tab[data-level="b1"] .route-icon {
    border-color: var(--cefr-b1) !important;
    color: var(--cefr-b1) !important;
}

.route-tab[data-level="b2"] .route-icon {
    border-color: var(--cefr-b2) !important;
    color: var(--cefr-b2) !important;
}

.route-tab[data-level="c1"] .route-icon {
    border-color: var(--cefr-c1) !important;
    color: var(--cefr-c1) !important;
}

.route-tab[data-level="c2"] .route-icon {
    border-color: var(--cefr-c2) !important;
    color: var(--cefr-c2) !important;
}

/* Ensure CEFR colors are properly applied */
.route-tab[data-level="pre-a1"] .route-icon {
    border-color: var(--cefr-pre-a1) !important;
    color: var(--cefr-pre-a1) !important;
}

.route-tab[data-level="a1"] .route-icon {
    border-color: var(--cefr-a1) !important;
    color: var(--cefr-a1) !important;
}

.route-tab[data-level="a2"] .route-icon {
    border-color: var(--cefr-a2) !important;
    color: var(--cefr-a2) !important;
}

.route-tab[data-level="b1"] .route-icon {
    border-color: var(--cefr-b1) !important;
    color: var(--cefr-b1) !important;
}

.route-tab[data-level="b2"] .route-icon {
    border-color: var(--cefr-b2) !important;
    color: var(--cefr-b2) !important;
}

.route-tab[data-level="c1"] .route-icon {
    border-color: var(--cefr-c1) !important;
    color: var(--cefr-c1) !important;
}

.route-tab[data-level="c2"] .route-icon {
    border-color: var(--cefr-c2) !important;
    color: var(--cefr-c2) !important;
}

/* Courses Accordion */
.tpd-courses-section {
    margin-bottom: 2rem;
}

.tpd-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tpd-course-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;

}

.tpd-course-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tpd-course-header:hover {
    background: #f1f5f9;
}

.tpd-course-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 2rem;
}

.tpd-course-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tpd-course-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

.tpd-course-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tpd-lesson-count-chevron {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #6b7280;
}

.tpd-lesson-count {
    font-size: 0.875rem;
}

.tpd-chevron {
    transition: transform 0.2s ease;
}

.tpd-course-header[aria-expanded="true"] .tpd-chevron {
    transform: rotate(180deg);
}

.tpd-course-body {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: white;
}

/* Buttons */
.tpd-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.tpd-btn-primary {
    background: var(--level-color, #007bff);
    color: white;
}

.tpd-btn-primary:hover {
    background: var(--level-color-dark, #0056b3);
    color: white;
    transform: translateY(-1px);
}

.tpd-btn-edit {
    background: #6c757d;
    color: white;
}

.tpd-btn-add {
    background: #28a745;
    color: white;
}

.tpd-btn-view {
    background: #17a2b8;
    color: white;
}

.tpd-btn-highlight {
    margin-top: 1rem;
    background: #ff69b4;
    color: #fff;
    border-radius: 999px;
    padding: 0.65rem 1.4rem;
    display: inline-flex;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 18px rgba(255, 105, 180, 0.25);
}

.tpd-btn-highlight:hover {
    color: #fff;
    background: #ff4da7;
    box-shadow: 0 14px 24px rgba(255, 105, 180, 0.35);
}

.tpd-btn:hover {
    transform: translateY(-1px);

}

/* Responsive Design */
@media (max-width: 768px) {
    .tpd-container {
        padding: 1rem;
    }
    
    .tpd-header {
        min-height: auto;
    }
    
    .tpd-program-info {
        text-align: center;
        padding-right: 0;
        padding-top: 220px;
    }
    
    .tpd-program-placeholder,
    .tpd-program-image {
        position: relative;
        top: auto;
        right: auto;
        width: 200px;
        height: 200px;
        margin: 0 auto 1rem auto;
    }
    
    .tpd-content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tpd-course-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .tpd-course-actions {
        justify-content: center;
        width: 100%;
    }
    
    .route-tabs {
        gap: 0.5rem;
        justify-content: center;
    }
    
    .route-tab {
        min-width: 70px;
    }
    
    .route-icon {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .route-name {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .tpd-container {
        padding: 0.5rem;
    }
    
    .tpd-title {
        font-size: 1.75rem;
    }
    
    .tpd-program-title {
        font-size: 1.5rem;
    }
    
    .tpd-content-grid {
        gap: 0.75rem;
    }
    
    .route-tabs {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .route-tab {
        min-width: 60px;
    }
    
    .route-icon {
        width: 45px;
        height: 45px;
        font-size: 0.9rem;
    }
    
    .tpd-program-info {
        padding-top: 170px;
    }
    
    .tpd-program-placeholder,
    .tpd-program-image {
        width: 150px;
        height: 150px;
    }
}

/* Book Collections Layout for BB, GT, TC Programs */
.book-collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.book-collection-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.book-collection-card:hover {
    border-color: #3b82f6;

    transform: translateY(-2px);
}

.book-collection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
}

.book-emoji {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.book-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.book-description {
    color: #6b7280;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.book-action {
    text-align: center;
    color: #3b82f6;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.book-collection-card:hover .book-action {
    opacity: 1;
}

/* Special styling for different programs */
.book-collection-card[onclick*="big-book"]::before {
    background: linear-gradient(90deg, #FFD700, #FFA500);
}

.book-collection-card[onclick*="greatest-tales"]::before {
    background: linear-gradient(90deg, #34495E, #2C3E50);
}

.book-collection-card[onclick*="time-chronicles"]::before {
    background: linear-gradient(90deg, #8B5CF6, #A855F7);
}

/* Book Type Badge */
.tpd-book-type {
    margin-top: 0.5rem;
}

.book-type-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Book Collection Cards in Accordion */
.tpd-course-card[data-book] .tpd-course-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.tpd-course-card[data-book] .tpd-course-title-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Wonders PDF Containers Styles */
.wonders-pdf-containers {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
}

.wonders-pdf-section {
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wonders-pdf-content {
    width: 100%;
}

.wonders-pdf-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    margin-top: 0;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.wonders-pdf-description,
.wonders-pdf-learning-style {
    font-size: 1rem;
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 1.5rem;
}

.wonders-pdf-description strong,
.wonders-pdf-learning-style strong {
    color: #1f2937;
    font-weight: 600;
}

.pdf-viewer-container {
    width: 100%;
    height: 600px;
    margin-top: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
}

.pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive adjustments for Wonders PDF containers */
@media (max-width: 1024px) {
    .wonders-pdf-containers {
        gap: 2rem;
    }
    
    .pdf-viewer-container {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .wonders-pdf-containers {
        gap: 2rem;
    }
    
    .wonders-pdf-section {
        padding: 1.5rem;
    }
    
    .pdf-viewer-container {
        height: 400px;
    }
    
    .wonders-pdf-title {
        font-size: 1.5rem;
    }
    
    .wonders-pdf-description,
    .wonders-pdf-learning-style {
        font-size: 0.9rem;
    }
}
