/**
 * Trust2 — Currency Exchange (desktop table + mobile compact coin list)
 */

body.frontend-futuristic .fe-markets-section {
    position: relative;
    overflow: hidden;
}

/* Homepage: less top gap (was pt-110) */
body.frontend-futuristic .fe-markets-section.fe-markets-section--compact {
    padding-top: clamp(2rem, 4vw, 3rem) !important;
}

body.frontend-futuristic .fe-markets-section__decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    color: rgba(255, 255, 255, 0.06);
}

body.frontend-futuristic .fe-markets-bg__grid {
    width: 100%;
    height: 100%;
    animation: feMarketsGridDrift 55s linear infinite;
}

body.frontend-futuristic .fe-markets-bg__hex {
    position: absolute;
    right: -40px;
    bottom: 10%;
    width: min(280px, 50vw);
    height: auto;
    color: var(--color-primary);
    opacity: 0.5;
    animation: feMarketsHexSpin 40s linear infinite;
}

body.frontend-futuristic .fe-markets-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.45;
}

body.frontend-futuristic .fe-markets-bg__orb--1 {
    width: 420px;
    height: 420px;
    top: 8%;
    left: -8%;
    background: color-mix(in srgb, var(--color-primary) 30%, transparent);
    animation: feMarketsOrb 17s ease-in-out infinite;
}

body.frontend-futuristic .fe-markets-bg__orb--2 {
    width: 360px;
    height: 360px;
    bottom: 0;
    right: -5%;
    background: rgba(99, 102, 241, 0.16);
    animation: feMarketsOrb 21s ease-in-out infinite reverse;
}

body.frontend-futuristic .fe-markets-section .container {
    z-index: 1;
}

body.frontend-futuristic .fe-markets-section__top {
    margin-bottom: 1.75rem;
}

body.frontend-futuristic .fe-markets-section__head h2 {
    font-size: clamp(1.65rem, 2.5vw, 2.15rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.65rem;
}

body.frontend-futuristic .fe-markets-section__head p {
    max-width: 36rem;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--fe-muted);
}

/* CTA */
body.frontend-futuristic .fe-markets-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--color-primary) !important;
    border: 1.5px solid var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    box-shadow: 0 0 24px color-mix(in srgb, var(--color-primary) 15%, transparent);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.frontend-futuristic .fe-markets-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 32px color-mix(in srgb, var(--color-primary) 30%, transparent);
    color: var(--color-primary) !important;
}

/* Table shell + decor */
body.frontend-futuristic .fe-markets-table-wrap {
    position: relative;
    border-radius: 18px;
    padding: 1px;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--color-primary) 45%, transparent),
        rgba(255, 255, 255, 0.08) 40%,
        color-mix(in srgb, #6366f1 28%, transparent)
    );
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.45),
        0 0 60px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

body.frontend-futuristic .fe-markets-table__corner {
    position: absolute;
    width: 22px;
    height: 22px;
    color: color-mix(in srgb, var(--color-primary) 80%, #fff);
    opacity: 0.55;
    z-index: 5;
    pointer-events: none;
}

body.frontend-futuristic .fe-markets-table__corner--tl { top: 10px; left: 10px; }
body.frontend-futuristic .fe-markets-table__corner--br { bottom: 10px; right: 10px; }

body.frontend-futuristic .fe-markets-table__pulse {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48px;
    width: 100%;
    color: var(--color-primary);
    opacity: 0.25;
    pointer-events: none;
    z-index: 1;
}

body.frontend-futuristic .fe-markets-section .fe-markets-table.table-container {
    position: relative;
    z-index: 2;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    border-radius: 17px;
    background: linear-gradient(165deg, rgba(14, 20, 35, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
    backdrop-filter: blur(14px);
    -webkit-overflow-scrolling: touch;
}

/* Desktop: real table (main.css mobile rules disabled) */
body.frontend-futuristic .fe-markets-section .fe-markets-table__grid {
    width: 100%;
    min-width: 1080px;
    margin: 0;
    border-collapse: collapse;
}

body.frontend-futuristic .fe-markets-section .fe-markets-table__grid thead th {
    padding: 14px 14px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--color-primary) !important;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.35)) !important;
    border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 35%, var(--fe-border)) !important;
    white-space: nowrap;
}

body.frontend-futuristic .fe-markets-section .fe-markets-table__grid tbody td {
    padding: 14px 14px !important;
    font-size: 0.88rem !important;
    color: var(--fe-text) !important;
    vertical-align: middle !important;
    background: transparent !important;
    border-bottom: 1px solid var(--fe-border) !important;
    white-space: nowrap;
}

body.frontend-futuristic .fe-markets-section .fe-markets-table__grid tbody tr:hover td {
    background: color-mix(in srgb, var(--color-primary) 7%, transparent) !important;
}

body.frontend-futuristic .fe-markets-section .fe-markets-table__grid tbody tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

body.frontend-futuristic .fe-markets-section .amount,
body.frontend-futuristic .fe-markets-section .high p,
body.frontend-futuristic .fe-markets-section .low p,
body.frontend-futuristic .fe-markets-section .total_volume p,
body.frontend-futuristic .fe-markets-section .market-cap,
body.frontend-futuristic .fe-markets-section .total-supply {
    color: var(--fe-text) !important;
    font-weight: 600;
}

