:root {
    --bg-color: #0b0e11;
    --card-bg: #1e2329;
    --sidebar-bg: #181a20;
    --text-primary: #eaecef;
    --text-secondary: #848e9c;
    --accent-color: #f0b90b;
    /* Binance Yellow for professional look */
    --accent-hover: #fcd535;
    --success-color: #0ecb81;
    --danger-color: #f6465d;
    --border-color: #2b3139;
    --glass-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

/* Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-list {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--card-bg);
    color: var(--accent-color);
}

.user-profile {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    max-width: 1400px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Cards & Panels */
.card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Grids */
.exchange-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    background: #2b3139;
    transition: background 0.2s;
}

.filter-label:hover {
    background: #363c44;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.coin-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.price-up {
    color: var(--success-color);
    font-weight: 500;
}

.price-down {
    color: var(--danger-color);
    font-weight: 500;
}

.spread-badge {
    background: rgba(14, 203, 129, 0.15);
    color: var(--success-color);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
    text-decoration: none;
    display: inline-block;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #000;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar.open {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .card {
        padding: 1rem;
    }
}

/* ==========================================================================
   ESTILOS DE LOGIN E REGISTRO (Adicione ao final do style.css)
   ========================================================================== */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    /* Fundo sutilmente degradê usando as cores do tema */
    background: radial-gradient(circle at top, #1e2329 0%, #0b0e11 100%);
}

.auth-box {
    width: 100%;
    max-width: 400px;
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease-out;
}

.auth-logo {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-logo i {
    color: var(--accent-color);
    font-size: 1.2em;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
    position: relative;
    /* Necessário para o ícone absoluto */
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Input estilizado */
.auth-form input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    /* Espaço na esquerda para o ícone */
    background-color: var(--bg-color);
    /* Fundo mais escuro que o card */
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

/* Ícones dentro do input */
.auth-form .form-group i {
    position: absolute;
    left: 1rem;
    top: 2.35rem;
    /* Ajuste fino para alinhar verticalmente */
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
}

.auth-form input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.15);
}

.auth-form button {
    width: 100%;
    padding: 0.9rem;
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.auth-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Animação suave de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   MODAL DE ESTATÍSTICAS
   ========================================================================== */

.stats-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.stats-modal-content {
    position: relative;
    background-color: var(--card-bg);
    margin: 2% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.stats-modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.stats-modal-close {
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.stats-modal-close:hover {
    color: var(--danger-color);
}

.stats-modal-info {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
}

.stats-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stats-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-value {
    font-size: 1rem;
    color: var(--accent-color);
    font-weight: 600;
}

.timeframe-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-color);
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.timeframe-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.timeframe-tab:hover {
    background: var(--card-bg);
    color: var(--text-primary);
}

.timeframe-tab.active {
    background: var(--accent-color);
    color: #000;
}

.profit-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-group h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profit-card {
    background: var(--bg-color);
    padding: 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s, border-color 0.2s;
}

.profit-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.profit-card.profit-max {
    border-left: 3px solid var(--success-color);
}

.profit-card.profit-min {
    border-left: 3px solid var(--danger-color);
}

.card-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profit-max .card-value {
    color: var(--success-color);
}

.profit-min .card-value {
    color: var(--danger-color);
}

.card-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chart-container {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.chart-container h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

#spreadChart {
    max-height: 300px;
}

/* Responsivo */
@media (max-width: 768px) {
    .stats-modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 5% auto;
    }

    .profit-cards {
        grid-template-columns: 1fr;
    }

    .stats-modal-info {
        flex-direction: column;
        gap: 1rem;
    }

    .timeframe-tabs {
        flex-wrap: wrap;
    }
}

/* Animação de pulse para badge NOVA */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 203, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(14, 203, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(14, 203, 129, 0);
    }
}

/* Badge NOVA */
.new-badge {
    background: #0ecb81;
    color: #0d1117;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 0.3rem;
    animation: pulse 1.5s infinite;
}

/* ==========================================================================
   MONITOR DE MOEDA EM TEMPO REAL - Modal Flutuante
   ========================================================================== */

.live-monitor {
    position: fixed;
    z-index: 2000;
    min-width: 380px;
    background: linear-gradient(135deg, #1a1d24 0%, #0d1117 100%);
    border: 1px solid #2b3139;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    resize: both;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.live-monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, rgba(240, 185, 11, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid #2b3139;
    cursor: move;
    user-select: none;
}

.live-monitor-header:active {
    cursor: grabbing;
}

.live-monitor-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-color);
}

.live-monitor-title img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.live-monitor-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: #0ecb81;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.live-monitor-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.live-monitor-close:hover {
    color: var(--danger-color);
}

.live-monitor-body {
    padding: 1rem;
}

.live-monitor-exchanges {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.live-exchange-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    border: 1px solid #2b3139;
}

.live-exchange-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.live-exchange-name {
    font-size: 0.75rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.live-exchange-price {
    font-size: 1.25rem;
    font-weight: 700;
}

.live-exchange-price.buy {
    color: #0ecb81;
}

.live-exchange-price.sell {
    color: #f6465d;
}

.live-spread-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.live-spread-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid #2b3139;
    position: relative;
    overflow: hidden;
}

.live-spread-box.positive {
    border-color: rgba(14, 203, 129, 0.3);
    background: rgba(14, 203, 129, 0.05);
}

.live-spread-box.negative {
    border-color: rgba(246, 70, 93, 0.3);
    background: rgba(246, 70, 93, 0.05);
}

.live-spread-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.live-spread-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.live-spread-value.positive {
    color: #0ecb81;
}

.live-spread-value.negative {
    color: #f6465d;
}

.live-spread-hint {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.live-spread-hint.positive {
    color: #0ecb81;
}

.live-spread-hint.negative {
    color: #f6465d;
}

.live-monitor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid #2b3139;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.live-monitor-actions {
    display: flex;
    gap: 0.5rem;
}

.live-monitor-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.live-monitor-btn.buy {
    background: #0ecb81;
    color: #0d1117;
}

.live-monitor-btn.buy:hover {
    background: #10e68c;
}

.live-monitor-btn.sell {
    background: #f6465d;
    color: #fff;
}

.live-monitor-btn.sell:hover {
    background: #ff5a70;
}

.live-update-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Mini gráfico de spread */
.live-spread-chart {
    height: 40px;
    margin-top: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    padding: 4px;
    gap: 2px;
}

.live-spread-bar {
    flex: 1;
    min-width: 4px;
    background: var(--accent-color);
    border-radius: 2px;
    transition: height 0.3s ease;
}

/* Controles de velocidade */
.live-speed-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.live-speed-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.live-speed-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #2b3139;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.live-speed-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.live-speed-btn.active {
    background: var(--accent-color);
    color: #0d1117;
    border-color: var(--accent-color);
}

.live-speed-btn.pause {
    padding: 0.3rem 0.5rem;
}

.live-speed-btn.pause.paused {
    background: #f6465d;
    color: #fff;
    border-color: #f6465d;
}

.live-speed-btn.pause.paused i::before {
    content: "\f04b";
    /* play icon */
}

/* Controles de velocidade do Scanner */
.scanner-speed-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.scanner-speed-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.scanner-speed-btn.active {
    background: var(--accent-color);
    color: #0d1117;
    border-color: var(--accent-color);
}

.scanner-speed-btn.pause {
    padding: 0.25rem 0.4rem;
}

.scanner-speed-btn.pause.paused {
    background: #f6465d;
    color: #fff;
    border-color: #f6465d;
}