/**
 * SkullTrading Trades - Styles CSS v1.2
 * Avec section soldes du portefeuille
 */

.skulltrading-trades-container {
    --st-bg-primary: #1a1a2e;
    --st-bg-secondary: #16213e;
    --st-bg-card: #0f0f1a;
    --st-text-primary: #ffffff;
    --st-text-secondary: #aaaaaa;
    --st-border: #333;
    --st-accent: #e94560;
    --st-green: #00d26a;
    --st-red: #ff4757;
    --st-orange: #ffa502;
    --st-blue: #3498db;
    --st-btc: #f7931a;
    
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--st-bg-primary);
    color: var(--st-text-primary);
    padding: 30px;
    border-radius: 16px;
    max-width: 1400px;
    margin: 20px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* EN-TÊTE */
.trades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--st-border);
}

.trades-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.trades-logo .skull-icon {
    font-size: 3em;
}

.trades-logo h2 {
    margin: 0;
    font-size: 1.8em;
    color: var(--st-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.last-update {
    font-size: 0.9em;
    color: var(--st-text-secondary);
    background: var(--st-bg-card);
    padding: 8px 16px;
    border-radius: 20px;
}

/* SECTION SOLDES */
.balances-section {
    margin-bottom: 30px;
}

.balance-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.balance-card {
    background: var(--st-bg-card);
    border: 2px solid var(--st-border);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.balance-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.balance-card.btc {
    border-color: var(--st-btc);
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.1) 0%, var(--st-bg-card) 100%);
}

.balance-card.usdt {
    border-color: var(--st-green);
    background: linear-gradient(135deg, rgba(0, 210, 106, 0.1) 0%, var(--st-bg-card) 100%);
}

.balance-card.total {
    border-color: var(--st-accent);
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.1) 0%, var(--st-bg-card) 100%);
}

.balance-icon {
    font-size: 3em;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--st-bg-secondary);
    border-radius: 50%;
}

.balance-card.btc .balance-icon {
    color: var(--st-btc);
}

.balance-card.usdt .balance-icon {
    color: var(--st-green);
}

.balance-card.total .balance-icon {
    color: var(--st-accent);
}

.balance-info {
    flex: 1;
}

.balance-label {
    font-size: 0.9em;
    color: var(--st-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.balance-value {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--st-text-primary);
    margin-bottom: 5px;
}

.balance-usd {
    font-size: 0.95em;
    color: var(--st-text-secondary);
}

/* GRAND COMPTEUR PnL */
.pnl-hero {
    background: linear-gradient(135deg, var(--st-bg-card) 0%, var(--st-bg-secondary) 100%);
    border: 3px solid var(--st-border);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.pnl-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--st-border);
}