body.frontend-futuristic .fe-markets-section .rate p.positive { color: #2ebd85 !important; }
body.frontend-futuristic .fe-markets-section .rate p.negative { color: #ff5252 !important; }

body.frontend-futuristic .fe-markets-section .avatar--md {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--fe-border);
}

body.frontend-futuristic .fe-markets-section .our-currency-item .content h5 {
    color: var(--fe-text);
    font-size: 0.92rem;
    margin-bottom: 2px;
}

body.frontend-futuristic .fe-markets-section .our-currency-item .content span {
    color: var(--fe-muted);
    font-size: 0.76rem;
}

body.frontend-futuristic .fe-markets-section .fe-markets-table__grid thead th:last-child,
body.frontend-futuristic .fe-markets-section .fe-markets-table__grid tbody td:last-child {
    min-width: 12.5rem;
    white-space: normal !important;
    vertical-align: middle !important;
}

body.frontend-futuristic .fe-markets-section .action {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem;
    justify-content: flex-end;
    min-width: max-content;
}

body.frontend-futuristic .fe-markets-section .action .i-btn {
    flex-shrink: 0;
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 6px 12px;
    white-space: nowrap;
}

body.frontend-futuristic .fe-markets-section .fe-markets-btn--practice {
    color: var(--fe-text) !important;
    border: 1px solid var(--fe-border-strong) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

body.frontend-futuristic .fe-markets-section .fe-markets-btn--practice:hover {
    color: var(--color-primary) !important;
    border-color: color-mix(in srgb, var(--color-primary) 45%, var(--fe-border)) !important;
    background: color-mix(in srgb, var(--color-primary) 12%, transparent) !important;
}

/* Mobile: compact coin cards (no table) */
body.frontend-futuristic .fe-markets-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.65rem;
}

body.frontend-futuristic .fe-mcoin {
    border-radius: 14px;
    padding: 12px 12px 10px;
    background: linear-gradient(165deg, rgba(18, 26, 44, 0.95), rgba(8, 12, 22, 0.98));
    border: 1px solid var(--fe-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

body.frontend-futuristic .fe-mcoin__main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

body.frontend-futuristic .fe-mcoin__identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

body.frontend-futuristic .fe-mcoin__identity img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--fe-border);
    background: rgba(255, 255, 255, 0.06);
}

body.frontend-futuristic .fe-mcoin__identity strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fe-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.frontend-futuristic .fe-mcoin__identity small {
    display: block;
    font-size: 0.72rem;
    color: var(--fe-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.frontend-futuristic .fe-mcoin__quote {
    flex-shrink: 0;
    text-align: right;
}

body.frontend-futuristic .fe-mcoin__price {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--fe-text);
    line-height: 1.2;
}

body.frontend-futuristic .fe-mcoin__change {
    display: inline-block;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

body.frontend-futuristic .fe-mcoin__change.positive {
    color: #2ebd85;
    background: rgba(46, 189, 133, 0.12);
}

body.frontend-futuristic .fe-mcoin__change.negative {
    color: #ff5252;
    background: rgba(255, 82, 82, 0.12);
}

body.frontend-futuristic .fe-mcoin__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    padding: 8px 0 10px;
    border-top: 1px solid var(--fe-border);
    border-bottom: 1px solid var(--fe-border);
}

body.frontend-futuristic .fe-mcoin__stats > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

body.frontend-futuristic .fe-mcoin__stats span {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fe-muted);
    flex-shrink: 0;
}

body.frontend-futuristic .fe-mcoin__stats b {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--fe-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.frontend-futuristic .fe-mcoin__actions {
    display: flex;
    gap: 8px;
    padding-top: 10px;
}

body.frontend-futuristic .fe-mcoin__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.frontend-futuristic .fe-mcoin__btn--primary {
    color: var(--color-primary) !important;
    border: 1.5px solid var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}

body.frontend-futuristic .fe-mcoin__btn--ghost {
    color: var(--fe-text) !important;
    border: 1px solid var(--fe-border);
    background: rgba(255, 255, 255, 0.04);
}

body.frontend-futuristic .fe-mcoin__btn--full {
    flex: 1 1 100%;
}

@media (max-width: 991px) {
    body.frontend-futuristic .fe-markets-section .fe-markets-table-wrap {
        border-radius: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    body.frontend-futuristic .fe-markets-section .fe-markets-table.table-container {
        background: transparent;
        backdrop-filter: none;
    }

    body.frontend-futuristic .fe-markets-cta {
        width: 100%;
    }

    /* Homepage: match trade page mobile card width (was narrowed by .full--width) */
    body.frontend-futuristic #currency-exchange .fe-markets-mobile {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    body.frontend-futuristic #currency-exchange .fe-mcoin {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 767px) {
    body.frontend-futuristic .fe-markets-section.fe-markets-section--compact {
        padding-top: 2.5rem !important;
        padding-bottom: 4rem !important;
    }
}

@keyframes feMarketsGridDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(48px, 48px); }
}

@keyframes feMarketsOrb {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -16px); }
}

@keyframes feMarketsHexSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    body.frontend-futuristic .fe-markets-bg__grid,
    body.frontend-futuristic .fe-markets-bg__orb,
    body.frontend-futuristic .fe-markets-bg__hex {
        animation: none !important;
    }
}
