/* Details element animation */
details {
    overflow: hidden;
    transition: all 0.25s ease;

    &:not([open]) {
        padding-bottom: 0;
    }

    & summary {
        position: relative;
        cursor: pointer;
        padding: 10px 0;
        user-select: none;

        &::-webkit-details-marker {
            display: none;
        }
    }

    /* Rotate arrow when open */
    & .details-arrow {
        transition: transform 0.3s ease;
        margin-left: 5px;
        vertical-align: middle;
    }

    &[open] .details-arrow {
        transform: rotate(180deg);
    }

    /* Content animation */
    &>*:not(summary) {
        opacity: 0;
        overflow: hidden;
        max-height: 0;
        transition: all 0.4s ease-in-out;
    }

    &[open]>*:not(summary) {
        opacity: 1;
        max-height: 1000px;
        /* Adjust this value to accommodate your largest content */
        padding-top: 1em;
        padding-bottom: 1em;
        animation: slideDown 0.3s ease-out;
    }
}

/* Add smooth sliding effect for content */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
