/*
 * PURPOSE: Foundation UI primitives for MySabun Starter Pack.
 * RESPONSIBILITY: Cards, buttons, form inputs, status badges, and global toasts.
 * WHAT MUST NOT BE PUT HERE: Complex application builders, dashboard cards, or module-specific UI.
 */

/* --- Cards --- */
.card {
    background-color: var(--color-surface-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg);
    border: 1px solid var(--color-border-light);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    user-select: none;
    min-height: 44px; /* Minimum touch target for accessibility */
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--color-action);
    color: var(--color-text-inverse);
    border-color: var(--color-action);
}

.btn-primary:hover:not(:disabled) {
    background-color: #C22978; /* Slightly darker magenta */
    border-color: #C22978;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-surface-light);
}

/* --- Forms --- */
.form-field {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-md);
}

.form-label {
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    color: var(--color-text-main);
    background-color: var(--color-surface-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    min-height: 44px; /* Minimum touch target */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-border-focus);
    /* Soft cyan focus ring using rgba */
    box-shadow: 0 0 0 3px rgba(49, 195, 217, 0.2);
}

/* --- Status Badges --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px var(--space-sm);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.status-badge-neutral {
    background-color: var(--color-surface-light);
    color: var(--color-primary);
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: calc(80px + var(--space-md)); /* Above mobile nav */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
    width: max-content;
    max-width: 90vw;
}

@media (min-width: 1024px) {
    .toast-container {
        bottom: var(--space-lg);
    }
}

.toast {
    background-color: var(--color-surface-white);
    color: var(--color-text-main);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    box-shadow: var(--shadow-elevated);
    border: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: toast-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto; /* Let users click/interact if needed later */
}

.toast-success {
    border-left: 4px solid var(--color-status-success);
}

.toast-icon {
    color: var(--color-status-success);
    flex-shrink: 0;
}

@keyframes toast-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
