/**
 * Mundo Margo Blocks - Component Styles
 * All components use tokens from the theme for consistency
 */

/* ===== BUTTON COMPONENT ===== */
.mm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-family: var(--wp--preset--font-family--primary);
    font-size: var(--wp--preset--font-size--base);
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-md);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    outline: none;
    padding: 0.5rem 1rem;
}

.mm-button:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.mm-button:disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Button Variants */
.mm-button--primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.mm-button--primary:hover {
    background-color: hsl(var(--primary) / 0.9);
}

.mm-button--secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.mm-button--secondary:hover {
    background-color: hsl(var(--secondary) / 0.9);
}

.mm-button--accent {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.mm-button--accent:hover {
    background-color: hsl(var(--accent) / 0.9);
}

.mm-button--destructive {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.mm-button--destructive:hover {
    background-color: hsl(var(--destructive) / 0.9);
}

.mm-button--outline {
    background-color: transparent;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
}

.mm-button--outline:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.mm-button--ghost {
    background-color: transparent;
    color: hsl(var(--foreground));
}

.mm-button--ghost:hover {
    background-color: hsl(var(--accent) / 0.1);
}

/* Button Sizes */
.mm-button--sm {
    height: 2rem;
    padding: 0 0.75rem;
    font-size: var(--wp--preset--font-size--sm);
}

.mm-button--md {
    height: 2.5rem;
    padding: 0 1rem;
}

.mm-button--lg {
    height: 3rem;
    padding: 0 1.5rem;
    font-size: var(--wp--preset--font-size--lg);
}

/* ===== CARD COMPONENT ===== */
.mm-card {
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border-radius: var(--radius-lg);
    border: 1px solid hsl(var(--border));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.mm-card__header {
    padding: 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
}

.mm-card__title {
    font-size: var(--wp--preset--font-size--2-xl);
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.mm-card__description {
    font-size: var(--wp--preset--font-size--sm);
    color: hsl(var(--muted-foreground));
    margin-top: 0.5rem;
}

.mm-card__content {
    padding: 1.5rem;
}

.mm-card__footer {
    padding: 1.5rem;
    border-top: 1px solid hsl(var(--border));
    background-color: hsl(var(--muted) / 0.3);
}

/* ===== BADGE COMPONENT ===== */
.mm-badge {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-full);
    padding: 0.25rem 0.625rem;
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
}

/* Badge Variants */
.mm-badge--default {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.mm-badge--secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.mm-badge--success {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.mm-badge--warning {
    background-color: hsl(var(--warning));
    color: hsl(var(--warning-foreground));
}

.mm-badge--error {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.mm-badge--outline {
    background-color: transparent;
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
}

/* ===== ALERT COMPONENT ===== */
.mm-alert {
    position: relative;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid hsl(var(--border));
    margin-bottom: 1rem;
}

.mm-alert__title {
    font-weight: 600;
    font-size: var(--wp--preset--font-size--base);
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

.mm-alert__description {
    font-size: var(--wp--preset--font-size--sm);
    line-height: 1.6;
}

/* Alert Variants */
.mm-alert--default {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}

.mm-alert--success {
    background-color: hsl(var(--secondary) / 0.1);
    border-color: hsl(var(--secondary));
    color: hsl(var(--foreground));
}

.mm-alert--success .mm-alert__title {
    color: hsl(var(--secondary));
}

.mm-alert--warning {
    background-color: hsl(var(--warning) / 0.1);
    border-color: hsl(var(--warning));
    color: hsl(var(--foreground));
}

.mm-alert--warning .mm-alert__title {
    color: hsl(var(--warning-foreground));
}

.mm-alert--error {
    background-color: hsl(var(--destructive) / 0.1);
    border-color: hsl(var(--destructive));
    color: hsl(var(--foreground));
}

.mm-alert--error .mm-alert__title {
    color: hsl(var(--destructive));
}

.mm-alert--info {
    background-color: hsl(var(--accent) / 0.1);
    border-color: hsl(var(--accent));
    color: hsl(var(--foreground));
}

.mm-alert--info .mm-alert__title {
    color: hsl(var(--accent));
}

/* ===== RADIO GROUP COMPONENT ===== */
.mm-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mm-radio-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mm-radio-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid hsl(var(--primary));
    border-radius: var(--radius-full);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.mm-radio-input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.625rem;
    height: 0.625rem;
    background-color: hsl(var(--primary));
    border-radius: var(--radius-full);
}

.mm-radio-label {
    font-size: var(--wp--preset--font-size--base);
    color: hsl(var(--foreground));
    cursor: pointer;
    user-select: none;
}

.mm-radio-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mm-radio-input:disabled + .mm-radio-label {
    opacity: 0.5;
    cursor: not-allowed;
}
