/* ==========================================================================
   LMR Recipe Scaling UI Styles
   ========================================================================== */

/* Override the default theme layout for the servings box so the controls stack */
#lmr-servings.lmr-servings-wrapper {
    display: inline-block !important; /* Overrides mobile inline-flex row */
    text-align: center;
}

.lmr-scale-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px; /* Pushes the controls directly under the servings text */
    margin-left: 0;
}

.lmr-scale-dropdown {
    padding: 4px 8px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}

.lmr-scale-dropdown:focus {
    border-color: #9caf88;
    box-shadow: 0 0 0 2px rgba(156, 175, 136, 0.2);
}

.lmr-scale-btn {
    background-color: #ff6347;
    color: #ffffff;
    border: none;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.lmr-scale-btn:hover:not(:disabled) {
    background-color: #e5533d;
}

.lmr-scale-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.lmr-scale-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Animated Ellipsis Loader inside the button */
.lmr-scale-loading-dots::after {
    content: '.';
    animation: lmr-scale-dots 1.5s steps(5, end) infinite;
    display: inline-block;
    width: 1em;
    text-align: left;
}

@keyframes lmr-scale-dots {
    0%, 20% {
        color: rgba(255,255,255,0);
        text-shadow:
            .25em 0 0 rgba(255,255,255,0),
            .5em 0 0 rgba(255,255,255,0);
    }
    40% {
        color: white;
        text-shadow:
            .25em 0 0 rgba(255,255,255,0),
            .5em 0 0 rgba(255,255,255,0);
    }
    60% {
        text-shadow:
            .25em 0 0 white,
            .5em 0 0 rgba(255,255,255,0);
    }
    80%, 100% {
        text-shadow:
            .25em 0 0 white,
            .5em 0 0 white;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .lmr-scale-container {
        margin-top: 8px;
        gap: 5px;
    }
    
    .lmr-scale-dropdown,
    .lmr-scale-btn {
        padding: 4px 6px;
        font-size: 12px;
    }
}