/* CSS pour les nouvelles catégories Itemdle */

/* Grid layout pour les nouvelles colonnes */
.itemdle-grid {
    display: grid;
    grid-template-columns: 
        minmax(120px, 1.5fr)  /* Nom */
        minmax(60px, 0.8fr)   /* Coût */
        minmax(80px, 1fr)     /* Prix */
        minmax(80px, 1fr)     /* Type */
        minmax(80px, 1fr)     /* Stat */
        minmax(50px, 0.7fr)   /* AD */
        minmax(50px, 0.7fr)   /* AP */
        minmax(50px, 0.7fr);  /* PV */
    gap: 8px;
    max-width: 1000px;
    margin: 2rem auto;
    padding: 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    
    /* Support pour les lignes de guess intégrées */
    align-items: stretch;
    grid-auto-rows: minmax(55px, auto);
    
    /* Espacement entre les headers et les résultats */
    row-gap: 4px;
}

/* Header spécialisé */
.itemdle-header-cell {
    background: linear-gradient(135deg, var(--primary-color), #4f61c7);
    color: white;
    padding: 12px 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(63, 81, 181, 0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

/* Cellules de données */
.itemdle-cell {
    background: var(--light-bg);
    border: 1px solid var(--border-color, #333);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    position: relative;
    color: var(--text-color);
    transition: all 0.3s ease;
    padding: 8px 4px;
    min-height: 50px;
    word-wrap: break-word;
}

/* Cellule nom (plus large) */
.itemdle-cell.item-name {
    font-weight: 700;
    color: var(--primary-color);
    justify-content: flex-start;
    padding: 8px 12px;
    text-align: left;
}

/* Status colors pour les cellules */
.itemdle-cell.correct {
    background: linear-gradient(135deg, var(--success-color, #4caf50), #66bb6a);
    color: white;
    animation: correctPulse 0.6s ease-in-out;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.4);
}

.itemdle-cell.incorrect {
    background: linear-gradient(135deg, var(--error-color, #f44336), #ef5350);
    color: white;
    animation: incorrectShake 0.6s ease-in-out;
    box-shadow: 0 0 12px rgba(244, 67, 54, 0.4);
}

.itemdle-cell.too-low {
    background: linear-gradient(135deg, var(--warning-color, #ff9800), #ffb74d);
    color: white;
    position: relative;
}

.itemdle-cell.too-low::after {
    content: '↑';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.itemdle-cell.too-high {
    background: linear-gradient(135deg, var(--info-color, #2196f3), #42a5f5);
    color: white;
    position: relative;
}

.itemdle-cell.too-high::after {
    content: '↓';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 4px rgba(0,0,0,0.5);
}

/* Lignes de guess */
.guess-row {
    display: contents;
}

.guess-row .itemdle-cell {
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    margin-top: 2px; /* Petit espacement par rapport aux headers */
}

.guess-row .itemdle-cell:hover {
    border-color: rgba(255,255,255,0.2);
    transform: scale(1.02);
}

.guess-row .itemdle-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.8s ease;
}

.guess-row .itemdle-cell.revealing::before {
    left: 100%;
}

/* Animations */
@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(76, 175, 80, 0.6); }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes cellReveal {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateY(-90deg);
    }
    50% {
        transform: scale(1.1) rotateY(0deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.itemdle-cell.revealing {
    animation: cellReveal 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-30px) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(50px) rotate(360deg);
        opacity: 0;
    }
}

/* Catégories spécifiques */
.category-tier {
    font-size: 0.75rem;
    font-weight: 700;
}

.category-role {
    font-size: 0.75rem;
    font-weight: 600;
}

.category-focus {
    font-size: 0.7rem;
    font-weight: 600;
}

.category-phase {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Couleurs par catégorie de coût */
.cost-Gratuit { border-left: 4px solid #9e9e9e; }
.cost-Basique { border-left: 4px solid #4caf50; }
.cost-Abordable { border-left: 4px solid #2196f3; }
.cost-Coûteux { border-left: 4px solid #ff9800; }
.cost-Légendaire { border-left: 4px solid #9c27b0; }
.cost-Mythique { border-left: 4px solid #f44336; }

/* Couleurs par tier */
.tier-Composant { color: #81c784; }
.tier-Intermédiaire { color: #64b5f6; }
.tier-Légendaire { color: #ba68c8; }
.tier-Bottes { color: #ffb74d; }
.tier-Consommable { color: #a1887f; }

/* Couleurs par rôle */
.role-Tank { color: #4caf50; }
.role-ADC { color: #f44336; }
.role-Mage { color: #3f51b5; }
.role-Support { color: #ffeb3b; }
.role-Jungle { color: #795548; }
.role-Utilitaire { color: #9e9e9e; }

/* Responsive design */
@media (max-width: 1200px) {
    .itemdle-grid {
        grid-template-columns: 
            minmax(100px, 1.2fr)  /* Nom */
            minmax(50px, 0.7fr)   /* Coût */
            minmax(70px, 0.9fr)   /* Prix */
            minmax(70px, 0.9fr)   /* Type */
            minmax(60px, 0.8fr)   /* Stat */
            minmax(40px, 0.6fr)   /* AD */
            minmax(40px, 0.6fr)   /* AP */
            minmax(40px, 0.6fr);  /* PV */
        gap: 6px;
    }
    
    .itemdle-header-cell,
    .itemdle-cell {
        font-size: 0.7rem;
        padding: 6px 4px;
    }
}

@media (max-width: 768px) {
    .itemdle-grid {
        grid-template-columns: 
            minmax(80px, 1fr)    /* Nom */
            minmax(40px, 0.6fr)  /* Coût */
            minmax(60px, 0.8fr)  /* Prix */
            minmax(60px, 0.8fr)  /* Type */
            minmax(50px, 0.7fr)  /* Stat */
            minmax(35px, 0.5fr)  /* AD */
            minmax(35px, 0.5fr)  /* AP */
            minmax(35px, 0.5fr); /* PV */
        gap: 4px;
        padding: 0.5rem;
    }
    
    .itemdle-header-cell,
    .itemdle-cell {
        font-size: 0.6rem;
        padding: 4px 2px;
        min-height: 40px;
    }
}

/* Containers pour les nouvelles sections */
.stats-container {
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color, #333);
    max-width: 800px;
}

.stats-container .correct-item-reveal {
    text-align: center;
}

.stats-container .correct-item-reveal h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.stats-container .item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    text-align: left;
}

.stats-container .detail-section {
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.stats-container .detail-section h4 {
    color: var(--secondary-color);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.stats-container .detail-section p {
    margin: 0.5rem 0;
    color: #ccc;
    line-height: 1.4;
}

.guess-history {
    margin: 2rem auto;
    max-width: 1200px;
}

.stats-table {
    margin: 1rem auto;
    max-width: 800px;
}

/* Headers avec tooltips */
.header-with-tooltip {
    position: relative;
    cursor: help;
}

.header-with-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.header-with-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    border: 4px solid transparent;
    border-top-color: rgba(0,0,0,0.9);
    z-index: 1000;
}