/**
 * Funding Rates List - Specific Styles
 * Additional styles for the Bitget funding rates list page
 */

/* Navigation Styles */
.navigation {
    margin: 20px 0;
    text-align: center;
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 15px;
}

.nav-link {
    display: inline-block;
    padding: 10px 20px;
    margin: 0 10px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.nav-link.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #c0392b;
}

/* Control Section */
.control-section {
    margin-bottom: 30px;
}

.control-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.control-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.control-card .card-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f2f6;
}

.control-card .card-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-right: 15px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #27ae60;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.toggle-label {
    font-weight: 500;
    color: #2c3e50;
    vertical-align: middle;
}

/* Filter Controls */
.filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.refresh-btn, .export-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.refresh-btn:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.export-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.export-btn:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

/* Table Enhancements */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-info {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.last-updated, .filtered-count {
    font-size: 14px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

/* Enhanced Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.data-table th {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #1a252f;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.data-table th.sortable:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.data-table th.sortable.sort-asc,
.data-table th.sortable.sort-desc {
    background-color: rgba(0, 123, 255, 0.15);
    color: #0056b3;
    font-weight: 600;
}

.data-table th.sortable .sort-indicator {
    color: #00d4ff;
    font-weight: bold;
    margin-left: 3px;
}

.data-table th.sortable::after {
    content: ' ⇅';
    opacity: 0.3;
    font-size: 0.8em;
    margin-left: 4px;
}

.data-table th.sortable:hover::after {
    opacity: 0.6;
}

.data-table th.sortable.sort-asc::after,
.data-table th.sortable.sort-desc::after {
    display: none; /* Hide default indicator when we have specific ones */
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

/* Cell Specific Styles */
.symbol-cell {
    font-weight: 600;
    color: #2c3e50;
}

.symbol-name {
    display: inline-block;
    padding: 4px 8px;
    background: #e3f2fd;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid #bbdefb;
}

.rate-cell {
    text-align: center;
}

.funding-rate {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    min-width: 80px;
    text-align: center;
}

.funding-rate.positive {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.funding-rate.negative {
    background: linear-gradient(135deg, #fde8e8, #f8d7da);
    color: #721c24;
    border: 1px solid #f1b2b7;
}

.time-cell {
    font-size: 12px;
    color: #6c757d;
}

/* Rate Bar */
.rate-bar-container {
    position: relative;
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.rate-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.rate-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 600;
    color: #2c3e50;
    z-index: 2;
}

/* Action Badge */
.action-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid currentColor;
    opacity: 0.9;
}

.action-badge.long {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.action-badge.short {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.action-badge.hold {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Row Categories */
.rate-high-positive {
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.05), transparent);
}

.rate-positive {
    background: linear-gradient(90deg, rgba(39, 174, 96, 0.05), transparent);
}

.rate-negative {
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.05), transparent);
}

.rate-high-negative {
    background: linear-gradient(90deg, rgba(155, 89, 182, 0.05), transparent);
}

/* Top Performers Section */
.top-performers-section {
    margin-top: 30px;
}

.performers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.performer-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.performer-card h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f2f6;
}

.performer-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.performer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.performer-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.performer-rank {
    font-weight: 700;
    color: #6c757d;
    font-size: 12px;
    min-width: 30px;
}

.performer-symbol {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin: 0 15px;
}

.performer-rate {
    font-weight: 700;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 10px;
    min-width: 70px;
    text-align: center;
}

.performer-rate.positive {
    background: #d4edda;
    color: #155724;
}

.performer-rate.negative {
    background: #f8d7da;
    color: #721c24;
}

.performer-rate.arbitrage {
    background: #fff3cd;
    color: #856404;
}

.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Exchange Selector Styles */
.exchange-selector {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exchange-selector:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.exchange-selector option {
    padding: 8px;
}

/* Exchange-specific colors */
.exchange-selector option[value="bitget"] {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
}

.exchange-selector option[value="mexc"] {
    background: linear-gradient(135deg, #00c896, #009973);
    color: white;
}

.exchange-selector option[value="bitunix"] {
    background: linear-gradient(135deg, #ff6b35, #cc5529);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .control-cards {
        grid-template-columns: 1fr;
    }
    
    .filter-controls {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-info {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
    
    .performers-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .refresh-btn, .export-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.loading .data-table tbody tr {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Status Indicators */
.status-badge.loading {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.status-badge.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.status-badge.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}
