/* Container styles */
.trading-accounts-table {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

/* Base table styles */
.trading-accounts-grid {
    width: 100%;
    min-width: 1000px;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

/* Header styles */
.trading-accounts-grid thead th {
    background: #0014aa;
    color: #fff;
    padding: 12px 16px;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.trading-accounts-grid thead th:hover {
    background: #2d2d2d;
}

/* Sorting indicators */
.trading-accounts-grid thead th.sorting:after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(255, 255, 255, 0.3);
    margin-left: 10px;
    vertical-align: middle;
}

.trading-accounts-grid thead th.sorting_asc:after {
    border-bottom: 5px solid #fff;
}

.trading-accounts-grid thead th.sorting_desc:after {
    border-bottom: none;
    border-top: 5px solid #fff;
}

/* Row styles */
.trading-accounts-grid tbody tr {
    transition: background-color 0.2s;
}

.trading-accounts-grid tbody tr:nth-child(even) {
    background: #f8fafc;
}

.trading-accounts-grid tbody tr:hover {
    background: #f1f5f9;
}

/* Recent passed challenge highlighting */
.trading-accounts-grid tbody tr.recent-passed-challenge {
    background-color: rgba(0, 255, 127, 0.15) !important;
    border-left: 4px solid #00ff7f !important;
}

.trading-accounts-grid tbody tr.recent-passed-challenge:hover {
    background-color: rgba(0, 255, 127, 0.2) !important;
}

.trading-accounts-grid tbody tr.recent-passed-challenge.even,
.trading-accounts-grid tbody tr.recent-passed-challenge.odd {
    background-color: rgba(0, 255, 127, 0.15) !important;
}

/* Recent passed challenge track record link */
.trading-accounts-grid tbody tr td:last-child a {
    transition: color 0.2s;
}

.trading-accounts-grid tbody tr.recent-passed-challenge td:last-child a {
    color: #00b341 !important;
    font-weight: 600;
}

.trading-accounts-grid tbody tr.recent-passed-challenge td:last-child a:hover {
    color: #008f34 !important;
}

/* Protected row styles */
.protected-row td:not(.no-blur) {
    filter: blur(5px);
    user-select: none;
}

.protected-row td.initial-balance,
.protected-row td.track-record {
    filter: none;
}

.protected-row td.vip-message {
    filter: none;
}

.protected-row td.vip-message a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.protected-row td.vip-message a:hover {
    text-decoration: underline;
}

/* Cell styles */
.trading-accounts-grid td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* Footer/Totals styles */
.trading-accounts-grid tfoot {
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.trading-accounts-grid tfoot td {
    background: #1a1a1a;
    color: #fff;
    padding: 12px 16px;
    font-weight: 500;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Link styles */
.trading-accounts-grid a {
    color: #2d2d2d;
    text-decoration: none;
    transition: color 0.2s;
}

.trading-accounts-grid a:hover {
    color: #0073aa;
}

/* Profit/Loss colors */
.profit-positive {
    color: #0dc96b;
    font-weight: 500;
}

.profit-negative {
    color: #ff4444;
    font-weight: 500;
}

/* Right-aligned columns */
.dt-right {
    text-align: right !important;
}

/* DataTables specific styles */
.dataTables_wrapper {
    padding: 1rem;
}

.dataTables_filter {
    float: right;
    margin-bottom: 1em;
}

.dataTables_filter label {
    font-weight: normal;
    text-align: left;
    white-space: nowrap;
}

.dataTables_filter input {
    margin-left: 0.5em;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 300px;
    transition: all 0.2s;
}

.dataTables_filter input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.2);
}

/* Length menu styles */
.dataTables_length {
    margin-right: 20px;
}

.dataTables_length select {
    min-width: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 8px;
}

/* Pagination styles */
.dataTables_paginate {
    float: right;
    margin-top: 1em;
}

.dataTables_paginate .paginate_button {
    padding: 6px 12px;
    margin-left: 2px;
    border-radius: 4px;
    cursor: pointer;
    color: #2d2d2d;
    transition: all 0.2s;
}

.dataTables_paginate .paginate_button.current {
    background: #1a1a1a;
    color: #fff;
    border: none;
}

.dataTables_paginate .paginate_button:not(.current):hover {
    background: #f1f5f9;
}

.dataTables_paginate .paginate_button.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Info display */
.dataTables_info {
    padding-top: 0.85em;
    color: #666;
}

/* Loading state */
.trading-accounts-table.loading {
    position: relative;
}

.trading-accounts-table.loading:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .trading-accounts-table {
        margin: 1em -1rem;
        border-radius: 0;
    }

    .dataTables_filter {
        float: none;
        margin-bottom: 1em;
    }

    .dataTables_filter input {
        width: 100%;
        margin: 8px 0 0 0;
    }

    .dataTables_length {
        text-align: left;
        margin-bottom: 1em;
    }

    .dataTables_paginate {
        float: none;
        text-align: center;
        margin-top: 1em;
    }

    .dataTables_info {
        text-align: center;
    }
}