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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #dae0e3; /* Couleur de fond - Gris très clair */
    min-height: 100vh;
    color: #043145; /* Couleur principale - Bleu foncé */
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: #043145; /* Couleur principale - Bleu foncé */
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(4, 49, 69, 0.3);
}

.header-logo {
    width: 80px;
    height: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: white;
}

.subtitle {
    font-size: 1.1rem;
    color: #9dadb5; /* Couleur secondaire - Gris-bleu */
}

.search-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 14px 24px;
    border: 2px solid #9dadb5; /* Couleur secondaire - Gris-bleu */
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    box-shadow: 0 2px 10px rgba(4, 49, 69, 0.1);
    outline: none;
    transition: all 0.3s ease;
    color: #043145; /* Couleur principale - Bleu foncé */
}

.search-input:focus {
    border-color: #f68428; /* Couleur d'accentuation - Orange */
    box-shadow: 0 4px 20px rgba(246, 132, 40, 0.2);
}

.search-input::placeholder {
    color: #9dadb5; /* Couleur secondaire - Gris-bleu */
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.term-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(4, 49, 69, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border-left: 4px solid #f68428; /* Couleur d'accentuation - Orange */
    height: fit-content;
    min-height: 150px;
}

.term-card:hover:not(.dragging) {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(4, 49, 69, 0.2);
    border-left-color: #043145; /* Couleur principale - Bleu foncé */
}

.term-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #043145; /* Couleur principale - Bleu foncé */
    margin-bottom: 15px;
    line-height: 1.3;
    border-bottom: 2px solid #f68428; /* Couleur d'accentuation - Orange */
    padding-bottom: 8px;
    padding-left: 30px; /* Espace pour le drag handle */
}

.term-definition {
    line-height: 1.6;
    color: #043145; /* Couleur principale - Bleu foncé */
    font-size: 0.95rem;
    margin: 0;
}

.term-category {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #9dadb5; /* Couleur secondaire - Gris-bleu */
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Bouton de suppression */
.delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f68428; /* Couleur d'accentuation - Orange */
    color: white;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.term-card:hover .delete-btn {
    display: flex;
}

.delete-btn:hover {
    background: #043145; /* Couleur principale - Bleu foncé */
    transform: scale(1.1);
}

/* Handle de drag */
.drag-handle {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 22px;
    height: 22px;
    cursor: grab;
    background: #9dadb5; /* Couleur secondaire - Gris-bleu */
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    z-index: 10;
    transition: all 0.3s ease;
}

.drag-handle:hover {
    background: #f68428; /* Couleur d'accentuation - Orange */
    transform: scale(1.1);
}

.drag-handle:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.drag-handle::before {
    content: '⋮⋮';
    line-height: 1;
    letter-spacing: -2px;
}

/* Styles pour le drag and drop */
.term-card.dragging {
    transition: none !important;
    position: fixed !important;
    z-index: 1000 !important;
    pointer-events: none !important;
    opacity: 0.9;
    box-shadow: 0 15px 35px rgba(4, 49, 69, 0.4);
    width: 350px;
    max-width: 350px;
    transform: rotate(3deg);
    border-left-color: #f68428; /* Couleur d'accentuation - Orange */
}

.term-card:not(.dragging) {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.2s ease;
}

.card-placeholder {
    background: rgba(157, 173, 181, 0.1); /* Couleur secondaire - Gris-bleu */
    border: 2px dashed #9dadb5; /* Couleur secondaire - Gris-bleu */
    border-radius: 15px;
    margin: 10px;
    transition: all 0.2s ease;
    min-height: 150px;
    width: 100%;
}

.no-results {
    text-align: center;
    color: #043145; /* Couleur principale - Bleu foncé */
    font-size: 1.2rem;
    margin-top: 50px;
    opacity: 0.6;
    grid-column: 1 / -1;
    padding: 40px;
    background: white;
    border-radius: 15px;
    border: 2px dashed #9dadb5; /* Couleur secondaire - Gris-bleu */
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 30px 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    .glossary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .term-card {
        padding: 20px;
    }
    
    .term-title {
        font-size: 1.1rem;
    }
    
    .term-definition {
        font-size: 0.9rem;
    }
    
    .drag-handle {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }
    
    .term-card.dragging {
        width: 300px;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 25px 10px;
        margin-bottom: 30px;
    }
    
    .header-logo {
        width: 60px;
        margin-bottom: 15px;
    }
    
    header h1 {
        font-size: 1.7rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .glossary-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .term-card {
        padding: 18px;
    }
    
    .term-title {
        font-size: 1rem;
        padding-left: 35px;
    }
    
    .term-definition {
        font-size: 0.85rem;
    }
    
    .drag-handle {
        width: 26px;
        height: 26px;
        font-size: 14px;
        top: 10px;
        left: 10px;
    }
    
    .delete-btn {
        width: 28px;
        height: 28px;
        font-size: 15px;
        top: 10px;
        right: 10px;
    }
    
    .term-card.dragging {
        width: 280px;
        max-width: 280px;
    }
}

/* Animations subtiles */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.term-card {
    animation: fadeIn 0.4s ease;
}

/* Effet de focus pour l'accessibilité */
.search-input:focus,
.delete-btn:focus,
.drag-handle:focus {
    outline: 3px solid #f68428; /* Couleur d'accentuation - Orange */
    outline-offset: 2px;
}

/* Footer */
footer {
    margin-top: 60px;
    padding: 30px 20px;
    background: #043145; /* Couleur principale - Bleu foncé */
    border-radius: 20px 20px 0 0;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(4, 49, 69, 0.15);
}

footer p {
    color: #9dadb5; /* Couleur secondaire - Gris-bleu */
    font-size: 0.95rem;
    margin: 0;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    header {
        background: #043145;
        color: white;
    }
    
    .search-section,
    .delete-btn,
    .drag-handle,
    footer {
        display: none;
    }
    
    .term-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
