/*
 * Piyax Finance Plugin — Plugin CSS  v2.0.0
 * Bloomberg Terminal hissi — Pro Dashboard Tasarımı
 */

/* ── Terminal Protection ── */
body, html {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none; /* Metin seçmeyi engelle */
}
img { pointer-events: none; -webkit-user-drag: none; } /* Resim sürüklemeyi engelle */

/* ═══════════════════════════════════════════════════════════

/* ═══════════════════════════════════════════════════════════
   TICKER
═══════════════════════════════════════════════════════════ */
.piyax-ticker-wrap {
    overflow: hidden;
    position: relative;
}
.piyax-ticker-wrap::before,
.piyax-ticker-wrap::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 60px;
    z-index: 2;
    pointer-events: none;
}
.piyax-ticker-wrap::before { left: 0;  background: linear-gradient(to right, var(--bg3, #0f172a), transparent); }
.piyax-ticker-wrap::after  { right: 0; background: linear-gradient(to left,  var(--bg3, #0f172a), transparent); }

.piyax-ticker {
    display: flex;
    animation: piyax-ticker-scroll var(--piyax-ticker-speed, 80s) linear infinite;
    width: max-content;
    white-space: nowrap;
}
.piyax-ticker:hover { animation-play-state: paused; }

@keyframes piyax-ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.piyax-tick-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 12px;
    border-right: 1px solid var(--border, rgba(255,255,255,.08));
    white-space: nowrap;
    transition: background .2s;
}
.piyax-tick-name { color: var(--t3, #64748b); font-weight: 700; font-size: 11px; letter-spacing: .04em; }
.piyax-tick-val  { color: var(--t1, #f1f5f9); font-weight: 700; font-family: var(--fmono, monospace); transition: color .3s; }

@keyframes tickFlashUp {
    0%, 100% { color: var(--t1, #f1f5f9); }
    40%       { color: var(--piyax-up); text-shadow: 0 0 12px var(--piyax-up); }
}
@keyframes tickFlashDown {
    0%, 100% { color: var(--t1, #f1f5f9); }
    40%       { color: var(--piyax-dn); text-shadow: 0 0 12px var(--piyax-dn); }
}
.tick-flash-up   .piyax-tick-val { animation: tickFlashUp   .7s ease; }
.tick-flash-down .piyax-tick-val { animation: tickFlashDown .7s ease; }

/* ═══════════════════════════════════════════════════════════
   ROW FLASH
═══════════════════════════════════════════════════════════ */
@keyframes rowFlashUp {
    0%, 100% { background: transparent; }
    30%       { background: rgba(var(--piyax-up-rgb), 0.72); }
}
@keyframes rowFlashDown {
    0%, 100% { background: transparent; }
    30%       { background: rgba(var(--piyax-dn-rgb), 0.72); }
}
.piyax-flash-up   { animation: rowFlashUp   .8s ease; }
.piyax-flash-down { animation: rowFlashDown .8s ease; }

/* ═══════════════════════════════════════════════════════════
   PRO DASHBOARD WRAPPER
═══════════════════════════════════════════════════════════ */
.piyax-pro-dashboard {
    width: 100%;
    font-family: var(--font, 'DM Sans', system-ui, sans-serif);
    color: var(--t1, #e2e8f0);
}

/* ── Dashboard Header ── */
.piyax-pro-header {
    margin-bottom: 24px;
    padding: 0 24px; /* Align with panels and fix 'stuck to left' issue */
}
.piyax-pro-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--piyax-accent);
    margin-bottom: 10px;
}
.piyax-pro-label-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--piyax-accent);
    animation: livePulse2 1.4s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes livePulse2 {
    0%, 100% { opacity: 1; transform: scale(1);    box-shadow: 0 0 0 0 rgba(var(--piyax-accent-rgb),.4); }
    50%       { opacity: .7; transform: scale(1.2); box-shadow: 0 0 0 5px transparent; }
}
.piyax-pro-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--t1, #f1f5f9);
    line-height: 1.2;
    margin: 0 0 8px;
}
.piyax-pro-title em {
    font-style: normal;
    color: var(--piyax-accent);
}
.piyax-pro-subtitle {
    font-size: 14px;
    color: var(--t3, #64748b);
    line-height: 1.6;
    max-width: 520px;
}
.piyax-live-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    margin-left: 2px; /* Slight extra push to ensure it doesn't feel stuck */
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(var(--piyax-accent-rgb),.08);
    border: 1px solid rgba(var(--piyax-accent-rgb),.2);
    font-size: 12px;
    font-weight: 600;
    color: var(--piyax-accent);
}
.piyax-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--piyax-accent);
    animation: livePulse2 1.4s ease-in-out infinite;
}

/* ── Tabs (Pro) ── */
.piyax-pro-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    padding-bottom: 0;
    flex-wrap: wrap;
}
.piyax-pro-tab {
    padding: 9px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--t3, #64748b);
    cursor: pointer;
    transition: color .2s, border-color .2s;
    margin-bottom: -1px;
    outline: none;
}
.piyax-pro-tab:hover { color: var(--t2, #94a3b8); }
.piyax-pro-tab.active {
    color: var(--piyax-accent);
    border-bottom-color: var(--piyax-accent);
}

/* ── Pro Grid ── */
.piyax-pro-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    align-items: start;
}
.piyax-pro-grid.single-col {
    grid-template-columns: 1fr;
}
@media (max-width: 960px) {
    .piyax-pro-grid { grid-template-columns: 1fr; }
}

/* ── Pro Panel Card ── */
.piyax-pro-panel {
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--rl, 18px);
    overflow: hidden;
    display: none;
    flex-direction: column;
}
.piyax-pro-panel.active { display: flex; }

.piyax-pro-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    border-bottom: none;
    flex-shrink: 0;
}
.piyax-pro-panel-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--piyax-accent);
}
.piyax-pro-panel-sub {
    font-size: 10px;
    color: var(--t3, #64748b);
    letter-spacing: .04em;
}
.piyax-pro-panel-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(var(--piyax-accent-rgb),.1);
    color: var(--piyax-accent);
    border: 1px solid rgba(var(--piyax-accent-rgb),.2);
}

/* ── Pro Table ── */
.piyax-pro-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 400px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
/* Webkit scrollbar — ince ve şık */
.piyax-pro-table-wrap::-webkit-scrollbar {
    width: 4px;
}
.piyax-pro-table-wrap::-webkit-scrollbar-track {
    background: transparent;
}
.piyax-pro-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.1);
    border-radius: 2px;
}
.piyax-pro-table-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.2);
}

