/* Button color variants
 * Brand - primary button
 * Secondary - secondary button
 * Negative - negative button
 */

 /* Container styles */
 .container {
    background-color: var(--background-primary);
    padding: 20px;
    margin: 0 0 20px 0;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
}

/* Base button styles */
.custom-btn-default {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-style: normal;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0;
    box-shadow: none;

    transition: all 0.3s cubic-bezier(0, 1.01, 0.57, 1);
}

.custom-btn-default:disabled {
    cursor: not-allowed;
}

a.custom-btn-default {
    text-decoration: none;
}


/* Input styles */
.custom-input-label{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.custom-input[type="text"] {
    border: 1px solid var(--border-secondary);
    border-radius: 12px;
    padding: 12px 16px;
    width: 100%;

    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;

    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0;

    box-shadow: none;

    transition: all 0.3s cubic-bezier(0, 1.01, 0.57, 1);
}

.custom-input[type="text"]::placeholder {
    color: var(--text-secondary);
}

.custom-input[type="text"]:focus {
    border: 1px solid var(--background-brand);
    outline: none;
    caret-color: var(--text-brand);
}

.custom-input[type="text"]:disabled {
    background-color: var(--background-secondary);
    color: var(--text-tertiary);
    border: 1px solid var(--border-secondary);
    cursor: not-allowed;
}

.custom-input[type="text"] > span.field-validation-error{
    border: 1px solid var(--background-negative);
    outline: none;
    caret-color: var(--text-negative); 
    background-color: var(--background-negative-alfa);
}


/* Brand styles */
.custom-btn-default.brand {
    background-color: var(--background-brand);
    color: var(--text-primary-inverse);
    border: 1px solid var(--border-brand);
}

.custom-btn-default.brand:hover {
    background-color: var(--background-brand-hover);
    border: 1px solid var(--background-brand-hover);
}

.custom-btn-default.brand:active {
    background-color: var(--background-brand-pressed);
    border: 1px solid var(--background-brand-pressed);
}

.custom-btn-default.brand:disabled {
    background-color: var(--background-disabled);
    color: var(--text-tertiary);
    border: 1px solid var(--background-disabled);
}

.custom-btn-default.brand i {
    filter: var(--brand-icon-filter);
}

.custom-btn-default.brand:disabled i {
    filter: var(--brand-icon-disabled-filter);
}

.custom-input.brand[type="text"] {
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.custom-input.brand[type="text"]:focus {
    border: 1px solid var(--background-brand);
    outline: none;
    caret-color: var(--text-brand);
}


/* Secondary styles */
.custom-btn-default.secondary {
    background-color: var(--background-neutral-alfa);
    color: var(--text-primary);
    border: 1px solid var(--background-neutral-alfa);
}

.custom-btn-default.secondary:hover {
    background-color: var(--background-neutral-hover);
    border: 1px solid var(--background-neutral-hover);
}

.custom-btn-default.secondary:active {
    background-color: var(--background-neutral-pressed);
    border: 1px solid var(--background-neutral-pressed);
}

.custom-btn-default.secondary:disabled {
    background-color: var(--background-disabled);
    color: var(--text-tertiary);
    border: 1px solid var(--background-disabled);
}

.custom-btn-default.secondary i {
    filter: var(--primary-icon-filter);
}

.custom-btn-default.secondary:disabled i {
    filter: var(--brand-icon-disabled-filter);
}

.custom-input.secondary[type="text"] {
    background-color: var(--background-neutral-alfa);
    color: var(--text-primary);
    border: 1px solid var(--background-neutral-alfa);
}

.custom-input.secondary[type="text"]:focus {
    border: 1px solid var(--background-neutral-active);
    background-color: var(--background-neutral-active);
    outline: none;
    caret-color: var(--text-brand);
}


/* Negative styles */
.custom-btn-default.negative {
    background-color: var(--background-negative);
    color: var(--text-primary-inverse);
    border: 1px solid var(--background-negative);
}

.custom-btn-default.negative:hover {
    background-color: var(--background-negative-hover);
    border: 1px solid var(--background-negative-hover);
}

.custom-btn-default.negative:active {
    background-color: var(--background-negative-pressed);
    border: 1px solid var(--background-negative-pressed);
}

.custom-btn-default.negative:disabled {
    background-color: var(--background-disabled);
    color: var(--text-tertiary);
    border: 1px solid var(--background-disabled);
}

.custom-btn-default.negative i {
    filter: var(--negative-icon-filter);
}

.custom-btn-default.negative:disabled i {
    filter: var(--brand-icon-disabled-filter);
}

/* Dark styles */
.custom-btn-default.dark {
    background-color: var(--background-mono);
    color: var(--text-primary-inverse);
    border: 1px solid var(--background-mono);
}

.custom-btn-default.dark:hover {
    background-color: var(--background-mono-hover);
    border: 1px solid var(--background-mono-hover);
}

.custom-btn-default.dark:active {
    background-color: var(--background-mono-pressed);
    border: 1px solid var(--background-mono-pressed);
}

.custom-btn-default.dark:disabled {
    background-color: var(--background-disabled);
    color: var(--text-tertiary);
    border: 1px solid var(--background-disabled);
}

.custom-btn-default.dark i {
    filter: var(--negative-icon-filter);
}

.custom-btn-default.dark:disabled i {
    filter: var(--brand-icon-disabled-filter);
}

.custom-btn-default.primarySecondary {
    background-color: var(--background-brand-secondary);
    color: var(--text-brand-secondary);
    border: 1px solid var(--background-brand-secondary);
}

.custom-btn-default.primarySecondary i {
    filter: var(--brand-secondary-icon-filter);
}

/* Button size variants */
/* Icon-only buttons */
.custom-btn-default.xl.icon-only {
    width: 48px;
    height: 48px;
    padding: 0;
}

.custom-btn-default.l.icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
}

.custom-btn-default.m.icon-only {
    width: 28px;
    height: 28px;
    padding: 0;
}


/* Regular size variants */
.xl i {
    width: 24px;
    height: 24px;
}
.l i {
    width: 20px;
    height: 20px;
}
.m i {
    width: 16px;
    height: 16px;
}

.custom-btn-default.xl,
.custom-input.xl[type="text"] {
    height: 48px;
    padding: 12px 24px;
    gap: 8px;
    border-radius: 16px;
    font-size: 16px;
}

.custom-btn-default.l,
.custom-input.l[type="text"] {
    height: 36px;
    padding: 8px 16px;
    gap: 8px;
    border-radius: 12px;
    font-size: 14px;
}

.custom-btn-default.m,
.custom-input.m[type="text"] {
    height: 32px;
    padding: 8px 12px;
    gap: 8px;
    border-radius: 8px;
    font-size: 14px;
}


/* Image styles */
.custom-image {
    object-fit: cover;
    transition: all 0.3s cubic-bezier(0, 1.01, 0.57, 1);
}

.custom-image.xl3,
.custom-image.xl2,
.custom-image.xl1,
.custom-image.xl,
.custom-image.l,
.custom-image.m,
.custom-image.s,
.custom-image.xs,
.custom-image.xs1 {
    width: 100%;
    height: 100%;
}

.custom-image.xl3 {
    max-width: 192px;
    max-height: 192px;
}

.custom-image.xl2 {
    max-width: 160px;
    max-height: 160px;
}

.custom-image.xl1 {
    max-width: 128px;
    max-height: 128px;
}

.custom-image.xl {
    max-width: 112px;
    max-height: 112px;
}

.custom-image.l {
    max-width: 96px;
    max-height: 96px;
}
.custom-image.m {
    max-width: 80px;
    max-height: 80px;
}
.custom-image.s {
    max-width: 72px;
    max-height: 72px;
}
.custom-image.xs {
    max-width: 64px;
    max-height: 64px;
}
.custom-image.xs1 {
    max-width: 56px;
    max-height: 56px;
}

.custom-image.circle {
    border-radius: 50%;
}

.custom-image.rounded {
    border-radius: 24px;
}

.custom-image.square {
    border-radius: 0;
}

@media screen and (max-width: 575px){
    .custom-image.xl3,
    .custom-image.xl2,
    .custom-image.xl1,
    .custom-image.xl,
    .custom-image.l,
    .custom-image.m,
    .custom-image.s,
    .custom-image.xs,
    .custom-image.xs1{
        max-width: 100%;
    }
}

/* Radio styles (new) */
.custom-radio {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.custom-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-radio .radio-mark {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-secondary);
    border-radius: 50%;
    background: none;
    transition: border-color 0.2s;
}

.custom-radio input[type="radio"]:checked ~ .radio-mark {
    border-color: var(--background-brand);
}

.custom-radio .radio-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--background-brand);
    opacity: 0;
    transition: opacity 0.2s;
}

