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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
}

.tier-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.tier {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tier:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.tier-label {
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 2.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.tier-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

.tier-label span {
    position: relative;
    z-index: 2;
}

.tier-label[data-rank="S"] {
    background: linear-gradient(135deg, #ff416c, #ff4757);
}

.tier-label[data-rank="A"] {
    background: linear-gradient(135deg, #ff9500, #ffb142);
}

.tier-label[data-rank="B"] {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
}

.tier-label[data-rank="C"] {
    background: linear-gradient(135deg, #5cb85c, #7bed9f);
}

.tier-label[data-rank="initial"] {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    font-size: 2rem;
}

.dropzone {
    flex: 1;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    min-height: 80px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 3px dashed transparent;
    transition: all 0.3s ease;
    position: relative;
}

.dropzone:hover {
    background: rgba(255, 255, 255, 1); 
}

.dropzone.drag-over {
    background: rgba(146, 160, 224, 0.1);
}

.dropzone[data-rank="initial"] {
    background: rgba(255, 255, 255, 0.98);
    flex-direction: row;
    align-items: flex-start;
    padding: 15px;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
}

.category-header {
    display: none;
}

.category-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
}

.item {
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: grab;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85rem;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

/* Adéquation Fonctionnelle - Bleu */
.item[data-category="functional"] {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

/* Performance - Vert */
.item[data-category="performance"] {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

/* Compatibilité - Cyan */
.item[data-category="compatibility"] {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 3px 10px rgba(6, 182, 212, 0.3);
}

/* Facilité d'utilisation - Violet */
.item[data-category="usability"] {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
}

/* Fiabilité - Orange */
.item[data-category="reliability"] {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.3);
}

/* Sécurité - Rouge */
.item[data-category="security"] {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

/* Maintenabilité - Jaune */
.item[data-category="maintainability"] {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    box-shadow: 0 3px 10px rgba(234, 179, 8, 0.3);
}

/* Portabilité - Rose */
.item[data-category="portability"] {
    background: linear-gradient(135deg, #ec4899, #db2777);
    box-shadow: 0 3px 10px rgba(236, 72, 153, 0.3);
}

/* Sécurité Opérationnelle - Indigo */
.item[data-category="safety"] {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

.item::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;
}

.item:hover::before {
    left: 100%;
}

.item:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.item.dragging {
    opacity: 0.5;
    transform: rotate(5deg) scale(1.1);
    z-index: 1000;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.highlight {
    animation: pulse 0.5s ease-in-out;
}

.details-panel {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 600px;
    width: 90%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.details-panel.visible {
    opacity: 1;
    visibility: visible;
}

.details-panel h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.details-panel p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.details-panel .category {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.legend {
    width: 250px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    height: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.legend h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
}

.legend-text {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .legend {
        width: 100%;
        margin-top: 20px;
    }
} 