/* =====================================================
   Binary Options Broker - Main Stylesheet
   Design inspirado na IQ Option
   ===================================================== */

:root {
    /* Cores Principais */
    --primary: #00C853;
    --primary-dark: #00A844;
    --secondary: #FF5252;
    --background: #1E1E2D;
    --background-light: #2D2D3D;
    --background-medium: #252536;
    --background-dark: #151521;
    --surface: #252536;
    --surface-light: #353548;
    
    /* Texto */
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0B0;
    --text-muted: #6E6E7E;
    
    /* Status */
    --success: #00C853;
    --danger: #FF5252;
    --warning: #FFB300;
    --info: #2196F3;

    /* Cores de alta/baixa do trading (candles, botões Comprar/Vender e linha da
       operação). Valores padrão de fallback — a customização feita no admin
       (Configurações → Cores do Gráfico) sobrescreve estas variáveis pelo
       markup de includes/trade-colors.php. */
    --trade-up: #00C853;
    --trade-down: #FF5252;
    --trade-up-rgb: 0, 200, 83;
    --trade-down-rgb: 255, 82, 82;
    
    /* Outros */
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --overlay: rgba(0, 0, 0, 0.7);
    
    /* Espaçamento */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Bordas */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transições */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* =====================================================
   Tema Escuro (Dark Theme) - Fundo Preto
   ===================================================== */
[data-theme="dark"] {
    --background: #000000;
    --background-light: #0a0a0a;
    --background-medium: #050505;
    --background-dark: #000000;
    --surface: #0a0a0a;
    --surface-light: #1a1a1a;
    --border: rgba(255, 255, 255, 0.08);
}

/* =====================================================
   Tema Claro (Light Theme) - Fundo Branco
   ===================================================== */
[data-theme="light"] {
    --background: #f5f5f5;
    --background-light: #ffffff;
    --background-medium: #eeeeee;
    --background-dark: #e0e0e0;
    --surface: #ffffff;
    --surface-light: #f0f0f0;
    
    /* Texto para tema claro */
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #6a6a6a;
    
    /* Bordas e sombras para tema claro */
    --border: rgba(0, 0, 0, 0.12);
    --shadow: rgba(0, 0, 0, 0.15);
    --overlay: rgba(0, 0, 0, 0.5);
}

/* Correções específicas para tema claro */
[data-theme="light"] .trading-header {
    background: #ffffff;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .account-switch-btn {
    color: #4a4a4a;
}

[data-theme="light"] .account-switch-btn.active {
    background: var(--primary);
    color: #000;
}

[data-theme="light"] .dropdown-menu {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .dropdown-item {
    color: #1a1a1a;
}

[data-theme="light"] .dropdown-item:hover {
    background: #f5f5f5;
}

[data-theme="light"] .dropdown-item i {
    color: #6a6a6a;
}

[data-theme="light"] .trading-balance-label {
    color: #6a6a6a;
}

[data-theme="light"] .card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .trading-sidebar {
    background: #ffffff;
    border-right-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .asset-item {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .asset-item:hover,
[data-theme="light"] .asset-item.active {
    background: #f5f5f5;
}

/* Avatar no tema claro */
[data-theme="light"] .avatar {
    background: #e0e0e0;
    color: var(--primary);
}

/* Form controls no tema claro */
[data-theme="light"] .form-control {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
}

[data-theme="light"] .form-control:focus {
    border-color: var(--primary);
    background: #ffffff;
}

/* Botões secundários no tema claro */
[data-theme="light"] .btn-secondary {
    background: #e0e0e0;
    color: #1a1a1a;
}

[data-theme="light"] .btn-secondary:hover {
    background: #d0d0d0;
}

/* Modal no tema claro */
[data-theme="light"] .modal {
    background: #ffffff;
}

/* Tabs no tema claro */
[data-theme="light"] .tabs {
    background: #e0e0e0;
}

[data-theme="light"] .tab {
    color: #6a6a6a;
}

[data-theme="light"] .tab.active {
    background: #ffffff;
    color: #1a1a1a;
}

/* Scrollbar para tema claro */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: #e0e0e0;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #c0c0c0;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Balance Dropdown para tema claro */
[data-theme="light"] .balance-dropdown-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .balance-dropdown-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(102, 126, 234, 0.4);
}

[data-theme="light"] .balance-dropdown.open .balance-dropdown-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: var(--primary);
}

[data-theme="light"] .balance-dropdown-label {
    color: #6a6a6a;
}

[data-theme="light"] .balance-dropdown-value {
    color: #1a1a1a;
}

[data-theme="light"] .balance-eye-icon,
[data-theme="light"] .balance-dropdown-btn i {
    color: #6a6a6a;
}

[data-theme="light"] .balance-dropdown-menu {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .balance-account-item {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .balance-account-item:hover {
    background: #eeeeee;
    border-color: rgba(102, 126, 234, 0.3);
}

[data-theme="light"] .balance-account-item.active {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
}

[data-theme="light"] .balance-account-label {
    color: #4a4a4a;
}

[data-theme="light"] .balance-account-value {
    color: #1a1a1a;
}

[data-theme="light"] .balance-dropdown-divider {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .balance-action-btn.secondary {
    background: #f0f0f0;
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] .balance-action-btn.secondary:hover {
    background: #e0e0e0;
    color: #1a1a1a;
}

[data-theme="light"] .balance-account-reset {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #6a6a6a;
}

[data-theme="light"] .balance-account-reset:hover {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.5);
    color: #e6a700;
}

/* Drawing Dock (Sidebar do gráfico) para tema claro */
[data-theme="light"] .drawing-dock {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .dock-group-btn {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.1);
    color: #4a4a4a;
}

[data-theme="light"] .dock-group-btn:hover,
[data-theme="light"] .dock-group.open .dock-group-btn {
    background: rgba(0, 200, 83, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="light"] .dock-submenu {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .dock-submenu-title {
    color: #1a1a1a;
}

[data-theme="light"] .dock-item {
    color: #4a4a4a;
}

[data-theme="light"] .dock-item:hover {
    background: #f0f0f0;
    color: #1a1a1a;
}

/*
 * Contêiner do gráfico, por tema.
 *
 * O fundo vem de `--surface` para acompanhar QUALQUER tema, inclusive os criados —
 * um tema criado não tem o atributo `data-theme`, então nenhuma destas duas regras
 * o alcança e ele ficaria com o `background: transparent` do `trade.php`. O valor
 * literal fica de fallback, e é o mesmo que cada tema de sistema já pintava.
 */
[data-theme="light"] .chart-container-wrapper {
    background: var(--surface, #ffffff) !important;
}

[data-theme="dark"] .chart-container-wrapper {
    background: var(--surface, #0a0a0a) !important;
}

[data-theme="light"] .chart-main {
    background: #f5f5f5;
}

/* Chart area e controles */
[data-theme="light"] .chart-header-bar {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .chart-zoom-controls {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .chart-zoom-btn {
    background: #f5f5f5;
    color: #4a4a4a;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .chart-zoom-btn:hover {
    background: #e0e0e0;
    color: #1a1a1a;
}

/* Assets tabs para tema claro */
[data-theme="light"] .assets-tabs-header {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .asset-tab {
    background: #f5f5f5;
    color: #4a4a4a;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .asset-tab.active {
    background: #ffffff;
    color: #1a1a1a;
    border-color: var(--primary);
}

[data-theme="light"] .add-asset-btn {
    background: #f5f5f5;
    color: #4a4a4a;
}

[data-theme="light"] .add-asset-btn:hover {
    background: var(--primary);
    color: #000;
}

/* Trade panel para tema claro */
[data-theme="light"] .trade-panel {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

/* Card de Pagamento (payout) - tema claro */
[data-theme="light"] .payout-display {
    background: linear-gradient(135deg, rgba(0, 150, 60, 0.07) 0%, rgba(0, 150, 60, 0.03) 100%);
    border-color: rgba(0, 150, 60, 0.18);
}

/* Card de Nível (level widget) - tema claro */
[data-theme="light"] .level-widget {
    background: linear-gradient(135deg, rgba(100, 100, 220, 0.07) 0%, rgba(100, 100, 220, 0.03) 100%);
    border-color: rgba(100, 100, 220, 0.18);
}

[data-theme="light"] .level-badge-name {
    color: #5B21B6;
}

[data-theme="light"] .level-info-btn {
    color: rgba(91, 33, 182, 0.5);
}

[data-theme="light"] .level-info-btn:hover {
    color: #5B21B6;
}

[data-theme="light"] .level-progress-fill {
    background: linear-gradient(90deg, #7C3AED, #5B21B6);
}

[data-theme="light"] .level-progress-bar {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .lm-title {
    color: #5B21B6;
}

[data-theme="light"] .lm-row-current {
    background: rgba(100, 100, 220, 0.06);
}

[data-theme="light"] .lm-name-current {
    color: #5B21B6;
}

[data-theme="light"] .lm-badge-current {
    background: rgba(91, 33, 182, 0.12);
    color: #5B21B6;
}

[data-theme="light"] .lm-infinity {
    color: #5B21B6;
}

[data-theme="light"] .level-progress-next {
    color: #5B21B6 !important;
}

[data-theme="light"] .toro-section {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .toro-section-header {
    border-color: rgba(0, 0, 0, 0.08);
}

/* Timer e indicadores */
[data-theme="light"] .expiry-timer-container {
    background: #f5f5f5;
}

[data-theme="light"] .current-price-display {
    background: #f5f5f5;
}

/* Painel flutuante de estilo de desenho para tema claro */
[data-theme="light"] .drawing-style-floating {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .floating-close-btn {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.1);
    color: #6a6a6a;
}

[data-theme="light"] .floating-close-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
}

[data-theme="light"] .style-control-btn {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.1);
    color: #4a4a4a;
}

[data-theme="light"] .style-control-btn:hover {
    background: #e0e0e0;
    color: #1a1a1a;
}

[data-theme="light"] .style-dropdown {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .style-dropdown-item {
    color: #1a1a1a;
}

[data-theme="light"] .style-dropdown-item:hover {
    background: #f5f5f5;
}

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

html {
    font-size: 13px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 13px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px;
}

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

/* =====================================================
   Utilitários
   ===================================================== */

.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-surface { background-color: var(--surface) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-danger { background-color: var(--danger) !important; }

.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }

.flex-1 { flex: 1; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.my-2 { margin-top: var(--spacing-md); margin-bottom: var(--spacing-md); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }

/* =====================================================
   Componentes - Botões
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    color: #000;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #E53935;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--surface);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #000;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 14px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

/* Botões de Trade especiais */
.btn-call {
    background: linear-gradient(135deg, #00C853 0%, #00E676 100%);
    color: #000;
    font-size: 15px;
    padding: 20px 40px;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
}

.btn-call:hover {
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.6);
    transform: translateY(-2px);
}

.btn-put {
    background: linear-gradient(135deg, #FF5252 0%, #FF1744 100%);
    color: #fff;
    font-size: 15px;
    padding: 20px 40px;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.4);
}

.btn-put:hover {
    box-shadow: 0 6px 20px rgba(255, 82, 82, 0.6);
    transform: translateY(-2px);
}

/* =====================================================
   Componentes - Inputs
   ===================================================== */

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--background-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control.error {
    border-color: var(--danger);
}

.form-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: var(--spacing-xs);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23A0A0B0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* =====================================================
   Componentes - Cards
   ===================================================== */

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}


/* =====================================================
   Componentes - Modal
   ===================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 15px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 17px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

/* =====================================================
   Componentes - Tabela
   ===================================================== */

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

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--surface-light);
}

/* =====================================================
   Componentes - Badge
   ===================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(0, 200, 83, 0.15);
    color: var(--success);
}

.badge-danger {
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
}

.badge-warning {
    background: rgba(255, 179, 0, 0.15);
    color: var(--warning);
}

.badge-info {
    background: rgba(33, 150, 243, 0.15);
    color: var(--info);
}

.badge-secondary {
    background: var(--surface-light);
    color: var(--text-secondary);
}

/* Status de Ativos no Modal */
.asset-row-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.asset-row-status.available {
    background: rgba(0, 200, 83, 0.15);
    color: var(--success);
}

.asset-row-status.unavailable {
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
}

/* Linha de ativo desabilitada no modal */
#assetModalList tr.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

#assetModalList tr.disabled:hover {
    background: transparent;
}

/* =====================================================
   Componentes - Tabs
   ===================================================== */

.tabs {
    display: flex;
    gap: 4px;
    background: var(--background-dark);
    padding: 4px;
    border-radius: var(--radius-md);
}

.tab {
    flex: 1;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--surface);
    color: var(--text-primary);
}

/* =====================================================
   Componentes - Avatar
   ===================================================== */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 17px; }
.avatar-xl { width: 80px; height: 80px; font-size: 28px; }

/* =====================================================
   Componentes - Dropdown
   ===================================================== */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--surface-light);
}

.dropdown-item i {
    width: 20px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* =====================================================
   Layout - Header Trading
   NOTA: Estilos movidos para includes/trading-header/trading-header.css
   ===================================================== */

/* Os estilos abaixo foram removidos para evitar conflito com trading-header.css */
/* .trading-header, .trading-logo, .header-asset-tabs, .trading-user agora estão em trading-header.css */

.trading-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.trading-nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.trading-nav-item:hover,
.trading-nav-item.active {
    color: var(--text-primary);
}

.trading-nav-item i {
    font-size: 14px;
}

.trading-balance {
    text-align: right;
}

.trading-balance-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.trading-balance-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

.trading-account-switch {
    display: flex;
    background: var(--background-dark);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.account-switch-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.account-switch-btn.active {
    background: var(--primary);
    color: #000;
}

/* =====================================================
   Layout - Trading Platform
   ===================================================== */

.trading-container {
    display: flex;
    height: calc(100vh - 60px);
}

/* Sidebar de Ativos */
.trading-sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.asset-search {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.asset-search input {
    width: 100%;
    padding: 10px 12px;
    padding-left: 36px;
    background: var(--background-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
}

.asset-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.asset-categories {
    display: flex;
    padding: var(--spacing-sm);
    gap: var(--spacing-xs);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.asset-category {
    padding: 6px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.asset-category:hover,
.asset-category.active {
    background: var(--surface-light);
    color: var(--text-primary);
}

.asset-list {
    flex: 1;
    overflow-y: auto;
}

.asset-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 12px var(--spacing-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border);
}

.asset-item:hover,
.asset-item.active {
    background: var(--surface-light);
}

.asset-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--background-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.asset-info {
    flex: 1;
}

.asset-name {
    font-weight: 600;
    font-size: 13px;
}

.asset-symbol {
    font-size: 11px;
    color: var(--text-muted);
}

.asset-price-info {
    text-align: right;
}

.asset-price {
    font-weight: 600;
    font-size: 13px;
    transition: color 0.3s ease;
}

.asset-price.price-up {
    color: var(--success) !important;
}

.asset-price.price-down {
    color: var(--danger) !important;
}

.asset-change {
    font-size: 11px;
}

.asset-change.positive { color: var(--success); }
.asset-change.negative { color: var(--danger); }

.asset-payout {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
}

/* Área Principal - Gráfico */
.trading-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.chart-asset-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.chart-asset-name {
    font-size: 15px;
    font-weight: 700;
}

.chart-asset-price {
    font-size: 17px;
    font-weight: 700;
}

.chart-asset-change {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.chart-asset-change.positive {
    background: rgba(0, 200, 83, 0.15);
    color: var(--success);
}

.chart-asset-change.negative {
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.chart-timeframe {
    display: flex;
    gap: 2px;
    background: var(--background-dark);
    padding: 2px;
    border-radius: var(--radius-sm);
}

.timeframe-btn {
    padding: 6px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.timeframe-btn:hover,
.timeframe-btn.active {
    background: var(--surface);
    color: var(--text-primary);
}

.chart-type-btn {
    padding: 8px 12px;
    background: var(--background-dark);
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-type-btn:hover,
.chart-type-btn.active {
    color: var(--text-primary);
}

/* Container do Gráfico */
.chart-container {
    flex: 1;
    position: relative;
    background: var(--background-dark);
    min-height: 200px; /* Reduced for smaller screens */
}

#tradingChart {
    width: 100%;
    height: 100%;
    min-height: 200px; /* Reduced for smaller screens */
}

/* Mobile: Remove fixed heights */
@media (max-width: 1024px) {
    .chart-container {
        min-height: 0 !important;
        flex: 1 1 0% !important;
    }
    
    #tradingChart {
        min-height: 0 !important;
    }
}

/* Painel de Trading */
.trading-panel {
    width: 320px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.trading-panel-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.trading-panel-body {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.trade-amount-section {
    margin-bottom: var(--spacing-lg);
}

.trade-amount-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.trade-amount-label span {
    font-size: 12px;
    color: var(--text-muted);
}

.trade-amount-input {
    display: flex;
    align-items: center;
    background: var(--background-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.trade-amount-input button {
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.trade-amount-input button:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.trade-amount-input input {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.trade-amount-input input:focus {
    outline: none;
}

.trade-quick-amounts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.quick-amount-btn {
    padding: 8px;
    background: var(--background-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-amount-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Tempo de Expiração */
.trade-time-section {
    margin-bottom: var(--spacing-lg);
}

.trade-time-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.trade-time-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-xs);
}

.time-option {
    padding: 10px;
    background: var(--background-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
}

.time-option:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.time-option.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

/* Informação de Payout */
.trade-payout-info {
    background: var(--background-dark);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.payout-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.payout-row:last-child {
    margin-bottom: 0;
}

.payout-label {
    color: var(--text-muted);
    font-size: 13px;
}

.payout-value {
    font-weight: 600;
    font-size: 13px;
}

.payout-value.highlight {
    color: var(--primary);
    font-size: 14px;
}

/* Botões de Trade */
.trade-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.trade-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.trade-btn-call {
    background: linear-gradient(135deg, #00C853 0%, #00E676 100%);
    color: #000;
}

.trade-btn-call:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
}

.trade-btn-put {
    background: linear-gradient(135deg, #FF5252 0%, #FF1744 100%);
    color: #fff;
}

.trade-btn-put:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.4);
}

.trade-btn-icon {
    font-size: 17px;
    margin-bottom: var(--spacing-xs);
}

.trade-btn-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.trade-btn-payout {
    font-size: 11px;
    opacity: 0.8;
}

/* Trades Abertas */
.open-trades-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

.open-trades-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.open-trades-count {
    background: var(--primary);
    color: #000;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
}

.open-trade-item {
    background: var(--background-dark);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.open-trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.open-trade-asset {
    font-weight: 600;
    font-size: 13px;
}

.open-trade-direction {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.open-trade-direction.call {
    background: rgba(0, 200, 83, 0.15);
    color: var(--success);
}

.open-trade-direction.put {
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
}

.open-trade-details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.open-trade-timer {
    display: flex;
    align-items: center;
    gap: 4px;
}

.open-trade-progress {
    height: 3px;
    background: var(--surface-light);
    border-radius: 2px;
    margin-top: var(--spacing-sm);
    overflow: hidden;
}

.open-trade-progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 1s linear;
}

/* =====================================================
   Responsividade
   ===================================================== */

@media (max-width: 1200px) {
    .trading-sidebar {
        width: 240px;
    }
    
    .trading-panel {
        width: 280px;
    }
}

@media (max-width: 992px) {
    .trading-sidebar {
        position: fixed;
        left: -280px;
        top: 60px;
        bottom: 0;
        z-index: 100;
        transition: left var(--transition-normal);
    }
    
    .trading-sidebar.open {
        left: 0;
    }
    
    .trading-panel {
        position: fixed;
        right: -320px;
        top: 60px;
        bottom: 0;
        z-index: 100;
        transition: right var(--transition-normal);
    }
    
    .trading-panel.open {
        right: 0;
    }
}

@media (max-width: 768px) {
    .trading-header {
        padding: 0 var(--spacing-md);
    }
    
    .trading-nav {
        display: none;
    }
    
    .trade-buttons {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Animações
   ===================================================== */

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-slide-in {
    animation: slideIn 0.3s ease forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* =====================================================
   Loading States
   ===================================================== */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--surface-light) 25%, var(--surface) 50%, var(--surface-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* =====================================================
   Toast de Notificações
   ===================================================== */

.toast-container {
    position: fixed;
    top: 80px;
    right: 10px;
    left: 10px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin-left: auto;
    pointer-events: none;
}

@media (min-width: 480px) {
    .toast-container {
        left: auto;
        right: 20px;
        width: calc(100vw - 40px);
    }
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
}

.toast-win .toast-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.toast-loss .toast-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.toast-tie .toast-icon {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.toast-warning .toast-icon {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: var(--background-dark);
    color: var(--text-primary);
}

.toast-win {
    border-left: 4px solid #22c55e;
}

.toast-loss {
    border-left: 4px solid #ef4444;
}

.toast-tie {
    border-left: 4px solid #9ca3af;
}

.toast-success {
    border-left: 4px solid #22c55e;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-warning {
    border-left: 4px solid #fbbf24;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

/* Animação de pulso para notificações importantes */
.toast-win .toast-icon,
.toast-loss .toast-icon {
    animation: pulse-icon 0.5s ease-in-out 2;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        max-width: none;
    }
}

/* SweetAlert2 acima do trading header */
.swal2-container {
    z-index: 3000000 !important;
    position: fixed !important;
}
