/* Fix for collapsible content to completely hide text until clicked */
.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 !important;
    opacity: 0;
    visibility: visible; /* Changed to visible so content can be measured */
    display: block !important;
    height: auto; /* Changed to auto to allow proper height calculation */
}

.collapsible-content.active {
    max-height: 1000px; /* Adjust as needed */
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in, padding 0.3s ease-in;
    padding: 1rem !important;
    opacity: 1;
    visibility: visible;
    height: auto;
}

/* Make the transcription container shorter */
.transcription-container {
    padding-bottom: 0.5rem;
}

/* Hide placeholder text completely when collapsed */
.collapsible-content:not(.active) .placeholder,
.collapsible-content:not(.active) .transcription-content {
    display: none;
}

/* Make the collapsible header more prominent */
.collapsible-header {
    padding: 8px 0;
    margin-bottom: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Adjust the height of the transcription container */
.transcription-container {
    min-height: auto;
    padding-top: 1.5rem;
}

/* Make the chevron icon more noticeable */
.collapsible-header i.fas.fa-chevron-down {
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

/* Rotate the chevron when active */
.collapsible-header.active i.fas.fa-chevron-down {
    transform: rotate(180deg);
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
    .collapsible-content {
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .collapsible-content.active {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .transcription-content {
        width: 100%;
        word-break: break-word;
    }
}