.piyax-pro-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    min-width: 440px; /* Prevent crushing columns, but keep it manageable */
}
.piyax-pro-table thead th {
    padding: 10px 20px; /* Increased padding - text too close to left fix */
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(148,163,184,.5);
    text-align: left;
    border-bottom: none !important;
    position: sticky;
    top: 0;
    background: var(--bg3);
    backdrop-filter: blur(4px);
    z-index: 2;
    white-space: nowrap;
}
.piyax-pro-table thead th.align-right { text-align: right; }

.piyax-pro-table tbody tr {
    border-bottom: none !important;
    cursor: pointer;
    transition: background .12s;
}
.piyax-pro-table tbody tr:hover {
    background: rgba(0,229,153,.04);
}
.piyax-pro-table tbody tr:last-child { border-bottom: none !important; }

.piyax-pro-table tbody td {
    padding: 10px 20px; /* Increased padding - text too close to left fix */
    white-space: nowrap;
    vertical-align: middle;
}

/* Sembol & İsim sütunu */
.piyax-pro-sym {
    font-size: 12px;
    font-weight: 700;
    color: var(--t1, #f1f5f9);
    letter-spacing: .02em;
    display: block;
}
.piyax-pro-name {
    font-size: 10px;
    color: rgba(148,163,184,.5);
    display: block;
    margin-top: 1px;
}

/* Değer sütunları */
.piyax-pro-val {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--t2, #cbd5e1);
    font-family: var(--fmono, 'DM Mono', monospace);
    text-align: right;
}
.piyax-pro-val.buying { color: rgba(203,213,225,.7); }

/* Değişim sütunu */
.piyax-pro-chg {
    font-size: 12px;
    font-weight: 700;
    font-family: var(--fmono, monospace);
    text-align: right;
    white-space: nowrap;
    padding-right: 16px !important;
}
.piyax-pro-chg.up   { color: var(--piyax-up); }
.piyax-pro-chg.down { color: var(--piyax-dn); }

/* Ok sütunu */
.piyax-pro-arrow {
    text-align: center !important;
    width: 24px;
    color: rgba(148,163,184,.2);
    font-size: 14px;
    transition: color .15s;
}
.piyax-pro-table tbody tr:hover .piyax-pro-arrow {
    color: var(--piyax-accent);
}

/* Flag ikonları */
.piyax-pro-flag {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
    opacity: .85;
}
/* Coin ikonları */
.piyax-pro-coin-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 6px;
    vertical-align: middle;
}

/* ── Index / Stats Cards (BIST index satırı üstü) ── */
.piyax-pro-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-bottom: 1px solid var(--border2);
    flex-shrink: 0;
}
.piyax-pro-stat {
    padding: 12px 14px;
    border-right: 1px solid var(--border2);
    transition: background .15s;
}
.piyax-pro-stat:last-child { border-right: none; }
.piyax-pro-stat:hover { background: rgba(var(--piyax-accent-rgb),.03); }
.piyax-pro-stat-name {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(148,163,184,.5);
    margin-bottom: 4px;
}
.piyax-pro-stat-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--t1, #f1f5f9);
    font-family: var(--fmono, monospace);
    font-variant-numeric: tabular-nums;
}
.piyax-pro-stat-chg {
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
    font-family: 'Outfit', sans-serif;
}
.piyax-pro-stat-chg.up   { color: var(--piyax-up); }
.piyax-pro-stat-chg.down { color: var(--piyax-dn); }