.pnl-hero.positive::before {
    background: linear-gradient(90deg, var(--st-green), #00ff88);
}

.pnl-hero.negative::before {
    background: linear-gradient(90deg, var(--st-red), #ff6b6b);
}

.pnl-hero.positive {
    border-color: var(--st-green);
    box-shadow: 0 0 30px rgba(0, 210, 106, 0.2);
}

.pnl-hero.negative {
    border-color: var(--st-red);
    box-shadow: 0 0 30px rgba(255, 71, 87, 0.2);
}

.pnl-hero-label {
    font-size: 1.2em;
    color: var(--st-text-secondary);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
}

.pnl-hero-value {
    font-size: 4em;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 20px;
}

.pnl-hero.positive .pnl-hero-value {
    color: var(--st-green);
    text-shadow: 0 0 30px rgba(0, 210, 106, 0.5);
}

.pnl-hero.negative .pnl-hero-value {
    color: var(--st-red);
    text-shadow: 0 0 30px rgba(255, 71, 87, 0.5);
}

.pnl-hero-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: var(--st-text-secondary);
    font-size: 1.1em;
}

/* STATISTIQUES */
.trades-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--st-bg-card);
    border: 1px solid var(--st-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-card.positive {
    border-color: var(--st-green);
    background: rgba(0, 210, 106, 0.1);
}

.stat-card.negative {
    border-color: var(--st-red);
    background: rgba(255, 71, 87, 0.1);
}

.stat-label {
    font-size: 0.8em;
    color: var(--st-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.4em;
    font-weight: 700;
}

.stat-card.positive .stat-value {
    color: var(--st-green);
}

.stat-card.negative .stat-value {
    color: var(--st-red);
}

/* SECTIONS */
.trades-section {
    margin: 30px 0;
}

.trades-section h3 {
    font-size: 1.4em;
    color: var(--st-text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--st-border);
}

/* TABLEAU */
.trades-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--st-border);
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.trades-table th,
.trades-table td {
    padding: 14px 12px;
    text-align: center;
    border-bottom: 1px solid var(--st-border);
}

.trades-table th {
    background: var(--st-bg-secondary);
    color: var(--st-text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 1px;
}

.trades-table tbody tr {
    background: var(--st-bg-card);
    transition: background 0.2s ease;
}

.trades-table tbody tr:hover {
    background: var(--st-bg-secondary);
}

.trades-table tbody tr.positive {
    border-left: 3px solid var(--st-green);
}

.trades-table tbody tr.negative {
    border-left: 3px solid var(--st-red);
}

.trades-table td.buy,
.trades-table td.long {
    color: var(--st-green);
}

.trades-table td.sell,
.trades-table td.short {
    color: var(--st-red);
}

.trades-table td.pnl.positive {
    color: var(--st-green);
}

.trades-table td.pnl.negative {
    color: var(--st-red);
}

.trades-table td.sl {
    color: var(--st-red);
    opacity: 0.8;
}

.trades-table td.tp {
    color: var(--st-green);
    opacity: 0.8;
}

.trades-table tfoot tr.total-row {
    background: var(--st-bg-secondary);
    font-size: 1.1em;
}

.trades-table tfoot tr.total-row.positive td {
    color: var(--st-green);
}

.trades-table tfoot tr.total-row.negative td {
    color: var(--st-red);
}

.exit-reason {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
}

.exit-reason.take_profit {
    background: rgba(0, 210, 106, 0.2);
    color: var(--st-green);
}

.exit-reason.stop_loss {
    background: rgba(255, 71, 87, 0.2);
    color: var(--st-red);
}

.exit-reason.cancelled {
    background: rgba(255, 165, 2, 0.2);
    color: var(--st-orange);
}

/* NO TRADES */
.no-trades {
    text-align: center;
    padding: 40px;
    color: var(--st-text-secondary);
    background: var(--st-bg-card);
    border-radius: 12px;
}

.no-trades span {
    font-size: 3em;
    display: block;
    margin-bottom: 15px;
}

/* FOOTER */
.trades-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--st-border);
    text-align: center;
    font-size: 0.85em;
    color: var(--st-text-secondary);
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .trades-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    .balance-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .skulltrading-trades-container {
        padding: 20px 15px;
        margin: 10px;
    }
    
    .trades-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .balance-cards {
        grid-template-columns: 1fr;
    }
    
    .balance-card {
        padding: 20px;
    }
    
    .pnl-hero {
        padding: 25px;
    }
    
    .pnl-hero-value {
        font-size: 2.5em;
    }
    
    .pnl-hero-details {
        flex-direction: column;
        gap: 5px;
    }
    
    .trades-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trades-table {
        font-size: 0.75em;
    }
    
    .trades-table th,
    .trades-table td {
        padding: 8px 5px;
    }
}

/* ANIMATIONS */
@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(0, 210, 106, 0.3);
    }
    50% { 
        box-shadow: 0 0 40px rgba(0, 210, 106, 0.5);
    }
}

.pnl-hero.positive {
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow-red {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 71, 87, 0.3);
    }
    50% { 
        box-shadow: 0 0 40px rgba(255, 71, 87, 0.5);
    }
}

.pnl-hero.negative {
    animation: pulse-glow-red 3s ease-in-out infinite;
}
