/* ========================================
   ACCORDION COMPONENTS
   Reusable accordion styles for the entire application
   ======================================== */

/* ========================================
   COURSE ACCORDION (Teacher Program Pages)
   ======================================== */

/* Accordion Container */
.tpd-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Accordion Card */
.tpd-course-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;

    padding: 0 1.25rem;
    max-width: 100%;
}

/* Accordion Header */
.tpd-course-header {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.tpd-course-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-grow: 1;
    min-width: 0;
}

.tpd-course-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
    min-width: 0;
}

.tpd-course-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding-right: 2rem;
}

.tpd-course-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.tpd-course-title-input {
    font-size: 1.25rem;
    padding: 0.25rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.tpd-lesson-count {
    font-size: 0.95rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tpd-chevron {
    transition: transform 0.3s ease;
    font-size: 1.25rem;
    color: #4a5568;
    margin-right: 0.5rem;
}

.tpd-chevron.show {
    transform: rotate(180deg);
}

.tpd-course-body {
    padding: 1.25rem;
}

/* ========================================
   MATERIALS ACCORDION (Lesson Detail Pages)
   ======================================== */

.tpd-materials-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem !important;
}

/* Override conflicting rules from create_program.css */
.lesson-detail-page .tpd-materials-accordion {
    flex: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

/* Force spacing - more aggressive override */
.lesson-detail-page .tpd-materials-accordion > .tpd-materials-card {
    margin-bottom: 1rem !important;
    margin-top: 1rem !important;
    flex: none !important;
}

.lesson-detail-page .tpd-materials-accordion > .tpd-materials-card:first-child {
    margin-top: 0 !important;
}

.lesson-detail-page .tpd-materials-accordion > .tpd-materials-card:last-child {
    margin-bottom: 0 !important;
}

.tpd-materials-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;

    overflow: hidden;
    margin-bottom: 1rem !important;
}

.tpd-materials-header {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.tpd-materials-header:hover {
    background: #e9ecef;
}

.tpd-materials-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
    min-width: 0;
}

.tpd-materials-chevron-section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.tpd-materials-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Inline eye icon used in section headers */
.tpd-eye-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: inline-block;
}

.tpd-materials-chevron {
    transition: transform 0.3s ease;
    font-size: 1.25rem;
    color: #4a5568;
}

/* Bootstrap collapse integration */
.tpd-materials-header[aria-expanded="true"] .tpd-materials-chevron {
    transform: rotate(180deg);
}

.tpd-materials-body {
    padding: 1.25rem;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.tpd-materials-empty {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #e5e7eb;
    position: relative;
}

.tpd-materials-empty i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #9ca3af;
}

/* Image icon variant for empty state (e.g., Turkish eye image) */
.tpd-materials-empty img.tpd-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    object-fit: contain;
    display: inline-block;
}

.tpd-materials-empty h4 {
    margin-bottom: 0.5rem;
    color: #374151;
}

.tpd-materials-empty p {
    margin-bottom: 1.5rem;
    color: #6b7280;
}

.tpd-materials-empty .tpd-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

/* ========================================
   LESSON CARD STYLES
   ======================================== */

.tpd-lesson-card {
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
}

.tpd-lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.tpd-lesson-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-grow: 1;
    min-width: 0;
}

.tpd-lesson-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    white-space: nowrap;
}

.tpd-lesson-count-chevron {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .tpd-course-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .tpd-course-title-section {
        flex-wrap: wrap;
    }
    
    .tpd-course-actions {
        margin-top: 0.5rem;
        padding-right: 0;
    }
    
    .tpd-materials-header {
        padding: 1rem;
    }
    
    .tpd-materials-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .tpd-materials-chevron-section {
        align-self: flex-end;
    }
} 

/* Force proper spacing between materials cards */
.tpd-materials-accordion > .tpd-materials-card {
    margin-bottom: 1rem !important;
    margin-top: 1rem !important;
}

.tpd-materials-accordion > .tpd-materials-card:first-child {
    margin-top: 0 !important;
}

.tpd-materials-accordion > .tpd-materials-card:last-child {
    margin-bottom: 0 !important;
}

/* Additional spacing fix */
.tpd-materials-accordion .tpd-materials-card + .tpd-materials-card {
    margin-top: 1rem !important;
} 