/* ═══════════════════════════════════════════════
   MULTI-STATE BADGE (Motion.dev inspired)
   ═══════════════════════════════════════════════ */

.msb-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    height: 48px;
    border-radius: var(--radius-sm, 8px);
    font-family: var(--font-mono, monospace);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    outline: none;
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
    border: 1px solid transparent;
}

.msb-container:disabled {
    cursor: not-allowed;
}

/* Base structural element to measure width dynamically */
.msb-content-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
}

/* Individual state containers */
.msb-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
}

.msb-state.active {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    pointer-events: auto;
    opacity: 1;
}

/* Icons styling */
.msb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.msb-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 2;
}

/* Loading Spinner */
.msb-spinner {
    animation: msb-spin 1s linear infinite;
}

@keyframes msb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Color States */
.msb-theme-idle {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-color, rgba(255, 255, 255, 0.2));
}

.msb-theme-idle:hover:not(:disabled) {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

.msb-theme-loading {
    background-color: var(--bg-secondary, #1f1f1f);
    color: var(--text-secondary, #a1a1aa);
    border-color: var(--border-color, rgba(255, 255, 255, 0.2));
}

.msb-theme-success {
    background-color: rgba(39, 201, 63, 0.1); /* Subtle green */
    color: #27C93F;
    border-color: rgba(39, 201, 63, 0.3);
}

.msb-theme-error {
    background-color: rgba(255, 95, 86, 0.1); /* Subtle red */
    color: #FF5F56;
    border-color: rgba(255, 95, 86, 0.3);
}
