/* ==========================================================
   DAMIOLINK UI DESIGN SYSTEM
   Shared UI tokens + buttons
   ========================================================== */


/* ----------------------------------------------------------
   GLOBAL TOKENS
   ---------------------------------------------------------- */

:root {

    --dl-font:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    --dl-radius-sm: 6px;
    --dl-radius-button: 8px;
    --dl-radius-card: 12px;

    --dl-button-height: 42px;
    --dl-button-height-sm: 34px;
    --dl-button-height-lg: 48px;

    --dl-transition: 150ms ease;

    --dl-primary: #1677e8;
    --dl-primary-hover: #0f69d5;
    --dl-primary-active: #0b5fc4;

    --dl-danger: #d92d3a;
    --dl-danger-hover: #c52230;

    --dl-success: #168653;
    --dl-warning: #d97706;
}


/* ----------------------------------------------------------
   LIGHT THEME
   ---------------------------------------------------------- */

[data-theme="light"],
:root {

    --dl-bg: #f5f7fb;

    --dl-surface: #ffffff;
    --dl-surface-2: #f8fafc;
    --dl-surface-hover: #f1f5f9;

    --dl-text: #172033;
    --dl-text-soft: #475467;
    --dl-muted: #667085;

    --dl-border: #dfe5ec;
    --dl-border-strong: #cbd5e1;

    --dl-focus: rgba(22, 119, 232, .20);

    --dl-primary-text: #ffffff;

    --dl-secondary-bg: #ffffff;
    --dl-secondary-hover: #f4f7fa;
    --dl-secondary-text: #344054;
    --dl-secondary-border: #d0d5dd;

    --dl-ghost-hover: #eef4ff;
    --dl-ghost-text: #475467;

    --dl-danger-bg: #fff5f5;
    --dl-danger-border: #fecaca;
    --dl-danger-text: #b4232f;

    --dl-shadow-button:
        0 2px 5px rgba(16, 24, 40, .08);
}


/* ----------------------------------------------------------
   DARK THEME
   ---------------------------------------------------------- */

[data-theme="dark"] {

    --dl-bg: #020b14;

    --dl-surface: #071b2b;
    --dl-surface-2: #0a2235;
    --dl-surface-hover: #0d2940;

    --dl-text: #f4f8fd;
    --dl-text-soft: #afc1d4;
    --dl-muted: #718aa3;

    --dl-border: rgba(131, 190, 241, .14);
    --dl-border-strong: rgba(120, 190, 255, .28);

    --dl-focus: rgba(38, 140, 255, .28);

    --dl-primary-text: #ffffff;

    --dl-secondary-bg: rgba(10, 34, 54, .75);
    --dl-secondary-hover: rgba(17, 50, 76, .92);
    --dl-secondary-text: #c5d7e7;
    --dl-secondary-border: rgba(131, 190, 241, .18);

    --dl-ghost-hover: rgba(24, 83, 137, .20);
    --dl-ghost-text: #a9c9e4;

    --dl-danger-bg: rgba(255, 79, 91, .08);
    --dl-danger-border: rgba(255, 94, 104, .24);
    --dl-danger-text: #ffb3b8;

    --dl-shadow-button:
        0 5px 14px rgba(0, 0, 0, .16);
}


/* ----------------------------------------------------------
   BUTTON BASE
   ---------------------------------------------------------- */

.dl-btn {

    min-height: var(--dl-button-height);

    padding: 9px 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    border: 1px solid transparent;
    border-radius: var(--dl-radius-button);

    font-family: var(--dl-font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;

    text-decoration: none;

    cursor: pointer;

    user-select: none;

    transition:
        background var(--dl-transition),
        border-color var(--dl-transition),
        color var(--dl-transition),
        box-shadow var(--dl-transition),
        transform var(--dl-transition);
}


.dl-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}


.dl-btn:active:not(:disabled) {
    transform: translateY(0);
}


.dl-btn:focus-visible {

    outline: none;

    box-shadow:
        0 0 0 3px var(--dl-focus);
}


.dl-btn:disabled,
.dl-btn[aria-disabled="true"] {

    opacity: .48;

    cursor: not-allowed;

    pointer-events: none;

    transform: none;
}


/* ----------------------------------------------------------
   PRIMARY
   ---------------------------------------------------------- */

.dl-btn-primary {

    color: var(--dl-primary-text);

    background:
        linear-gradient(
            180deg,
            #268cff,
            var(--dl-primary)
        );

    border-color:
        rgba(69, 151, 240, .65);

    box-shadow:
        var(--dl-shadow-button);
}


.dl-btn-primary:hover:not(:disabled) {

    background:
        linear-gradient(
            180deg,
            #2585f5,
            var(--dl-primary-hover)
        );
}


.dl-btn-primary:active:not(:disabled) {

    background:
        var(--dl-primary-active);
}


/* ----------------------------------------------------------
   SECONDARY
   ---------------------------------------------------------- */

.dl-btn-secondary {

    color:
        var(--dl-secondary-text);

    background:
        var(--dl-secondary-bg);

    border-color:
        var(--dl-secondary-border);
}


.dl-btn-secondary:hover:not(:disabled) {

    background:
        var(--dl-secondary-hover);

    border-color:
        var(--dl-border-strong);
}


/* ----------------------------------------------------------
   DANGER
   ---------------------------------------------------------- */

.dl-btn-danger {

    color:
        var(--dl-danger-text);

    background:
        var(--dl-danger-bg);

    border-color:
        var(--dl-danger-border);
}


.dl-btn-danger:hover:not(:disabled) {

    color: #ffffff;

    background:
        var(--dl-danger);

    border-color:
        var(--dl-danger);
}


/* ----------------------------------------------------------
   GHOST
   ---------------------------------------------------------- */

.dl-btn-ghost {

    color:
        var(--dl-ghost-text);

    background:
        transparent;

    border-color:
        transparent;

    box-shadow:
        none;
}


.dl-btn-ghost:hover:not(:disabled) {

    color:
        var(--dl-text);

    background:
        var(--dl-ghost-hover);
}


/* ----------------------------------------------------------
   ICON BUTTON
   ---------------------------------------------------------- */

.dl-btn-icon {

    width:
        var(--dl-button-height);

    min-width:
        var(--dl-button-height);

    height:
        var(--dl-button-height);

    padding: 0;
}


/* ----------------------------------------------------------
   SIZES
   ---------------------------------------------------------- */

.dl-btn-sm {

    min-height:
        var(--dl-button-height-sm);

    padding:
        7px 11px;

    font-size:
        13px;
}


.dl-btn-lg {

    min-height:
        var(--dl-button-height-lg);

    padding:
        11px 20px;

    font-size:
        15px;
}


/* ----------------------------------------------------------
   BUTTON GROUP
   ---------------------------------------------------------- */

.dl-button-group {

    display: flex;
    align-items: center;

    gap: 8px;

    flex-wrap: wrap;
}


/* ----------------------------------------------------------
   MOBILE
   ---------------------------------------------------------- */

@media (max-width: 640px) {

    .dl-btn {

        min-height: 44px;
    }

    .dl-btn-mobile-full {

        width: 100%;
    }
}