.custom-radio input[type="radio"]:checked ~ .radio-mark::after {
    opacity: 1;
}

.custom-radio input[type="radio"]:disabled ~ .radio-mark {
    border-color: var(--background-disabled);
    background: none;
    cursor: not-allowed;
}

.custom-radio input[type="radio"]:disabled ~ .radio-mark::after {
    background: var(--background-disabled);
}

.custom-radio input[type="radio"]:disabled:checked ~ .radio-mark::after {
    background: var(--text-tertiary);
    opacity: 1;
}

.custom-radio .radio-label {
    font-size: 14px;
    line-height: 20px;
    color: var(--text-primary);
}

.custom-radio input[type="radio"]:disabled ~ .radio-label {
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* Radio size modifiers */
.custom-radio.xl .radio-mark { width: 32px; height: 32px; }
.custom-radio.l  .radio-mark { width: 28px; height: 28px; }
.custom-radio.m  .radio-mark { width: 24px; height: 24px; }
.custom-radio.s  .radio-mark { width: 20px; height: 20px; }
.custom-radio.xs .radio-mark { width: 16px; height: 16px; }

.custom-radio.xl .radio-mark::after { width: 16px; height: 16px; }
.custom-radio.l  .radio-mark::after { width: 14px; height: 14px; }
.custom-radio.m  .radio-mark::after { width: 12px; height: 12px; }
.custom-radio.s  .radio-mark::after { width: 10px; height: 10px; }
.custom-radio.xs .radio-mark::after { width: 8px;  height: 8px;  }

/* Switch styles */
.custom-switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 40px;
}

