/* Base HTML font size for rem units - 1rem = 16px by default */
html {
    font-size: 16px;
}

/* =============== Unified Program Styles (TPD) =============== */
:root {
    --tpd-text: #1a202c;
    --tpd-text-muted: #4a5568;
    --tpd-border: #e5e7eb;
    --tpd-card-bg: #fff;
    --tpd-primary: #2ecc71;
}

.tpd-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.tpd-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--tpd-text);
    margin: 0;
}

.tpd-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.tpd-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--tpd-border);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.tpd-section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--tpd-primary);
}

.tpd-content-card {
    background: var(--tpd-card-bg);
    border-radius: 12px;
    border: 1px solid var(--tpd-border);
    padding: 20px;

    box-sizing: border-box;
}

/* Header blob for levels/lessons */
.level-blob {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--level-color, #2ecc71);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Tags/Chips */
.tpd-tag {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    margin: 0 6px 6px 0;
    font-size: .85rem;
    font-weight: 600;
    color: #fff;
}
.tpd-tag.reading { background: #FF3B30; }
.tpd-tag.grammar { background: #007AFF; }
.tpd-tag.vocabulary { background: #FF2D55; }
.tpd-tag.listening { background: #FFCC00; color: #1a1a1a; }
.tpd-tag.speaking { background: #34C759; }
.tpd-tag.assessment { background: #28A745; }
.tpd-tag.homework { background: #4682B4; }

/* Course/Lesson header compact blocks */
.tpd-course-header-content,
.tpd-lesson-title-section {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ========= Existing Program Page Styles ========= */
/* Universal font for CEFR level text */
.cefr-level-text {
    font-family: 'Quicksand', Arial, sans-serif;
    color: #444;
    font-size: .8rem;
    font-weight: 750;
    letter-spacing: 0.5px;
}

/* Simple padding control for CEFR level display */
.cefr-level-display {
    padding-top: 6px;
    padding-bottom: 6px;
}

/* Course List Styles */
.course-list-cefr-image { max-width: 56.25rem; }

/* Placement Quiz Styles */
.placement-quiz-progress-fill { width: 0%; transition: width 0.3s ease; }
.placement-quiz-prev-btn { display: none; }

/* Teacher Program Styles */
.teacher-program-image { width: 100%; height: 100%; object-fit: cover; }

/* Course and Lesson Header Layout */
.tpd-course-title-section { display: flex; align-items: center; gap: .5rem; flex: 1; }
.tpd-course-title { font-weight: bold; font-size: 1.1rem; color: #333; }
.tpd-cefr-level-display { display: flex; align-items: center; gap: 8px; margin: 0; }
.tpd-course-actions { display: flex; align-items: center; gap: .5rem; }

.tpd-lesson-title { font-weight: bold; font-size: 1rem; color: #333; margin: 0; }
.tpd-lesson-cefr { display: flex; align-items: center; gap: 8px; margin: 0; }

/* CEFR Blob Styling */
.cefr-blob { display: inline-block; width: 12px; height: 14px; border-radius: 6px 8px 6px 4px; margin-right: 4px; flex-shrink: 0; }
.cefr-blob.pre-a1 { background: #FFB6C1; }
.cefr-blob.a1 { background: #FFA07A; }
.cefr-blob.a2 { background: #FF9A9E; }
.cefr-blob.b1 { background: #98FB98; }
.cefr-blob.b2 { background: #87CEEB; }
.cefr-blob.c1 { background: #DDA0DD; }
.cefr-blob.c2 { background: #F0A0A0; }
.tpd-cefr-text { font-size: 0.8rem; color: #666; font-weight: 500; }

/* Cards */
.programs-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; margin-top: 2rem; }
.card { border-radius: 1rem; border: 1px solid #e5e7eb; background: #fff; transition: box-shadow 0.2s, transform 0.2s; }
.card:hover { ;transform: translateY(-2px) scale(1.01); }
.card-title { font-size: 1.2rem; font-weight: 700; color: #1f2937; margin: 0 !important; padding: 0 !important; line-height: 1.2; display: inline; }
.card-text { color: #6b7280; font-size: 1rem; margin-bottom: 0.5rem; }
.card-footer { background: none; border-top: none; padding-top: 0.5rem; }
.badge.bg-primary { background: #2ecc71 !important; color: #fff !important; font-size: 0.95rem; padding: 0.3em .5em; border-radius: 0.5em; font-weight: 600; }

@media (max-width: 768px) {
    .programs-card-grid { grid-template-columns: 1fr; gap: 1rem; }
    .tpd-course-header-content, .tpd-lesson-title-section { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .tpd-course-title-section { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}