/* Profit History Modal Styles */
.profit-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: none;
    backdrop-filter: blur(10px);
}

.profit-history-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profit-history-modal-content {
    background: linear-gradient(135deg, var(--panel), #0a142f);
    border-radius: 20px;
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    max-height: 800px;
    border: 1px solid rgba(255,200,120,0.1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.profit-history-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.profit-history-modal-title {
    font-size: 1.8rem;
    color: var(--gold-1);
    font-weight: 700;
}

.profit-history-modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.profit-history-modal-close:hover {
    color: var(--gold-1);
    background: rgba(255,255,255,0.1);
}

.profit-history-modal-body {
    flex: 1;
    padding: 25px 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Filters Styles */
.profit-filters {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.filter-label {
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
}

.filter-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--gold-1);
}

.filter-btn.active {
    background: rgba(255, 216, 107, 0.1);
    color: var(--gold-1);
    border-color: var(--gold-1);
}

/* Table Styles */
.profit-table-container {
    flex: 1;
    overflow: auto;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.profit-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.profit-table th {
    background: rgba(255,255,255,0.05);
    color: var(--gold-1);
    font-weight: 600;
    padding: 15px 12px;
    text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
}

.profit-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--muted);
    font-size: 13px;
}

.profit-table tr:last-child td {
    border-bottom: none;
}

.profit-table tr:hover {
    background: rgba(255,255,255,0.03);
}

.profit-date {
    font-family: 'Courier New', monospace;
    direction: ltr;
    text-align: left;
}

.profit-currency {
    font-weight: 600;
    color: var(--gold-2);
}

.profit-amount.positive {
    color: var(--success);
    font-weight: 700;
}

.profit-amount.negative {
    color: var(--danger);
    font-weight: 700;
}

.type-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.type-badge.auto {
    background: rgba(77, 255, 145, 0.1);
    color: var(--success);
    border: 1px solid rgba(77, 255, 145, 0.3);
}

.type-badge.manual {
    background: rgba(110, 240, 255, 0.1);
    color: var(--neon);
    border: 1px solid rgba(110, 240, 255, 0.3);
}

.empty-message {
    text-align: center;
    color: var(--muted);
    padding: 40px !important;
    font-style: italic;
}

/* Summary Styles */
.profit-summary {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    flex-shrink: 0;
}

.summary-title {
    color: var(--gold-1);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 16px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.summary-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.summary-content {
    flex: 1;
}

.summary-label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.summary-value {
    color: var(--gold-1);
    font-weight: 700;
    font-size: 16px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .profit-history-modal-content {
        width: 98%;
        height: 90vh;
    }

    .profit-history-modal-body {
        padding: 20px;
    }

    .profit-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .filter-buttons {
        justify-content: center;
    }

    .profit-table {
        min-width: 500px;
    }

    .profit-table th,
    .profit-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .profit-history-modal-header {
        padding: 20px;
    }

    .profit-history-modal-title {
        font-size: 1.5rem;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        flex-direction: column;
    }

    .filter-btn {
        text-align: center;
    }
}