.custom-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background-disabled);
    border-radius: 20px;
    transition: background 0.3s;
}

.custom-switch input[type="checkbox"]:checked + .custom-switch-slider {
    background: var(--background-brand);
}

.custom-switch-slider::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.custom-switch input[type="checkbox"]:checked + .custom-switch-slider::before {
    transform: translateX(24px);
}

.custom-switch input[type="checkbox"]:disabled + .custom-switch-slider {
    background: var(--background-disabled);
    cursor: not-allowed;
}

.custom-switch input[type="checkbox"]:disabled + .custom-switch-slider::before {
    background: #f4f4f4;
}

/* Switch size modifiers */
.custom-switch.xl { width: 64px; height: 40px; }
.custom-switch.l  { width: 56px; height: 32px; }
.custom-switch.m  { width: 44px; height: 24px; }
.custom-switch.s  { width: 36px; height: 18px; }
.custom-switch.xs { width: 28px; height: 12px; }

.custom-switch.xl .custom-switch-slider::before { width: 32px; height: 32px; left: 4px; top: 4px; }
.custom-switch.l  .custom-switch-slider::before { width: 24px; height: 24px; left: 4px; top: 4px; }
.custom-switch.m  .custom-switch-slider::before { width: 16px; height: 16px; left: 4px; top: 4px; }
.custom-switch.s  .custom-switch-slider::before { width: 10px; height: 10px; left: 4px; top: 4px; }
.custom-switch.xs .custom-switch-slider::before { width: 6px;  height: 6px;  left: 3px; top: 3px; }

.custom-switch.xl input[type="checkbox"]:checked + .custom-switch-slider::before { transform: translateX(24px); }
.custom-switch.l  input[type="checkbox"]:checked + .custom-switch-slider::before { transform: translateX(24px); }
.custom-switch.m  input[type="checkbox"]:checked + .custom-switch-slider::before { transform: translateX(21px); }
.custom-switch.s  input[type="checkbox"]:checked + .custom-switch-slider::before { transform: translateX(19px); }
.custom-switch.xs input[type="checkbox"]:checked + .custom-switch-slider::before { transform: translateX(20px); }

a.custom-link{
    color: var(--text-brand);
    text-decoration: none;
}

/* rotate */
.rotate-90{
    transform: rotate(90deg);
}
.rotate-180{
    transform: rotate(180deg);
}
.rotate-270{
    transform: rotate(270deg);
}

@media screen and (max-width: 768px) {
    .custom-btn-default.xl,
    .custom-btn-default.l,
    .custom-btn-default.m {
        height: auto;
    }
}

/* --- Custom Select --- */

.custom-select {
    &, &::picker(select) {
        appearance: base-select;
        border: none;
        transition: 0.4s;
    }
}

select.custom-select{
    background: var(--background-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--br-7xl);
    padding: 6px 12px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.4s;
}

select.custom-select:hover,
select.custom-select:focus,
select.custom-select:active{
    border-color: var(--background-brand-hover);
    outline: none;
    box-shadow: none;
}

select.custom-select::-ms-expand {
    display: none;
}

select.custom-select::picker-icon {
    transition: 0.4s rotate;
}
select.custom-select:open::picker-icon {
    rotate: 180deg;
}

select.custom-select option {
    display: flex;
    justify-content: flex-start;
    gap: 8px;

    border: 2px solid #ddd;
    background: var(--background-primary);
    padding: 6px 12px;
    transition: 0.4s;
}

select.custom-select option::checkmark {
    content: "✔️";
}

select.custom-select option:first-of-type {
    border-radius: 8px 8px 0 0;
}

select.custom-select option:last-of-type {
    border-radius: 0 0 8px 8px;
}

select.custom-select option:not(option:last-of-type) {
    border-bottom: none;
}

select.custom-select option:hover,
select.custom-select option:focus {
    background: var(--background-secondary);
}

select.custom-select.xl{
    height: 48px;
    padding: 12px 24px;
    border-radius: 16px;
}

select.custom-select.l{
    height: 36px;
    padding: 8px 16px;
    border-radius: 12px;
}

select.custom-select.m{
    height: 32px;
    padding: 8px 12px;
    border-radius: 8px;
}