/* listing.css - Styles pour la page de listing des données crypto */

/* === Variables CSS pour cohérence avec backtesting === */
:root {
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent-blue: #00d4ff;
  --accent-purple: #7b68ee;
  --accent-gold: #ffd700;
}

.listing-main-container {
    padding: 0 20px 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 0;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.page-title {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 2.2em;
}

.page-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1em;
    max-width: 600px;
    margin: 0 auto;
}

.search-section {
    margin: 30px 0;
}

.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.stats-section {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.stat-card {
    display: flex;
    align-items: center;
    /* Fond noir transparent comme backtesting */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    flex: 1;
    min-width: 250px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple), var(--accent-gold));
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    /* Pas d'animation sur la carte elle-même */
}

.stat-card:hover::before {
    opacity: 0.8;
    animation: borderRotate 0.5s linear;
    animation-fill-mode: forwards;
}

@keyframes borderRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(180deg); }
}

.stat-icon {
    font-size: 2em;
    color: var(--accent-blue);
    margin-right: 15px;
    transition: color 0.3s ease;
}

.stat-card:hover .stat-icon {
    color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 5px;
}

.crypto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.crypto-card {
    /* Fond noir transparent comme backtesting */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.crypto-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple), var(--accent-gold));
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.crypto-card:hover {
    transform: translateY(-8px);
    /* Pas d'animation sur la carte elle-même */
    box-shadow: 0 15px 35px rgba(0, 212, 255, 0.2);
}

.crypto-card:hover::before {
    opacity: 0.8;
    animation: borderRotate 0.5s linear;
    animation-fill-mode: forwards;
}

.crypto-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.crypto-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.crypto-card:hover .crypto-icon {
    background: linear-gradient(45deg, var(--accent-gold), var(--accent-blue));
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.crypto-info h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 1.3em;
}

.crypto-symbol {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
}

.crypto-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 15px 0;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stat-item-value {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--text-primary);
}

.stat-item-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-top: 5px;
}

.crypto-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-action {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

/* === AMÉLIORATIONS BACKTESTING === */

/* Assurer que le contenu reste au-dessus des animations */
.stat-card .stat-content,
.stat-card .stat-icon,
.crypto-card .crypto-header,
.crypto-card .crypto-info,
.crypto-card .crypto-stats,
.crypto-card .crypto-actions {
    position: relative;
    z-index: 2;
}

/* Modes spéciaux */
body.light-mode .stat-card,
body.light-mode .crypto-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 102, 204, 0.2);
    backdrop-filter: blur(5px);
}

body.light-mode .stat-card::before,
body.light-mode .crypto-card::before {
    background: linear-gradient(45deg, #0066cc, #6c5ce7, #f39c12);
}

body.dark-mode .stat-card,
body.dark-mode .crypto-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

/* Protection du texte pendant les animations */
.stat-card:hover .stat-content,
.stat-card:hover .stat-icon,
.crypto-card:hover .crypto-header,
.crypto-card:hover .crypto-info {
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    color: white;
    font-weight: 500;
}

/* Responsive amélioré */
@media (max-width: 768px) {
    .crypto-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }
    
    .stats-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .stat-card,
    .crypto-card {
        min-width: auto;
    }
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-state i {
    margin-bottom: 15px;
}

.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--error-color);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Responsive pour mobiles */
@media (max-width: 768px) {
    .listing-main-container {
        padding: 15px;
    }
    
    .page-title {
        font-size: 1.8em;
    }
    
    .stats-section {
        gap: 15px;
    }
    
    .stat-card {
        min-width: 200px;
        padding: 15px;
    }
    
    .crypto-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-container {
        margin: 0 10px;
    }
}

/* === GESTION DES DONNÉES CRYPTO === */
.crypto-management-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

/* 🔥 MODE LIGHT - Section de gestion */
body.light-mode .crypto-management-section {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.management-header h2 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.5em;
}

.management-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.management-actions .btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-gold), #ffb347);
    color: #333;
}

.management-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.management-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.crypto-management-table {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
}

/* 🔥 MODE LIGHT - Meilleure visibilité des bordures */
body.light-mode .crypto-management-table {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

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

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

/* 🔥 MODE LIGHT - Bordures visibles */
body.light-mode .management-table th,
body.light-mode .management-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.management-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-weight: 600;
    position: sticky;
    top: 0;
}

/* 🔥 MODE LIGHT - Header du tableau */
body.light-mode .management-table th {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    border-bottom: 2px solid rgba(0, 0, 0, 0.12);
}

.management-table td {
    color: var(--text-secondary);
    vertical-align: middle;
}

.loading-cell {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.crypto-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.status-complete {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

/* 🔥 MODE LIGHT - Status complet */
body.light-mode .status-complete {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-partial {
    background: rgba(255, 179, 71, 0.1);
    color: #ffb347;
    border: 1px solid rgba(255, 179, 71, 0.3);
}

/* 🔥 MODE LIGHT - Status partiel */
body.light-mode .status-partial {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-missing {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* 🔥 MODE LIGHT - Status manquant */
body.light-mode .status-missing {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.timeframes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.timeframe-tag {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    color: var(--text-secondary);
}

.crypto-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-download {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
}

.action-completed {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: white;
}

.action-delete {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .management-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .management-actions {
        justify-content: center;
    }
    
    .management-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .crypto-management-table {
        font-size: 0.9em;
    }
    
    .management-table th,
    .management-table td {
        padding: 10px 8px;
    }
}

/* === 🎯 SUPER BEAU BOUTON AJOUTER === */
.btn-add-token {
    position: relative;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    
    /* Dark mode - Dégradé vibrant */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-add-token::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-add-token:hover::before {
    left: 100%;
}

.btn-add-token:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-add-token:active {
    transform: translateY(0);
}

.btn-add-token i {
    font-size: 16px;
    transition: transform 0.3s;
}

.btn-add-token:hover i {
    transform: rotate(90deg);
}

/* 🔥 MODE LIGHT - Bouton Ajouter */
body.light-mode .btn-add-token {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

body.light-mode .btn-add-token:hover {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* === BOUTON SETTINGS === */
.btn-settings {
    padding: 12px;
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-settings:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: rotate(90deg);
}

body.light-mode .btn-settings {
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .btn-settings:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

/* === 🎯 MODAL AJOUTER TOKEN === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 🔥 MODE LIGHT - Overlay */
body.light-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.modal-content-wrapper {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(150, 150, 150, 0.6);
    animation: modalSlideUp 0.3s ease;
    overflow: hidden;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 🔥 MODE LIGHT - Modal */
body.light-mode .modal-content-wrapper {
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-bottom: 1px solid var(--border-color);
}

/* 🔥 MODE LIGHT - Header */
body.light-mode .modal-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header i {
    color: #667eea;
}

body.light-mode .modal-header i {
    color: #3b82f6;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body.light-mode .modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.modal-content-wrapper form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body.light-mode .form-input {
    background: #f9fafb;
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

#newTokenSymbol {
    text-transform: uppercase;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.form-hint i {
    margin-right: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: var(--card-bg);
    border-color: var(--text-secondary);
}

body.light-mode .btn-cancel {
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .btn-cancel:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.25);
}

.btn-submit {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

body.light-mode .btn-submit {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

body.light-mode .btn-submit:hover {
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}