/* Reset de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Conteneur principal */
.dashboard-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

/* En-tête */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

header h1 {
    color: #2c3e50;
    font-size: 1.8em;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9em;
}

.btn:hover {
    background-color: #2980b9;
}

.clear-search {
    background-color: #e74c3c;
}

.clear-search:hover {
    background-color: #c0392b;
}

/* Barre de recherche et contrôles */
.search-and-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-container {
    flex: 1;
    min-width: 250px;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.per-page-selector select {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Résultats de recherche */
.search-results-info {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #495057;
}

/* En-tête du tableau */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-title {
    margin: 0;
    flex: 1;
    color: #2c3e50;
}

.table-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-info {
    color: #666;
    font-size: 0.9em;
}

/* Tableau */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f1f5f8;
}

/* Styles pour les prix */
.price-cell {
    white-space: nowrap;
    text-align: right;
    padding: 10px 15px;
}

.price-range {
    font-size: 0.8em;
    color: #666;
    margin-top: 2px;
}

.craft-price {
    font-weight: bold;
    color: #2196F3;
}

.no-price {
    color: #999;
    font-style: italic;
    display: block;
    text-align: center;
}

.price-cell > div {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Icônes */
.tooltip {
    position: relative;
    display: inline-block;
    margin-right: 5px;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9em;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.craftable-icon {
    color: #4CAF50;
    font-size: 1.2em;
}

.decomposable-icon {
    color: #F44336;
    font-size: 1.2em;
}

.icon-disabled {
    color: #cccccc;
    font-size: 1.2em;
    opacity: 0.6;
}

.tooltip + .tooltip {
    margin-left: 8px;
}

/* Pagination */
.pagination-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.page-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Messages sans résultats */
.no-results {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 10px;
    }

    .search-and-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        flex-wrap: wrap;
    }

    .search-form input[type="text"] {
        min-width: 100%;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .table-pagination {
        justify-content: center;
        order: -1;
        margin-bottom: 10px;
    }

    table th, table td {
        padding: 8px 10px;
        font-size: 0.9em;
    }
}

/* Styles pour la colonne bénéfice */
.profit-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.profit-percentage {
    font-weight: bold;
    font-size: 1em;
}

.profit-value {
    font-size: 0.8em;
    margin-top: 2px;
}

.profit-positive {
    color: #2ecc71; /* Vert */
}

.profit-negative {
    color: #e74c3c; /* Rouge */
}

/* Ajustement pour la largeur des colonnes de prix */
table th.price-cell,
table td.price-cell {
    min-width: 120px;
}

/* Style pour l'icône de données manquantes */
.fa-question-circle {
    color: #f39c12;
    font-size: 1.2em;
}