/* =============================================================
   Reset & base
   ============================================================= */
*, *:before, *:after {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #080808;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* =============================================================
   Layout raiz
   ============================================================= */
#app {
    display: -webkit-flex;
    display: flex;
    width: 100%;
    height: 100vh;
    min-height: 480px;
}

/* =============================================================
   Painel esquerdo
   ============================================================= */
.panel-left {
    width: 28%;
    min-width: 300px;
    max-width: 460px;
    background: #0a0a0a;
    border-right: 1px solid #1c1c1c;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    padding: 18px 16px;
    gap: 14px;
}

/* =============================================================
   Cards
   ============================================================= */
.card {
    background: #0f0f0f;
    border: 1px solid #1e1e1e;
    padding: 14px 16px;
}

.card-market {
    -webkit-flex: 1;
    flex: 1;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
}

/* Cabeçalho do card: badge + equalizer */
.card-label {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.label-badge {
    background: #cc0000;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
    padding: 3px 9px 3px 8px;
    white-space: nowrap;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

/* =============================================================
   Índices (cotações)
   ============================================================= */
.quotes-row {
    display: -webkit-flex;
    display: flex;
    gap: 0;
}

.quote-col {
    -webkit-flex: 1;
    flex: 1;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px 8px 0;
    border-right: 1px solid #1c1c1c;
}

.quote-col:last-child {
    border-right: none;
    padding-right: 0;
}

.quote-col:not(:first-child) {
    padding-left: 10px;
}

.quote-name {
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #ffffff;
}

.quote-change {
    display: inline-block;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

.quote-change.pos {
    background: rgba(0, 200, 60, 0.18);
    color: #00d43a;
}

.quote-change.neg {
    background: rgba(200, 0, 0, 0.18);
    color: #ff2828;
}

.quote-change.neu {
    background: rgba(120, 120, 120, 0.15);
    color: #888888;
}

.quote-value {
    font-size: 14px;
    font-weight: bold;
    color: #eeeeee;
    line-height: 1.2;
}

.quote-unit {
    font-size: 10px;
    font-weight: normal;
    color: #666666;
    margin-left: 2px;
}

.quote-update {
    margin-top: 12px;
    font-size: 10px;
    color: #444444;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border-top: 1px solid #181818;
    padding-top: 8px;
}

/* =============================================================
   Notícias
   ============================================================= */
.market-body {
    -webkit-flex: 1;
    flex: 1;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    padding: 8px 0;
}

.market-headline {
    font-size: 20px;
    font-weight: bold;
    line-height: 1.35;
    color: #ffffff;
    opacity: 1;
    -webkit-transition: opacity 0.4s ease;
    transition: opacity 0.4s ease;
}

.market-headline.fade {
    opacity: 0;
}

.market-source {
    font-size: 10px;
    color: #3d3d3d;
    text-align: right;
    margin-top: 10px;
    font-style: italic;
}

/* =============================================================
   Painel direito
   ============================================================= */
.panel-right {
    -webkit-flex: 1;
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #080808;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
}

/* =============================================================
   Slides
   ============================================================= */
.slides {
    position: relative;
    -webkit-flex: 1;
    flex: 1;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    -webkit-transform: translateX(36px);
    transform: translateX(36px);
    -webkit-transition: opacity 0.55s ease, -webkit-transform 0.55s ease;
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    -webkit-transform: translateX(0);
    transform: translateX(0);
}

.slide.leaving {
    opacity: 0;
    -webkit-transform: translateX(-36px);
    transform: translateX(-36px);
}

/* =============================================================
   Colunas (Altas / Baixas / Negociadas)
   ============================================================= */
.cols {
    display: -webkit-flex;
    display: flex;
    height: 100%;
}

.col {
    -webkit-flex: 1;
    flex: 1;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    padding: 18px 16px 14px;
    overflow: hidden;
}

.col-sep {
    width: 1px;
    background: #181818;
    margin: 18px 0;
}

.col-head {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2.5px;
    padding-bottom: 10px;
    margin-bottom: 4px;
    border-bottom-width: 2px;
    border-bottom-style: solid;
    white-space: nowrap;
}

.head-altas  { color: #22cc55; border-color: #22cc55; }
.head-baixas { color: #ff3030; border-color: #ff3030; }
.head-neg    { color: #d4a843; border-color: #d4a843; }

/* =============================================================
   Tabela de ranking
   ============================================================= */
.ranks {
    -webkit-flex: 1;
    flex: 1;
}

.ranks td {
    padding: 5px 4px;
    font-size: 13px;
    border-bottom: 1px solid #141414;
    white-space: nowrap;
}

.ranks tr:last-child td {
    border-bottom: none;
}

.ranks tr:hover td {
    background: rgba(255,255,255,0.03);
}

/* Colunas da tabela */
.td-rank {
    color: #3a3a3a;
    font-size: 11px;
    width: 30px;
    text-align: right;
    padding-right: 8px !important;
}

.td-ticker {
    color: #ffffff;
    font-weight: bold;
    font-size: 13px;
}

.td-change {
    font-weight: bold;
    font-size: 12px;
    text-align: right;
    width: 72px;
}

.td-change.pos { color: #22cc55; }
.td-change.neg { color: #ff3030; }
.td-change.neu { color: #555555; }

.td-price {
    color: #999999;
    font-size: 12px;
    text-align: right;
    width: 72px;
}

/* =============================================================
   Indicadores de página (dots)
   ============================================================= */
.page-dots {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    background: #080808;
    border-top: 1px solid #141414;
}

.pdot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2a2a2a;
    cursor: pointer;
    -webkit-transition: background 0.3s, -webkit-transform 0.3s;
    transition: background 0.3s, transform 0.3s;
}

.pdot:hover {
    background: #555555;
}

.pdot.active {
    background: #cc0000;
    -webkit-transform: scale(1.3);
    transform: scale(1.3);
}

/* =============================================================
   Animação de flash nos valores (atualização de dados)
   ============================================================= */
@-webkit-keyframes flash-pos {
    0%   { background: rgba(0, 212, 58, 0.35); }
    100% { background: transparent; }
}

@keyframes flash-pos {
    0%   { background: rgba(0, 212, 58, 0.35); }
    100% { background: transparent; }
}

@-webkit-keyframes flash-neg {
    0%   { background: rgba(255, 40, 40, 0.35); }
    100% { background: transparent; }
}

@keyframes flash-neg {
    0%   { background: rgba(255, 40, 40, 0.35); }
    100% { background: transparent; }
}

.flash-pos {
    -webkit-animation: flash-pos 0.8s ease-out forwards;
    animation: flash-pos 0.8s ease-out forwards;
}

.flash-neg {
    -webkit-animation: flash-neg 0.8s ease-out forwards;
    animation: flash-neg 0.8s ease-out forwards;
}

/* =============================================================
   Responsividade
   ============================================================= */
@media (max-width: 1400px) {
    .panel-left    { min-width: 260px; }
    .market-headline { font-size: 17px; }
    .col-head      { font-size: 11px; letter-spacing: 2px; }
    .ranks td      { font-size: 12px; padding: 4px 4px; }
    .td-price      { width: 64px; }
    .world-card-val { font-size: 18px; }
}

@media (max-width: 1100px) {
    .panel-left    { width: 32%; min-width: 240px; }
    .ranks td      { font-size: 11px; }
    .quote-name    { font-size: 11px; }
    .quote-value   { font-size: 12px; }
    .market-headline { font-size: 15px; }
}
