* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
    height: auto;
}

body {
    font-family: sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: stretch;                     /* horizontal */
    justify-content: flex-start;            /* vertical */
    gap: clamp(7px, 1.4vw, 16px);
    padding: clamp(7px, 1.6vw, 16px);
    color: white;
      background-image: radial-gradient(
        circle at center,
        rgb(199, 192, 192) 1%,
        rgb(169, 169, 169) 20%,
        rgb(79, 79, 79) 60% );
}

:heading {              /*(mínimo, ideal, máximo) */
    font-size: clamp(0.7rem, 2.0vw, 1.4rem);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;            /* ocupa toda largura da tela */
    padding: 3px 25px;      /* Menu superior parte preta */
    background: #0f1115;
    border-bottom: 1px solid #1f2937;
    position: sticky;
    top: 0;
    z-index: 1000;
    left: 0;
}

/* centro (menu principal) */
.nav-center {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 25px;
}

.nav-center a {
    color: #ffffff;
    text-decoration: none;
    font-size: 18px;
    position: relative;
    padding: 6px 4px;
    transition: color 0.25s ease, transform 0.15s ease;
}

/* ativo (estilo app financeiro) */
.nav-center a.active {
    color: #00ff88;
    display: flex;
    transform: scale(0.92);
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.8);
}

/* hover */
.nav-center a:hover {
    color: #ffffff;
    transform: translateY(-2px);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

.nav-center a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, #00ff88, #00cfff);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-center a:hover::after {
    width: 100%;
}

.nav-center a.active::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
}

/* direita */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* search */
.nav-search {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #2d3748;
    background: #111827;
    color: #fff;
    font-size: 14px;
    margin: 0 0 0 5px;
}

.nav-search::placeholder {
    color: #6b7280;
}

/* Submenus */
.hamburger {
    display: none;
    font-size: 26px;
    cursor: pointer;
    color: white;
}

.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown > a {
    display: inline-block;
    padding: 6px 4px;
}

.submenu {
    display: none; /* 🔒 escondido inicialmente */
    position: absolute;
    background: #0f1115;
    list-style: none;
    padding: 10px;
    border-radius: 6px;
    top: 30px;
}

.submenu li {
    margin: 5px 0;
}

.submenu li a {
    white-space: nowrap; /* impede quebra de linha */
}

.submenu a {
    color: white;
    text-decoration: none;
    font-size: 14px;
}
/* FiM do Submenu */

h1, h2 {
    margin: 20px 0 5px 0;
    text-align: center;
}

.search-container {
    text-align: center;
    width: 100%;
    box-sizing: border-box; /* Garante que o padding não "estoure" a largura */
}

#status {
    font-size: 16px;
    color: #DC143C;
    padding: 20px;
    font-family: sans-serif;
    background: radial-gradient(
        rgb(127, 255, 212) 0%,
        rgb(102, 205, 170) 50%,
        rgb(97, 128, 128) 90% );
}

#etf-search {
    width: 100%;
    max-width: 250px;
    padding: 10px;
    margin: 5px 10px;
    border: 1px solid #7bff;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box; /* Essencial para manter a largura correta com padding */
}

#etf-search:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.25);
}

/* Container com responsividade */
.table-container {
    width: 100%;
    overflow: auto;
    position: relative;
    margin: 0 auto;
}

table {
    width: 100%;
    background: white;
    overflow: hidden;
    color: MidnightBlue;
    font-size: clamp(0.77rem, 0.8vw, 0.9rem);
    margin-top: 10px;
    position: relative;
    border-radius: 8px;
    border-collapse: separate;
    border-spacing: 0;
}

table thead th {        /* cabeçalho (th) de todas as tabelas */
    position: sticky;
    top: 0;
    z-index: 2;
    background: #BFF;
}

table td:first-child {
    position: sticky;   /* primeira coluna “grudar” */
    left: 0;            /* à esquerda quando  faz scroll */
    z-index: 1;         /* primeira coluna fique sobreposta às outras células quando rola o scroll*/
    background: white;  /* primeira coluna com fundo branco
                            para que o texto continue legível sobre outras células roladas */
}

