/* =========================
   BUTTON CORE (SYSTEM ROOT)
   ========================= */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 40px;
    padding: 0 16px;

    border-radius: 12px;
    border: 1px solid transparent;

    font-size: 14px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;
    user-select: none;

    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;

    /* 🔥 base elevation */
    box-shadow:
        0 1px 2px rgba(0,0,0,0.05);
}


/* =========================
   INTERACTION (GLOBAL)
   ========================= */

.button:not(.disabled):hover {
    transform: translateY(-1px);

    box-shadow:
        0 4px 8px rgba(0,0,0,0.08),
        0 10px 20px rgba(0,0,0,0.06);
}

.button:not(.disabled):active {
    transform: translateY(0);

    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.1);
}

.button:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(59,130,246,0.25);
}


/* =========================
   PRIMARY (MAIN CTA)
   ========================= */

.button.primary {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    color: #fff;

    border: 1px solid #2563eb;

    box-shadow:
        0 2px 4px rgba(0,0,0,0.08),
        0 8px 20px rgba(37,99,235,0.25);
}

.button.primary:hover {
    background: linear-gradient(180deg, #4f8df7, #1d4ed8);
}

.button.primary:active {
    box-shadow:
        inset 0 3px 6px rgba(0,0,0,0.2);
}


/* =========================
   SECONDARY (DEFAULT)
   ========================= */

.button.secondary {
    background: #ffffff;
    color: var(--color-text-primary);

    border: 1px solid var(--color-border-default);

    box-shadow:
        0 1px 2px rgba(0,0,0,0.04),
        0 4px 10px rgba(0,0,0,0.04);
}

.button.secondary:hover {
    border-color: var(--color-border-strong);
    background: var(--color-bg-row-hover);
}


/* =========================
   GHOST (LOW EMPHASIS)
   ========================= */

.button.ghost {
    background: transparent;
    color: var(--color-text-secondary);

    border: 1px solid transparent;
    box-shadow: none;
}

.button.ghost:hover {
    background: var(--color-bg-row-hover);
    color: var(--color-text-primary);
}


/* =========================
   DANGER (CRITICAL ACTION)
   ========================= */

.button.danger {
    background: linear-gradient(180deg, #ef4444, #dc2626);
    color: #fff;

    border: 1px solid #dc2626;

    box-shadow:
        0 2px 4px rgba(0,0,0,0.08),
        0 8px 20px rgba(220,38,38,0.25);
}

.button.danger:hover {
    background: linear-gradient(180deg, #f87171, #b91c1c);
}


/* =========================
   SIZE VARIANTS
   ========================= */

.button.sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 10px;
}

.button.lg {
    height: 48px;
    padding: 0 20px;
    font-size: 15px;
    border-radius: 14px;
}


/* =========================
   ICON BUTTON
   ========================= */

.button.icon {
    width: 40px;
    height: 40px;
    padding: 0;

    border-radius: 10px;
}


/* =========================
   DISABLED
   ========================= */

.button.disabled,
.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;

    transform: none;
    box-shadow: none;
}


/* =========================
   LOADING STATE
   ========================= */

.button.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.button.loading::after {
    content: "";
    width: 16px;
    height: 16px;

    border: 2px solid rgba(255,255,255,0.6);
    border-top-color: #fff;
    border-radius: 50%;

    position: absolute;

    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* ================= SLOT VARIANT ================= */

.button.slot {
    height: 36px;
    padding: 0 10px;

    border-radius: 10px;

    font-size: 13px;
    font-weight: 500;

    min-width: 64px;
    justify-content: center;
}

/* ================= ACTIVE STATE ================= */

.button.active {
    background: #e8eefc;
    border-color: #c7d7fe;
    color: #1e3a8a;

    box-shadow:
        inset 0 2px 6px rgba(0,0,0,0.12);
}