/* ============================================================
   Coins Wallet UI kit — uikit.css
   Основа перенесена из coinso: public/css/style.css (кабинет)
   и public/css/admin.css (админка). Tailwind подключается по CDN,
   здесь только то, чего в Tailwind нет.
   ============================================================ */

/* --- Скроллбары скрыты везде, «как в приложении» --- */
.no-scrollbar::-webkit-scrollbar { display: none !important; }
.no-scrollbar { -ms-overflow-style: none !important; scrollbar-width: none !important; }
*::-webkit-scrollbar { display: none !important; }
* { -ms-overflow-style: none !important; scrollbar-width: none !important; }

/* --- Нет обводок фокуса и подсветки тапа --- */
*, *:focus, *:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* --- Айфон: двойной тап не зумит, поле мельче 16px не зумит экран --- */
body, button, a, input, .method-item { touch-action: manipulation; }
@media (max-width: 767px) {
    input, select, textarea { font-size: 16px !important; }
}

/* --- Стеклянная карточка: фон #181818, скругление 30px --- */
.glass-card {
    background: rgba(24, 24, 24, 0.85);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border-radius: 30px;
    position: relative;
    border: none;
}

/* --- Кнопка: пилюля, 11/24, сжатие при нажатии --- */
.btn-custom {
    padding: 11px 24px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-custom:active {
    transform: scale(0.96);
    filter: brightness(0.9);
}
.btn-custom:disabled {
    opacity: .55;
    pointer-events: none;
}

/* --- Поля: плавная смена цвета, оранжевая рамка в фокусе --- */
input, select, textarea {
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
/* Поля без выделения при фокусе — ни рамки, ни кольца, ни свечения (владелец 17.10.2026).
   Было правило из coinso: оранжевая рамка у любого поля в фокусе. */

/* --- ApexCharts: тултипы в стиле проекта --- */
.apexcharts-tooltip.apexcharts-theme-dark {
    border: none !important;
    box-shadow: none !important;
    border-radius: 16px !important;
    background: #121212 !important;
}
.apexcharts-tooltip-title {
    border-bottom: none !important;
    font-weight: 500 !important;
    background: transparent !important;
}
.apexcharts-xaxistooltip {
    border: none !important;
    box-shadow: none !important;
    border-radius: 8px !important;
    background: #121212 !important;
    color: #fff !important;
}
.apexcharts-xaxistooltip:before,
.apexcharts-xaxistooltip:after { display: none !important; }
.apexcharts-tooltip-marker { width: 8px !important; height: 8px !important; }

/* --- Таблица → карточки на телефоне (data-label у td ставит JS) --- */
@media (max-width: 639px) {
    .mobile-cards-table { overflow-x: visible !important; }
    .mobile-cards-table table { display: block; width: 100%; padding: 0 16px; padding-bottom: 8px; }
    .mobile-cards-table thead,
    .mobile-cards-table tbody,
    .mobile-cards-table th,
    .mobile-cards-table td,
    .mobile-cards-table tr { display: block; width: 100%; }
    .mobile-cards-table thead { display: none; }
    .mobile-cards-table tbody { border-top: none !important; }
    .mobile-cards-table tr {
        margin-bottom: 12px;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.03);
        padding: 4px 16px;
        border-top: none !important;
        border-bottom: none !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    html:not(.dark) .mobile-cards-table tr {
        background: rgba(0, 0, 0, 0.02);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    }
    .mobile-cards-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0 !important;
        border: none !important;
        text-align: right;
        height: auto !important;
        width: 100% !important;
        min-height: min-content;
    }
    .mobile-cards-table td:not(:last-child) { border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important; }
    html:not(.dark) .mobile-cards-table td:not(:last-child) { border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important; }
    .mobile-cards-table td::before {
        content: attr(data-label);
        font-size: 9px;
        color: #9ca3af;
        text-transform: uppercase;
        font-weight: 600;
        margin-right: 16px;
        text-align: left;
        flex-shrink: 0;
    }
    .mobile-cards-table td > div {
        padding: 0 !important;
        text-align: right;
        display: flex;
        justify-content: flex-end;
        align-items: flex-end !important;
        flex-grow: 1;
        width: auto !important;
    }
    .mobile-cards-table td .text-sm { font-size: 12px !important; line-height: 16px !important; }
    .mobile-cards-table td .text-xs { font-size: 10px !important; line-height: 14px !important; }
    .mobile-cards-table td .size-6 { width: 20px !important; height: 20px !important; }
    .mobile-cards-table td .size-3\.5 { width: 12px !important; height: 12px !important; }
    .mobile-cards-table td .py-1 { padding-top: 2px !important; padding-bottom: 2px !important; }
    .mobile-cards-table tbody > tr ~ tr { border-top: none !important; margin-top: 12px !important; }
}

/* --- Лист модалки: высота по видимой части экрана --- */
.modal-sheet {
    position: relative;
    max-height: 90vh;
    min-height: 0;
}
@supports (max-height: 100svh) {
    .modal-sheet {
        max-height: calc(100svh - 16px - env(safe-area-inset-bottom, 0px));
        margin-bottom: env(safe-area-inset-bottom, 0px);
    }
}
@media (min-width: 768px) {
    .modal-sheet { max-height: 90vh; margin-bottom: 0; }
}

/* --- Затемнение гаснет вместе с цветом (Safari 26 красит зону под панелью) --- */
.fixed.inset-0.bg-black\/60[id$="-backdrop"] { transition-property: opacity, background-color; }
.fixed.inset-0.bg-black\/60.opacity-0:not(.opacity-100)[id$="-backdrop"] { background-color: rgb(0 0 0 / 0); }

/* --- Скроллящаяся середина листа --- */
.modal-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* --- Круглая кнопка «вниз» в длинных листах (ставит uikit.js) --- */
.modal-scroll-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 30;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: #2a2a2a;
    color: rgba(255, 255, 255, 0.75);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s, background 0.2s ease, color 0.2s ease;
}
.modal-scroll-hint.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s, background 0.2s ease, color 0.2s ease;
}
.modal-scroll-hint svg { width: 20px; height: 20px; }
.modal-scroll-hint:hover { background: #333333; color: #ffffff; }
.modal-scroll-hint:active { transform: scale(0.94); }

/* --- Шторки-модалки: телефон 400 мс по кривой iOS, ПК 300 мс (duration-300 в разметке).
       Закрытая шторка уезжает ниже своей высоты с запасом на отступ и safe-area. --- */
@media (max-width: 767px) {
    .fixed.inset-0 > .glass-card.transition-all.duration-300,
    .fixed.inset-0.bg-black\/60.duration-300[id$="-backdrop"] { transition-duration: 400ms !important; }
    .fixed.inset-0 > .glass-card.translate-y-full {
        transform: translateY(calc(100% + 24px + env(safe-area-inset-bottom, 0px))) !important;
    }
}
/* На ПК у открытого листа transform снят: иначе текст прыгает на полпикселя при перерисовке */
@media (min-width: 768px) {
    .fixed.inset-0 > .glass-card.modal-sheet.transform:not(.md\:scale-95) { transform: none; }
}

/* --- Выезжающий блок (поле хеша под статусом и т. п.) --- */
.ui-reveal {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    transition: max-height 0.32s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease, margin-top 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.ui-reveal.is-open {
    max-height: 160px;
    opacity: 1;
    margin-top: 0.75rem;
}

/* --- Аккордеон-группа (как USDT на форме оплаты): высота задаётся --open-height --- */
.stable-group-list {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
    transition: max-height .4s cubic-bezier(.32, .72, 0, 1), opacity .3s cubic-bezier(.32, .72, 0, 1), margin-top .4s cubic-bezier(.32, .72, 0, 1);
}
.stable-group.open .stable-group-list {
    max-height: var(--open-height, 800px);
    opacity: 1;
    margin-top: 10px;
}
.stable-group-chevron { transition: transform .4s cubic-bezier(.32, .72, 0, 1); }
.stable-group.open .stable-group-chevron { transform: rotate(90deg); }

/* --- Ошибка под кнопкой формы: выезжает сеткой 0fr → 1fr --- */
.ui-error-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 400ms cubic-bezier(0.25, 1, 0.5, 1);
}
.ui-error-wrap.is-open { grid-template-rows: 1fr; }
.ui-error-wrap > div { overflow: hidden; min-height: 0; }
.ui-error-wrap .ui-error-text {
    transform: translateY(-100%);
    transition: transform 400ms cubic-bezier(0.25, 1, 0.5, 1);
}
.ui-error-wrap.is-open .ui-error-text { transform: translateY(0); }

/* --- Меньше движения по просьбе системы --- */
@media (prefers-reduced-motion: reduce) {
    .modal-scroll-hint, .modal-scroll-hint.is-visible { transition: opacity 0.25s ease, visibility 0s; transform: none; }
    .ui-reveal { transition: opacity 0.2s ease; }
}

/* --- Только для страницы кита: блок с кодом --- */
.ui-demo-code {
    display: none;
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    background: #0e0e0e;
    color: #bdbdbd;
    font-size: 11.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ui-demo-code.is-open { display: block; }

/* --- Цвет при наведении меняется сразу, без перехода (владелец 20.10.2026: «моргает ховер-цвет»).
       У элементов с hover:bg-*, hover:text-*, hover:border-* (и group-hover:, dark:hover:) из перехода
       убраны цвета: при движении мыши по списку подсветка не гаснет и не вспыхивает заново. Сжатие
       при нажатии, прозрачность, тень и фильтр остаются плавными. html + атрибут — специфичнее
       утилит Tailwind (transition-colors, transition, transition-all), поэтому перекрывает их. --- */
html [class*="hover:bg-"], html [class*="hover:text-"], html [class*="hover:border-"] {
    transition-property: transform, opacity, box-shadow, filter;
}
