/* ═══════════════ Trades Widget (Büyük İşlemler) ═══════════════ */

.trades-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ── Header ── */
.trades-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.trades-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trades-count {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: 8px;
    font-family: var(--font-mono);
}

/* ── Sütun Başlıkları ── */
.trades-columns {
    display: grid;
    grid-template-columns: 32px 40px 1fr 1fr 36px;
    gap: 4px;
    padding: 4px 10px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.trades-columns span {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trades-columns span:nth-child(4) {
    text-align: right;
}

.trades-columns span:nth-child(5) {
    text-align: right;
}

/* ── İşlem Listesi ── */
.trades-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

/* ── İşlem Satırı ── */
.trade-row {
    display: grid;
    grid-template-columns: 32px 40px 1fr 1fr 36px;
    gap: 4px;
    align-items: center;
    padding: 4px 10px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: opacity 0.3s;
    opacity: 0;
    animation: tradeSlideIn 0.3s ease forwards;
}

@keyframes tradeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trade-row:last-child {
    border-bottom: none;
}

/* Flash animasyonu — yeni işlem geldiğinde */
.trade-row.trade-flash {
    animation: tradeSlideIn 0.3s ease forwards, tradeFlash 0.6s ease;
}

@keyframes tradeFlash {
    0% {
        background: transparent;
    }

    30% {
        background: var(--trade-flash-color, rgba(255, 255, 255, 0.06));
    }

    100% {
        background: transparent;
    }
}

.trade-buy {
    --trade-flash-color: rgba(0, 214, 143, 0.12);
}

.trade-sell {
    --trade-flash-color: rgba(255, 61, 113, 0.12);
}

/* ── Exchange İkon ── */
.trade-exchange {
    display: flex;
    align-items: center;
    justify-content: center;
}

.trade-exchange-icon {
    opacity: 0.4;
    color: var(--text-muted);
}

.trade-exchange-logo {
    width: 14px;
    height: 14px;
    object-fit: contain;
    opacity: 0.7;
    filter: grayscale(30%);
}

.trade-tier-3 .trade-exchange-logo {
    opacity: 0.8;
}

.trade-tier-4 .trade-exchange-logo {
    opacity: 0.9;
    width: 15px;
    height: 15px;
}

.trade-tier-5 .trade-exchange-logo {
    opacity: 1;
    width: 16px;
    height: 16px;
    filter: none;
}

/* ── Yön (BUY/SELL) ── */
.trade-direction {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.trade-dir-buy {
    color: var(--color-success, #00d68f);
}

.trade-dir-sell {
    color: var(--color-danger, #ff3d71);
}

/* ── Fiyat ── */
.trade-price {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Miktar ── */
.trade-amount {
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
}

.trade-buy .trade-amount {
    color: var(--color-success, #00d68f);
}

.trade-sell .trade-amount {
    color: var(--color-danger, #ff3d71);
}

/* ── Süre ── */
.trade-time {
    font-size: 9px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-align: right;
}

/* ═══════════════ TIER KADEMELERİ ═══════════════ */

/* Tier 1 — Küçük (1-2x eşik) — Soluk */
.trade-tier-1 {
    min-height: 28px;
}

.trade-tier-1 .trade-amount,
.trade-tier-1 .trade-direction,
.trade-tier-1 .trade-price {
    opacity: 0.5;
}

.trade-tier-1 .trade-amount {
    font-size: 10px;
    font-weight: 500;
}

/* Tier 2 — Normal (2-5x eşik) */
.trade-tier-2 {
    min-height: 30px;
}

.trade-tier-2 .trade-amount,
.trade-tier-2 .trade-direction,
.trade-tier-2 .trade-price {
    opacity: 0.7;
}

.trade-tier-2 .trade-amount {
    font-size: 11px;
}

/* Tier 3 — Büyük (5-10x eşik) — Parlak */
.trade-tier-3 {
    min-height: 32px;
}

.trade-tier-3 .trade-amount,
.trade-tier-3 .trade-direction,
.trade-tier-3 .trade-price {
    opacity: 0.9;
}

.trade-tier-3 .trade-amount {
    font-size: 12px;
}

.trade-tier-3 .trade-exchange-icon {
    opacity: 0.6;
}

/* Tier 4 — Çok Büyük (10-25x eşik) — Parlak + Bold */
.trade-tier-4 {
    min-height: 36px;
}

.trade-tier-4 .trade-price {
    font-weight: 600;
    font-size: 12px;
}

.trade-tier-4 .trade-amount {
    font-size: 13px;
    font-weight: 700;
}

.trade-tier-4 .trade-direction {
    font-size: 11px;
}

.trade-tier-4 .trade-exchange-icon {
    opacity: 0.8;
}

/* Tier 4 alış/satış arka plan vurgusu */
.trade-tier-4.trade-buy {
    background: rgba(0, 214, 143, 0.06);
}

.trade-tier-4.trade-sell {
    background: rgba(255, 61, 113, 0.06);
}

/* ═══════════════ TIER 5 — WHALE ═══════════════ */
.trade-tier-5 {
    min-height: 48px;
    padding: 8px 10px;
    border-radius: 4px;
    margin: 2px 0;
    position: relative;
    z-index: 1;
}

.trade-tier-5 .trade-price {
    font-size: 14px;
    font-weight: 700;
}

.trade-tier-5 .trade-amount {
    font-size: 15px;
    font-weight: 800;
}

.trade-tier-5 .trade-direction {
    font-size: 12px;
    font-weight: 800;
}

.trade-tier-5 .trade-time {
    font-size: 10px;
}

.trade-tier-5 .trade-exchange-icon {
    opacity: 1;
}

/* Whale BUY */
.trade-tier-5.trade-buy {
    background: linear-gradient(135deg, rgba(0, 214, 143, 0.15) 0%, rgba(0, 214, 143, 0.05) 100%);
    border: 1px solid rgba(0, 214, 143, 0.25);
    box-shadow: 0 0 20px rgba(0, 214, 143, 0.1), inset 0 0 20px rgba(0, 214, 143, 0.03);
}

/* Whale SELL */
.trade-tier-5.trade-sell {
    background: linear-gradient(135deg, rgba(255, 61, 113, 0.15) 0%, rgba(255, 61, 113, 0.05) 100%);
    border: 1px solid rgba(255, 61, 113, 0.25);
    box-shadow: 0 0 20px rgba(255, 61, 113, 0.1), inset 0 0 20px rgba(255, 61, 113, 0.03);
}

/* Whale aktif animasyon efekti */
.trade-whale {
    animation: tradeSlideIn 0.3s ease forwards, whaleGlow 1.5s ease-in-out;
}

.trade-whale.trade-buy {
    animation: tradeSlideIn 0.3s ease forwards, whaleGlowBuy 1.5s ease-in-out;
}

.trade-whale.trade-sell {
    animation: tradeSlideIn 0.3s ease forwards, whaleGlowSell 1.5s ease-in-out;
}

@keyframes whaleGlowBuy {
    0% {
        box-shadow: 0 0 5px rgba(0, 214, 143, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(0, 214, 143, 0.3), 0 0 60px rgba(0, 214, 143, 0.1);
    }

    100% {
        box-shadow: 0 0 20px rgba(0, 214, 143, 0.1), inset 0 0 20px rgba(0, 214, 143, 0.03);
    }
}

@keyframes whaleGlowSell {
    0% {
        box-shadow: 0 0 5px rgba(255, 61, 113, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 61, 113, 0.3), 0 0 60px rgba(255, 61, 113, 0.1);
    }

    100% {
        box-shadow: 0 0 20px rgba(255, 61, 113, 0.1), inset 0 0 20px rgba(255, 61, 113, 0.03);
    }
}

/* ═══════════════ FALLING EMOJIS ANİMASYONU ═══════════════ */

.whale-emojis {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.whale-emoji {
    position: absolute;
    top: -20px;
    font-size: 14px;
    animation: emojifall 1s ease-in forwards;
    opacity: 0.7;
    filter: saturate(1.2);
}

@keyframes emojifall {
    0% {
        transform: translateY(-10px) rotate(0deg) scale(0.5);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
        transform: translateY(5px) rotate(15deg) scale(1);
    }

    60% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(50px) rotate(40deg) scale(0.6);
        opacity: 0;
    }
}

/* ═══════════════ SCROLLBAR ═══════════════ */

.trades-list::-webkit-scrollbar {
    width: 4px;
}

.trades-list::-webkit-scrollbar-track {
    background: transparent;
}

.trades-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.trades-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ═══════════════ BOŞ DURUM ═══════════════ */

.trades-list:empty::after {
    content: 'İşlem bekleniyor...';
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
}

/* ═══════════════ MOBILE ═══════════════ */
@media (max-width: 768px) {
    .trades-columns {
        grid-template-columns: 28px 40px 1fr 1fr 40px;
        gap: 6px;
        padding: 6px 12px;
    }
    .trades-columns span {
        font-size: 10px;
    }

    .trade-row {
        grid-template-columns: 28px 40px 1fr 1fr 40px;
        gap: 6px;
        padding: 6px 12px;
        min-height: 36px;
    }

    .trade-price {
        font-size: 12px;
    }

    .trade-amount {
        font-size: 12px;
    }

    .trade-direction {
        font-size: 11px;
    }

    .trade-time {
        font-size: 10px;
    }

    .trade-exchange-logo {
        width: 16px;
        height: 16px;
    }

    /* Tier boyutları mobil */
    .trade-tier-1 { min-height: 34px; }
    .trade-tier-2 { min-height: 36px; }
    .trade-tier-3 { min-height: 38px; }
    .trade-tier-4 { min-height: 42px; }
    .trade-tier-5 { min-height: 52px; padding: 10px 12px; }

    .trade-tier-5 .trade-price { font-size: 15px; }
    .trade-tier-5 .trade-amount { font-size: 16px; }
    .trade-tier-5 .trade-direction { font-size: 13px; }
}