/* Professional formula animation styles */
.pde-equation-main {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin: 10px 0;
    padding-right: 0;
    width: 100%;
    position: relative;
}

.formula-container {
    position: relative;
    width: auto; /* Auto width to fit content */
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align to the right */
    font-size: 0.8em; /* Make text even smaller */
    text-align: right;
    padding-right: 0; /* No right padding */
    margin-left: auto; /* Push to the right edge */
}

/* Main formula is always visible and aligned all the way to the right */
#main-formula {
    display: block;
    width: max-content; /* Only as wide as needed */
    text-align: right;
    opacity: 1;
    visibility: visible;
    margin-bottom: 2px; /* Minimal gap between lines */
    font-size: 1.2em;
    margin-left: auto; /* Push to the right edge */
    white-space: nowrap; /* Prevent line breaks */
}

/* Container for additional formulas */
.additional-formulas {
    position: relative;
    width: 100%;
    min-height: 40px; /* Reserve space for the additional formulas */
    margin-top: 5px;
}

/* Secondary formulas styling - right-aligned and on one line with discrete color */
.formula {
    position: absolute;
    width: max-content; /* Only as wide as needed */
    text-align: right;
    right: 0; /* Align to the right edge */
    left: auto;
    top: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, 
                visibility 1s ease,
                transform 1s ease;
    white-space: nowrap; /* Prevent line breaks */
    color: #778899; /* Discrete slate gray color */
    font-size: 0.95em; /* Slightly smaller than main formula */
    transform: translateY(5px) scale(0.98);
    transform-origin: right center;
}

/* Active formula state */
.formula.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