.tableAcoes td:first-child {    /* primeira célula (<td>) de cada linha (<tr>) */
    width: 48px;                /* da segunda tabela tera 40px nos logos*/
    text-align: center;
}

table td:nth-child(2) {
    max-width: 200px;     /* Limitar largura máxima das colunas das tabelas */
    white-space: normal;
    word-wrap: break-word;
}

th {                            /* cabeçalho tabela */
    background-color: #BFF;
    color: MidnightBlue;
    text-transform: uppercase;
    font-size: clamp(0.75rem, 0.7vw, 0.8rem);
    letter-spacing: 0.5px;
    font-weight: bold;
}

td {
    transition: color 0.3s ease, background-color 0.3s ease;
}

td, th {
    padding: clamp(4px, 0.5vw, 8px);    /* espaçamento interno da célula */
    text-align: left;                       /* E (distância do conteúdo até a borda da célula).*/
    border-bottom: 1.5px solid #008080;
}

tr {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

tr:hover {                      /* passar mouse */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px #555;
}

#tabelaTickers td:nth-child(3),     /* Terceira coluna(Empresa) da Segunda Tabela*/
#tabelaTickers th:nth-child(3) {
    width: 150px;          /* Defina a largura que desejar      */
    max-width: 150px;      /* Limita para não esticar           */
    white-space: normal;   /* permite quebra de linha          */
    word-wrap: break-word; /* força a quebra se palavra for muito longa */
}

.price {
    font-weight: bold;
    color: #2e7d32;
}

.positive {
    color: #1b5e20;
    background-color: rgba(76, 175, 80, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.negative {
    color: #b71c1c;
    background-color: rgba(244, 67, 54, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}


/* -------- MOBILE COM TABELA NORMAL -------- */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .navbar {
        width: 100%;
        justify-content: space-between;
        padding: 10px 20px;
    }

     .nav-center {
        display: none;
        flex-direction: column;
        background: #0f1115;
        position: absolute;
        top: 100%;
        width: 100vw;
        height: 100vh;      /* ocupa tela inteira */
        left: 0;
        padding: 30px 0;
        gap: 20px;
        border-top: 1px solid #1f2937;
        z-index: 999;
        border-bottom: 2px solid #00ff88;
    }

     .nav-center a {
        font-size: clamp(20px, 5vw, 24px);
        width: 100%;
        text-align: center;
        padding: 12px 0;
    }

    .dropdown {
        flex-direction: column;
        width: 100%;
    }

    .submenu {
        position: static;
        width: 100%;
        text-align: center;
        background: #1a1d23;
        padding: 10px 0;
    }

    .submenu a {
        font-size: clamp(16px, 3.5vw, 20px);
        /* Fonte do submenu um pouco menor que o principal */
    }

    .nav-right {
        gap: 10px;
    }

    .nav-search {
        max-width: 150px; /* Diminui a busca para caber ao lado do hambúrguer se necessário */
    }

    .table-container {
        max-width: 100vw;
        overflow-x: auto;
    }

    table {
        min-width: 900px;  /* força scroll ao invés de quebrar layout */
    }

    th, td {
        padding: 8px 4px;
        font-size: 0.85rem;
        white-space: nowrap; /* evita quebra */
    }
}



/*--------MOBILE RESPONSIVO-------------------*/
@media (max-width: 600px) {
    .navbar {
        position: sticky;
        top: 0;
    }

    .nav-center {
        gap: 12px;
        justify-content: center;
    }

    .nav-center a {
        font-size: 14px;
    }

    .nav-right {
        display: none;
    }

    .nav-search {
        width: 100%;
        max-width: 300px;
    }
}



#rodape {
    background: linear-gradient(
        to bottom,
        #253036 0%,
        #1c140e 100%
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    width: 100%;
    padding: 12px;
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    color: #e2e8f0;
}

#rodape a {
    padding: 10px;
}

#rodape img {
    height: 30px;
    width: 24px;
    border-radius: 20%;
}

#rodape svg {
    height: 27px;
    width: 27px;
    border-radius: 30%;
}

.copyright {
    color: color: #e2e8f0;;
    padding: 5px 0 1px 5px;
}
