* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0a0c0f;
    color: #e0e0e0;
    line-height: 1.6;
    padding: 20px;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(80, 60, 40, 0.15) 0%, transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(40, 60, 80, 0.15) 0%, transparent 40%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: linear-gradient(145deg, #14181f 0%, #0f1318 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 215, 100, 0.1) inset;
    padding: 25px;
    border: 1px solid #2a3340;
}

/* Header */
header {
    margin-bottom: 30px;
    border-bottom: 2px solid #2a3340;
    padding-bottom: 20px;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, #ffd966, #b380ff, transparent);
}

h1 {
    color: #ffd966;
    font-size: 2.2em;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 20px rgba(255, 217, 102, 0.3);
    letter-spacing: 1px;
    font-weight: 600;
}

/* Contrôles globaux */
.global-controls {
    background: rgba(10, 12, 16, 0.8);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #2a3745;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.server-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.server-selector label {
    font-weight: 600;
    color: #9aa9b9;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.server-selector select {
    background: linear-gradient(145deg, #1e2630, #151c24);
    color: #e0e0e0;
    border: 1px solid #3a4a5a;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    min-width: 150px;
}

.server-selector select:hover {
    background: linear-gradient(145deg, #25303d, #1e2630);
    border-color: #ffd966;
    box-shadow: 0 0 15px rgba(255, 217, 102, 0.2);
}

.server-selector select:focus {
    outline: none;
    border-color: #ffd966;
    box-shadow: 0 0 0 3px rgba(255, 217, 102, 0.1);
}

.btn-primary {
    background: linear-gradient(145deg, #ffd966, #e6b800);
    color: #0a0c10;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 0 #a67c00, 0 4px 15px rgba(255, 217, 102, 0.3);
    border: 1px solid #ffea9e;
    font-size: 14px;
}

.btn-primary:hover {
    background: linear-gradient(145deg, #ffe180, #ffc107);
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #a67c00, 0 8px 25px rgba(255, 217, 102, 0.5);
}

.btn-primary:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #a67c00;
}

.last-update {
    margin-top: 15px;
    font-size: 13px;
    color: #7a8a9a;
    text-align: right;
    font-style: italic;
}

/* Onglets de ressources */
.resource-tabs {
    display: flex;
    gap: 5px;
    margin-top: 25px;
    border-bottom: 2px solid #1e2630;
    padding-bottom: 0;
    flex-wrap: wrap;
}

.tab-btn {
    background: linear-gradient(145deg, #1a2129, #12171e);
    color: #9aa9b9;
    border: none;
    padding: 12px 28px;
    border-radius: 12px 12px 0 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #2a3340;
    border-bottom: none;
    margin-right: 2px;
    position: relative;
    overflow: hidden;
}

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

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

.tab-btn:hover {
    background: linear-gradient(145deg, #222c38, #1a2129);
    color: #ffd966;
    transform: translateY(-2px);
    border-color: #ffd966;
}

.tab-btn.active {
    background: linear-gradient(145deg, #2a3340, #1f2732);
    color: #ffd966;
    border-color: #ffd966;
    position: relative;
    box-shadow: 0 -2px 10px rgba(255, 217, 102, 0.2);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd966, #b380ff);
    border-radius: 2px;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin: 25px 0;
    border-radius: 16px;
    background: #0c1015;
    padding: 2px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border-radius: 16px;
    overflow: hidden;
    background: #0f141a;
}

/* ============================================
   COULEURS DES TIERS (corrigées)
   ============================================ */
.tier-T2 { background: linear-gradient(145deg, #3a2e1e, #2a2216); border-left: 5px solid #8b5a2b; }
.tier-T2 td:first-child { color: #b87c3a; font-weight: bold; text-shadow: 0 0 8px rgba(139, 90, 43, 0.5); }

.tier-T3 { background: linear-gradient(145deg, #1c3a1c, #142914); border-left: 5px solid #2e8b57; }
.tier-T3 td:first-child { color: #3cb371; font-weight: bold; text-shadow: 0 0 8px rgba(46, 139, 87, 0.5); }

.tier-T4 { background: linear-gradient(145deg, #1a3a4a, #122a35); border-left: 5px solid #1e6f9f; }
.tier-T4 td:first-child { color: #3498db; font-weight: bold; text-shadow: 0 0 8px rgba(30, 111, 159, 0.5); }

.tier-T5 { background: linear-gradient(145deg, #4a1e1e, #351515); border-left: 5px solid #b22222; }
.tier-T5 td:first-child { color: #cd5c5c; font-weight: bold; text-shadow: 0 0 8px rgba(178, 34, 34, 0.5); }

.tier-T6 { background: linear-gradient(145deg, #4a2e1a, #352213); border-left: 5px solid #d2691e; }
.tier-T6 td:first-child { color: #e67e22; font-weight: bold; text-shadow: 0 0 8px rgba(210, 105, 30, 0.5); }

.tier-T7 { background: linear-gradient(145deg, #4a4a1a, #353513); border-left: 5px solid #b8860b; }
.tier-T7 td:first-child { color: #f1c40f; font-weight: bold; text-shadow: 0 0 8px rgba(184, 134, 11, 0.5); }

.tier-T8 { background: linear-gradient(145deg, #3a3a4a, #2a2a35); border-left: 5px solid #b0c4de; }
.tier-T8 td:first-child { color: #e0e0e0; font-weight: bold; text-shadow: 0 0 8px rgba(176, 196, 222, 0.7); }

/* ============================================
   COULEURS DES ENCHANTEMENTS (corrigées)
   ============================================ */
.enchant-0 { color: #9aa9b9; } /* Gris pour .0 */
.enchant-1 { color: #3cb371; font-weight: 600; text-shadow: 0 0 10px rgba(60, 179, 113, 0.5); } /* Vert */
.enchant-2 { color: #3498db; font-weight: 600; text-shadow: 0 0 10px rgba(52, 152, 219, 0.5); } /* Bleu */
.enchant-3 { color: #9b59b6; font-weight: 700; text-shadow: 0 0 15px rgba(155, 89, 182, 0.7); } /* Violet */
.enchant-4 { color: #f1c40f; font-weight: 700; text-shadow: 0 0 15px rgba(241, 196, 15, 0.7); } /* Jaune */

/* En-têtes de colonnes */
th {
    background: linear-gradient(145deg, #1a212b, #121721);
    color: #ffd966;
    padding: 16px 10px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #ffd966;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #1e2630;
    transition: all 0.2s;
    color: #e0e0e0;
}

tr:hover td {
    filter: brightness(1.2);
    background: rgba(255, 217, 102, 0.05);
    transform: scale(1.002);
}

/* Inputs */
input[type="number"] {
    width: 110px;
    padding: 8px 12px;
    background: #0f141c;
    border: 2px solid #1e2a36;
    color: #e0e0e0;
    border-radius: 8px;
    text-align: right;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 13px;
}

input[type="number"]:focus {
    outline: none;
    border-color: #ffd966;
    box-shadow: 0 0 0 3px rgba(255, 217, 102, 0.1);
    background: #151e2a;
}

input[type="number"]::placeholder {
    color: #3a4a5a;
    font-weight: normal;
}

input[type="number"]:hover {
    border-color: #3a5a7a;
}

/* Profits */
.profit-positive {
    color: #5cd65c;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(92, 214, 92, 0.3);
}

.profit-negative {
    color: #ff6b6b;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

.margin {
    font-weight: 600;
}

/* Footer du tableau */
tfoot td {
    background: linear-gradient(145deg, #1a212b, #121721);
    font-weight: 700;
    border-top: 3px solid #ffd966;
    padding: 16px 8px;
}

.total-label {
    text-align: right;
    color: #ffd966;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.total-value {
    color: #5cd65c;
    font-size: 22px;
    font-weight: 800;
    text-shadow: 0 0 20px rgba(92, 214, 92, 0.5);
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 50px;
    background: rgba(10, 12, 16, 0.9);
    border-radius: 16px;
    margin: 20px 0;
}

.spinner {
    border: 4px solid #1e2630;
    border-top: 4px solid #ffd966;
    border-right: 4px solid #b380ff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 30px rgba(255, 217, 102, 0.3);
}

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

/* Status messages */
.api-status {
    padding: 12px 20px;
    border-radius: 10px;
    margin: 15px 0;
    font-weight: 500;
    text-align: center;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.api-status.info {
    background: rgba(59, 158, 255, 0.15);
    border-left: 4px solid #3b9eff;
    color: #b0e0ff;
    border: 1px solid rgba(59, 158, 255, 0.3);
}

.api-status.success {
    background: rgba(76, 175, 80, 0.15);
    border-left: 4px solid #4caf50;
    color: #a5d6a5;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.api-status.warning {
    background: rgba(255, 193, 7, 0.15);
    border-left: 4px solid #ffc107;
    color: #ffd966;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.api-status.error {
    background: rgba(244, 67, 54, 0.15);
    border-left: 4px solid #f44336;
    color: #ffaaaa;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        padding: 15px;
    }
    
    table {
        font-size: 12px;
    }
    
    input[type="number"] {
        width: 80px;
        padding: 6px;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .server-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-primary {
        margin-left: 0;
        width: 100%;
    }
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #0f141a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, #2a3745, #1e2630);
    border-radius: 10px;
    border: 2px solid #0f141a;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, #3a4a5a, #2a3745);
}

::-webkit-scrollbar-corner {
    background: #0f141a;
}
