/* Historical Page Styles */

.historical-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 40px;
}

@media (min-width: 1400px) {
    .historical-container {
        max-width: 98%;
        padding: 20px 40px;
    }
}

@media (min-width: 1800px) {
    .historical-container {
        max-width: 96%;
        padding: 20px 50px;
    }
}

@media (min-width: 2200px) {
    .historical-container {
        max-width: 2100px;
    }
}

/* Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,138,61,0.2);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.stat-box-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    word-break: break-word;
    max-width: 100%;
}

.stat-box-value.positive {
    color: #4caf50;
}

.stat-box-value.negative {
    color: #f44336;
}

.stat-box-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
}

.filter-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,138,61,0.3);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 13px;
    min-width: 130px;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #FF8A3D;
}

.filter-select option {
    background: #1a1a1b;
}

/* Monthly Breakdown */
.monthly-section {
    margin-bottom: 40px;
}

.monthly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,138,61,0.2);
}

.monthly-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    color: #fff;
}

.monthly-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
}

.monthly-stat {
    color: #888;
}

.monthly-stat span {
    color: #fff;
    font-weight: 600;
}

.monthly-stat.positive span {
    color: #4caf50;
}

.monthly-stat.negative span {
    color: #f44336;
}

/* Trades Table */
.trades-table-container {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
}

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

.trades-table th,
.trades-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.trades-table th {
    background: rgba(255,138,61,0.1);
    color: #FF8A3D;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.trades-table tbody tr {
    transition: background 0.2s;
}

.trades-table tbody tr:hover {
    background: rgba(255,138,61,0.05);
}

.trades-table .mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.trades-table .positive {
    color: #4caf50;
}

.trades-table .negative {
    color: #f44336;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-long {
    background: rgba(76,175,80,0.15);
    color: #4caf50;
    border: 1px solid rgba(76,175,80,0.3);
}

.badge-short {
    background: rgba(244,67,54,0.15);
    color: #f44336;
    border: 1px solid rgba(244,67,54,0.3);
}

.badge-win {
    background: rgba(76,175,80,0.15);
    color: #4caf50;
}

.badge-loss {
    background: rgba(244,67,54,0.15);
    color: #f44336;
}

.badge-be {
    background: rgba(255,193,7,0.15);
    color: #ffc107;
}

.chart-link {
    color: #FF8A3D;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.chart-link:hover {
    opacity: 1;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.loading i {
    font-size: 32px;
    color: #FF8A3D;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    color: #444;
    margin-bottom: 15px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 5px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 4px;
}

.view-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.view-btn.active {
    background: #FF8A3D;
    color: #fff;
}

.view-btn:hover:not(.active) {
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .historical-container {
        padding: 15px;
        max-width: 100%;
        margin: 0;
    }

    .trades-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
        width: calc(100% + 30px);
        scrollbar-width: thin;
        scrollbar-color: rgba(255,138,61,0.5) rgba(255,255,255,0.1);
    }
    
    .trades-table-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .trades-table-container::-webkit-scrollbar-track {
        background: rgba(255,255,255,0.1);
        border-radius: 3px;
    }
    
    .trades-table-container::-webkit-scrollbar-thumb {
        background: rgba(255,138,61,0.5);
        border-radius: 3px;
    }

    .trades-table {
        min-width: 1600px;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select {
        width: 100%;
    }

    .monthly-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-box-value {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .historical-container {
        padding: 15px 10px;
        max-width: 100%;
        margin: 0;
    }

    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-box {
        padding: 15px 10px;
    }
    
    .stat-box-value {
        font-size: 18px;
    }
    
    .stat-box-label {
        font-size: 9px;
    }

    .filter-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-label {
        width: 100%;
    }

    .filter-select {
        min-width: 100%;
        width: 100%;
        font-size: 14px;
    }

    .view-toggle {
        width: 100%;
    }

    .view-btn {
        flex: 1;
    }
    
    .monthly-stats {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .trades-table-container {
        margin: 0 -10px;
        padding: 0 10px;
        width: calc(100% + 20px);
    }
    
    .trades-table th,
    .trades-table td {
        padding: 10px 8px;
        font-size: 11px;
    }
    
    .trades-table th {
        font-size: 9px;
    }
}