/* ── Footer ── */
.piyax-pro-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border2);
    padding: 10px 16px;
    font-size: 11px;
    color: rgba(148,163,184,.4);
    margin-top: 16px;
}
.piyax-pro-footer-live {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--piyax-accent);
    font-weight: 600;
}

/* ── Tıklanabilir Satır ── */
.piyax-row-link { cursor: pointer; }

/* ── Flash Animasyonlar ── */
.piyax-pro-table tbody tr.piyax-flash-up   { animation: rowFlashUp   .8s ease; }
.piyax-pro-table tbody tr.piyax-flash-down { animation: rowFlashDown .8s ease; }
.piyax-pro-stat.piyax-flash-up   { animation: rowFlashUp   .8s ease; }
.piyax-pro-stat.piyax-flash-down { animation: rowFlashDown .8s ease; }

/* ── Boş Durum ── */
.piyax-pro-empty {
    padding: 32px 20px;
    text-align: center;
    font-size: 12px;
    color: rgba(148,163,184,.35);
    letter-spacing: .05em;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .piyax-pro-title  { font-size: 20px; }
    .piyax-pro-header { margin-bottom: 20px; }
    .piyax-pro-stats  { grid-template-columns: repeat(2, 1fr); }
    .piyax-pro-table-wrap { overflow-x: auto; overflow-y: hidden; width: 100%; -webkit-overflow-scrolling: touch; }
    .piyax-pro-table { min-width: 320px; font-size: 10.5px; }
    .piyax-pro-table thead th,
    .piyax-pro-table tbody td { padding: 8px 4px; }
    .piyax-pro-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
    .piyax-pro-sym { font-size: 11px; }
}
@media (max-width: 480px) {
    .piyax-pro-arrow, .piyax-th-hide-360 { display: none !important; }
    .piyax-mobile-hide { display: table-cell !important; }
    .piyax-pro-table { min-width: 100%; font-size: 10.5px; }
    .piyax-pro-table thead th,
    .piyax-pro-table tbody td { padding: 8px 4px; }
    .piyax-pro-name { font-size: 9px; max-width: 60px; opacity: 0.6; }
    .piyax-pro-sym { font-size: 10.5px; }
    .piyax-pro-val { font-size: 11.5px; letter-spacing: -0.02em; }
    .piyax-pro-chg { font-size: 11px; padding-right: 6px !important; }
}

/* ═══════════════════════════════════════════════════════════
   ESKİ STILLER (geriye dönük uyumluluk)
═══════════════════════════════════════════════════════════ */
.piyax-clickable-table { width: 100%; overflow-x: hidden; }
.piyax-clickable-table tbody tr.piyax-row-link { cursor: pointer; transition: background .15s; }
.piyax-clickable-table tbody tr.piyax-row-link:hover  { background: rgba(0,229,153,.05) !important; }
.piyax-flash-up {
    color: var(--piyax-up) !important;
    text-shadow: 0 0 10px rgba(34, 212, 122, 0.4);
    transition: none !important;
}
.piyax-flash-down {
    color: var(--piyax-dn) !important;
    text-shadow: 0 0 10px rgba(240, 79, 90, 0.4);
    transition: none !important;
}
.piyax-detail-arrow { color:var(--t3,#64748b); font-size:18px; text-align:center!important; width:28px; opacity:.5; transition:opacity .2s,color .2s; }
.piyax-row-link:hover .piyax-detail-arrow { opacity:1; color: var(--piyax-accent); }
.piyax-index-card.piyax-flash-up   { animation: rowFlashUp   .8s ease; }
.piyax-index-card.piyax-flash-down { animation: rowFlashDown .8s ease; }
.piyax-empty { color:var(--t3,#64748b); font-size:13px; padding:20px 0; }


/* ── "Tüm Piyasalar" sec-hdr başlığını gizle ── */
.container:has(.piyax-pro-dashboard) .sec-hdr,
.piyax-pro-dashboard ~ .sec-hdr,
.sec-hdr:has(+ .piyax-pro-dashboard) {
    display: none !important;
}

/* ── Tablo çizgileri tamamen kaldır ── */
.piyax-pro-table tbody tr,
.piyax-pro-table tbody tr:last-child,
.piyax-pro-table thead th { border-bottom: none !important; border-top: none !important; }

/* ══ TABLO ÇİZGİ KALDIR — KESİN OVERRIDE ══ */
.piyax-pro-table tr,
.piyax-pro-table td,
.piyax-pro-table th,
.piyax-pro-table tbody tr,
.piyax-pro-table tbody td,
.piyax-pro-table thead tr,
.piyax-pro-table thead th {
    border-bottom: none !important;
    border-top: none !important;
}
