* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: calc(100vh - 40px);
}

header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.header-content {
    position: relative;
}

.language-selector {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 10px;
}

.lang-btn {
    padding: 8px 15px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background-color: white;
    color: #2575fc;
    font-weight: 600;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 5px;
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
}

.components-section {
    flex: 3;
    min-width: 300px;
    padding: 15px;
}

.summary-section {
    flex: 2;
    min-width: 300px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.section-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* Bouton pour ajouter un composant personnalisé */
.add-custom-component {
    margin-bottom: 20px;
    text-align: center;
}

.add-custom-btn {
    padding: 12px 20px;
    background-color: #9b59b6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.add-custom-btn:hover {
    background-color: #8e44ad;
    transform: translateY(-2px);
}

/* Section des composants personnalisés */
.custom-components-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

/* Composant personnalisable */
.custom-component-card {
    background-color: white;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #9b59b6;
    position: relative;
}

.custom-component-card h3 {
    color: #9b59b6;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-component-card h3 .component-number {
    background-color: #9b59b6;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
}

.custom-component-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.custom-component-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.custom-mass-input {
    width: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.custom-toggle-btn {
    padding: 8px 16px;
    background-color: #9b59b6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.custom-toggle-btn:hover {
    background-color: #8e44ad;
}

.custom-toggle-btn.selected {
    background-color: #27ae60;
}

.custom-toggle-btn.selected:hover {
    background-color: #219653;
}

.custom-price-display {
    text-align: right;
    font-size: 1.1rem;
    padding-top: 10px;
    border-top: 1px solid #eee;
    margin-top: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.remove-custom-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.remove-custom-btn:hover {
    background-color: #c0392b;
}

/* Animation de clignotement */
@keyframes blink {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(155, 89, 182, 0.7);
        border-color: #9b59b6;
    }
    50% { 
        box-shadow: 0 0 0 10px rgba(155, 89, 182, 0);
        border-color: #f1c40f;
    }
}

.custom-component-card.highlight {
    animation: blink 1s 3;
}

.component-card.highlight {
    animation: blink 1s 3;
}

/* Composants standards */
.component-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    margin-top: 20px;
}

.component-card {
    background-color: white;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #3498db;
    transition: transform 0.2s, box-shadow 0.2s;
}

.component-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.component-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.component-name {
    font-weight: 600;
    font-size: 1.2rem;
    color: #2c3e50;
}

.component-price {
    font-weight: bold;
    color: #27ae60;
    background-color: #eafaf1;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.component-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.mass-input {
    width: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.toggle-btn {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toggle-btn:hover {
    background-color: #2980b9;
}

.toggle-btn.selected {
    background-color: #27ae60;
}

.toggle-btn.selected:hover {
    background-color: #219653;
}

/* Tableau des composants ajoutés */
.added-components-table-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.added-components-table-container h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-wrapper {
    overflow-x: auto;
}

.added-components-table {
    width: 100%;
    border-collapse: collapse;
}

.added-components-table thead {
    background-color: #f8f9fa;
}

.added-components-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
}

.added-components-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

.added-components-table tbody tr:hover {
    background-color: #f8f9fa;
}

.added-components-table .component-name-cell {
    font-weight: 500;
}

.added-components-table .component-name-cell.custom {
    color: #9b59b6;
    font-weight: 600;
}

.added-components-table .mass-cell,
.added-components-table .price-cell {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.added-components-table .mass-cell {
    color: #3498db;
}

.added-components-table .price-cell {
    color: #27ae60;
}

.added-components-table .actions-cell {
    text-align: center;
}

.remove-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s;
}

.remove-btn:hover {
    background-color: #c0392b;
}

.edit-btn {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s;
    margin-right: 5px;
}

.edit-btn:hover {
    background-color: #2980b9;
}

.empty-table-message {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px !important;
}

/* Récapitulatif */
.summary-details {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.summary-item.total {
    border-bottom: none;
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
    padding-top: 15px;
    border-top: 2px solid #eee;
}

.summary-value {
    font-weight: 600;
}

.total-price {
    color: #e74c3c;
    font-size: 1.5rem;
}

.total-mass {
    color: #3498db;
}

/* Bouton de réinitialisation */
.reset-btn {
    width: 100%;
    padding: 15px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.reset-btn:hover {
    background-color: #c0392b;
}

/* Instructions */
.instructions {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.95rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .component-list {
        grid-template-columns: 1fr;
    }
    
    .custom-components-section {
        grid-template-columns: 1fr;
    }
    
    .language-selector {
        position: static;
        justify-content: center;
        margin-top: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .added-components-table {
        font-size: 0.9rem;
    }
    
    .added-components-table th,
    .added-components-table td {
        padding: 8px 10px;
    }
    
    .edit-btn,
    .remove-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}