/* Variables CSS pour un design moderne et élégant */
:root {
    /* Couleurs principales */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-rgb: 99, 102, 241;
    
    --secondary: #f59e0b;
    --secondary-dark: #d97706;
    --secondary-light: #fbbf24;
    
    /* Couleurs de fond */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    
    /* Couleurs de texte */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Couleurs d'état */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Autres */
    --border-color: rgba(148, 163, 184, 0.1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header moderne */
.header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-wrapper {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Sélecteur de langue personnalisé */
.language-selector {
    position: relative;
}

.language-selector-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
    min-width: 160px;
    height: 40px;
}

.language-selector-button:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.language-selector-button:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.language-flag {
    flex-shrink: 0;
}

.language-name {
    flex: 1;
    text-align: left;
}

.language-arrow {
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.language-selector.open .language-arrow {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 100;
}

.language-selector.open .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: var(--bg-hover);
    color: var(--primary);
    padding-left: 1.5rem;
}

.language-option.active {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary);
}

#resetBtn:hover {
    transform: rotate(-360deg);
}

/* Container principal */
.main-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    width: 100%;
}

/* Navigation principale */
.main-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.nav-btn {
    flex: 1;
    max-width: 300px;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.nav-icon {
    font-size: 1.25rem;
}

.nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(var(--primary-rgb), 0.3);
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--bg-secondary);
}

.nav-btn.disabled:hover {
    transform: none;
    background: var(--bg-secondary);
}

/* Tab content */
.tab-content {
    display: none;
    animation: fadeIn var(--transition-slow) ease-out;
}

.tab-content.active {
    display: block;
}

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

/* Configuration grid */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.config-section {
    display: flex;
    flex-direction: column;
}

/* Section cards */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    height: 100%;
    transition: all var(--transition-base);
}

.section-card:hover {
    box-shadow: var(--shadow-lg);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.subsection-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Search */
.search-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: var(--shadow-xl);
    z-index: 100;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-hover);
    color: var(--primary);
    padding-left: 1.5rem;
}

.search-result-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Recent items */
.recent-items {
    margin-bottom: 1.5rem;
}

.recent-items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recent-item-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.recent-item-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Selected item */
.selected-item {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.2);
}

.item-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    padding: 0.5rem;
}

.item-info {
    flex: 1;
}

.item-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.item-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Level selection */
.level-selection {
    margin-top: 1.5rem;
}

.level-selectors {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.level-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.level-selector label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.level-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    min-width: 100px;
}

.level-select:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.level-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.level-select option:disabled {
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.level-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    margin-top: 1.5rem;
}

/* Price sections */
.price-section {
    margin-bottom: 1.5rem;
}

.price-section:last-child {
    margin-bottom: 0;
}

.price-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.price-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition-base);
}

.price-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.price-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.price-item label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.price-input {
    width: 80px;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-align: right;
    font-weight: 500;
}

.price-input:focus {
    outline: none;
    border-color: var(--primary);
}

.currency {
    font-weight: 600;
    color: var(--primary);
    margin-left: 0.25rem;
}

/* Config actions */
.config-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px -2px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -2px rgba(var(--primary-rgb), 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-icon {
    font-size: 1.25rem;
}

/* Analysis header */
.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.analysis-title {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.analysis-levels {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--primary);
}

.export-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: 1px solid var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px -2px rgba(var(--primary-rgb), 0.3);
}

.export-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px -2px rgba(var(--primary-rgb), 0.4);
}

.export-btn:active {
    transform: translateY(0) scale(1);
}

/* Strategies summary - VERSION AMELIORÉE */
.strategies-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.strategy-card {
    background: linear-gradient(135deg, var(--bg-card), rgba(30, 41, 59, 0.7));
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.strategy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(var(--primary-rgb), 0.03));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.strategy-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.strategy-card:hover::before {
    opacity: 1;
}

.strategy-card.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    color: white;
    box-shadow: 0 10px 30px -5px rgba(var(--primary-rgb), 0.5);
}

.strategy-card.active::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 1;
}

/* Header de la carte */
.strategy-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1.25rem 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.strategy-card.active .strategy-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.strategy-icon {
    font-size: 1.25rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.strategy-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

/* Corps de la carte */
.strategy-body {
    padding: 1.25rem;
}

/* Statistiques principales */
.strategy-main-stats {
    margin-bottom: 1.25rem;
}

.main-stat {
    text-align: center;
}

.main-stat-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    opacity: 0.8;
}

.strategy-card:not(.active) .main-stat-label {
    color: var(--text-muted);
}

.main-stat-value {
    display: block;
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1;
}

.strategy-card:not(.active) .main-stat-value {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Détails de la stratégie */
.strategy-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Section de statistiques améliorée */
.stats-section {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.strategy-card.active .stats-section {
    background: rgba(255, 255, 255, 0.1);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.section-icon {
    font-size: 16px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
}

.strategy-card.active .section-title {
    color: rgba(255, 255, 255, 0.9);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-item {
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.strategy-card.active .stat-item {
    background: rgba(255, 255, 255, 0.1);
}

.stat-item.highlight {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.strategy-card.active .stat-item.highlight {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.stat-label {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.strategy-card.active .stat-label {
    color: rgba(255, 255, 255, 0.8);
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #f1f5f9;
}

/* Section intervalles avec visualisation améliorée */
.intervals-section {
    background: rgba(139, 92, 246, 0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.strategy-card.active .intervals-section {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.interval-display {
    margin: 24px 0;
    position: relative;
    padding: 0 15px;
}

.interval-bar {
    position: relative;
    height: 50px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.03) 0%, 
        rgba(255, 255, 255, 0.08) 50%, 
        rgba(255, 255, 255, 0.03) 100%);
    border-radius: 25px;
    margin: 15px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.interval-line {
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transform: translateY(-50%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    background-size: 200% 100%;
    animation: shimmer-line 3s linear infinite;
}

.strategy-card.active .interval-line {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.9));
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.interval-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.marker-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #6366f1;
    border: 3px solid var(--bg-card);
    position: relative;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all var(--transition-base);
}

.strategy-card.active .marker-dot {
    background: white;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.5);
}

.marker-dot.primary {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    box-shadow: 0 3px 12px rgba(139, 92, 246, 0.6);
    animation: pulse-marker 2s ease-in-out infinite;
}

.strategy-card.active .marker-dot.primary {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 3px 15px rgba(251, 191, 36, 0.6);
}

.marker-dot.secondary {
    background: #94a3b8;
    width: 12px;
    height: 12px;
}

.strategy-card.active .marker-dot.secondary {
    background: rgba(255, 255, 255, 0.8);
}

/* Animation au survol */
.interval-marker:hover .marker-dot {
    transform: scale(1.2);
}

.interval-marker:hover .marker-label {
    font-weight: 700;
    transform: translateY(-2px);
}

.marker-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-base);
}

.strategy-card.active .marker-label {
    background: rgba(30, 41, 59, 0.9);
    color: white;
}

.marker-percentile {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    opacity: 0.8;
}

.strategy-card.active .marker-percentile {
    color: rgba(255, 255, 255, 0.8);
}

.interval-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
    padding: 12px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.03), 
        rgba(255, 255, 255, 0.06));
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.strategy-card.active .interval-info {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.08), 
        rgba(255, 255, 255, 0.12));
    border-color: rgba(255, 255, 255, 0.15);
}

.interval-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 4px 0;
}

.interval-label {
    color: var(--text-muted);
    font-weight: 500;
}

.strategy-card.active .interval-label {
    color: rgba(255, 255, 255, 0.85);
}

.interval-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.strategy-card.active .interval-value {
    color: white;
}

/* Animations pour les intervalles */
@keyframes pulse-marker {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* Effet de brillance sur la ligne */
@keyframes shimmer-line {
    0% {
        background-position: -200px center;
    }
    100% {
        background-position: 200px center;
    }
}

/* Indicateur de risque */
.risk-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.strategy-card.active .risk-indicator {
    background: rgba(255, 255, 255, 0.1);
}

.risk-label {
    font-size: 12px;
    color: #94a3b8;
}

.strategy-card.active .risk-label {
    color: rgba(255, 255, 255, 0.8);
}

.risk-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Strategy details section */
.strategy-details {
    display: grid;
    gap: 2rem;
}

.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
}

.detail-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Upgrade path amélioré */
.upgrade-path {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.path-step {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    flex: 0 0 140px;
    width: 140px;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-sm);
}


.path-step.below-start {
    opacity: 0.6;
    filter: grayscale(30%);
}

.path-step.below-start .step-level {
    background: linear-gradient(135deg, #64748b, #475569);
    color: #e2e8f0;
}

.path-step.below-start .step-name,
.path-step.below-start .step-stats,
.path-step.below-start .step-cost {
    opacity: 0.85;
}

.path-step.below-start:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: #64748b;
    opacity: 0.7;
}

/* Pour les niveaux éditables même s'ils sont below-start */
.path-step.below-start.editable {
    opacity: 0.75;
}

.path-step.below-start.editable:hover {
    transform: translateY(-2px);
    border-color: #6a6a6a;
}

/* Style pour les niveaux cibles (dans le chemin principal) */
.path-step.target-level {
    border-color: var(--primary);
    box-shadow: 0 0 0 1.5px rgba(var(--primary-rgb), 0.2), var(--shadow-sm);
}

.path-step:hover {
    background: linear-gradient(135deg, var(--bg-hover), var(--bg-secondary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.path-step.editable {
    background: linear-gradient(135deg, #2a2d5e, #1e2147);
    border-color: var(--primary);
}

.step-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.step-level {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.step-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.step-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
}

.step-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    word-break: break-word;
    line-height: 1.2;
    max-width: 100px;
}

.step-select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    transition: all var(--transition-fast);
}

.step-select:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.step-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

.step-stats {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.15);
    width: 100%;
}

.step-rate {
    color: var(--success);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.step-rate::before {
    content: '⚡';
    font-size: 0.7rem;
}

.step-trials {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.step-trials::before {
    content: '🎯';
    font-size: 0.7rem;
}

.step-cost {
    color: var(--secondary);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    text-align: center;
    background: rgba(var(--primary-rgb), 0.08);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    width: 100%;
}

/* Matériaux sous les paliers */
.step-materials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    justify-content: center;
}

.material-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    cursor: help;
    transition: all var(--transition-fast);
}

.material-item:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.material-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.material-qty {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
}

.detail-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Items list */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.item-row:last-child {
    border-bottom: none;
}

.item-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.item-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.item-qty {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 50px;
    text-align: right;
    cursor: help;
}

.item-cost {
    font-weight: 600;
    color: var(--primary);
    min-width: 80px;
    text-align: right;
}

/* Chart section */
.chart-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.chart-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.chart-container {
    height: 400px;
    position: relative;
    margin-bottom: 1.5rem;
}

.chart-legend {
    display: flex;
    justify-content: center;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    justify-content: center;
}

.legend-budget {
    font-weight: 600;
    color: var(--primary);
}

.legend-arrow {
    color: var(--text-muted);
}

.legend-prob {
    color: var(--text-primary);
    font-weight: 600;
}

.legend-label {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Contrôles du graphique */
.chart-controls {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

/* Animation pour le bouton pendant la simulation */
.btn-secondary:disabled {
    background: var(--bg-tertiary);
    opacity: 0.7;
    cursor: wait;
}

.btn-secondary:disabled .btn-icon {
    animation: spin 2s linear infinite;
}

/* Légende améliorée pour afficher les deux courbes */
.chart-section .chartjs-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.chart-legend-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Indicateur de courbe empirique */
.empirical-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.empirical-indicator::before {
    content: '🎲';
    font-size: 0.875rem;
}

/* Tooltip system */
.tooltip {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    pointer-events: none;
    max-width: 300px;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--bg-secondary);
}

.tooltip-content {
    font-size: 0.75rem;
}

.tooltip-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.tooltip-row:last-child {
    margin-bottom: 0;
}

.tooltip-row span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.tooltip-warning {
    color: var(--warning);
    font-weight: 600;
    padding: 0.25rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tooltip-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.tooltip-subtitle {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-xl);
    animation: slideIn var(--transition-base) ease-out;
    min-width: 300px;
    transition: opacity var(--transition-base);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast-icon {
    font-size: 1.25rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: var(--text-primary);
    font-size: 1rem;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-base);
}

.footer a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Export specific styles */
.export-container {
    width: 1600px !important;
    max-width: none !important;
}

.export-container .main-container {
    max-width: none !important;
    width: 100% !important;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* Utilitaires */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ===== MODALE DE PARTAGE OPTIMISÉE ===== */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
    padding: 1rem;
}

.share-modal.open {
    opacity: 1;
}

.share-modal.closing {
    opacity: 0;
}

.share-modal .modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.share-modal .modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 95%;
    max-width: 1400px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    margin: auto;
    overflow: hidden;
}

.share-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.share-modal .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.share-modal .modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.share-modal .modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.share-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Prévisualisation de l'image */
.image-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    flex: 1;
    min-height: 0;
    max-height: calc(95vh - 200px);
}

.preview-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin: auto;
}

/* Actions de partage */
.share-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.share-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
}

.share-actions .btn span {
    font-size: 1.25rem;
}

/* Info */
.share-info {
    color: var(--text-secondary);
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.share-info strong {
    color: var(--primary);
}

/* Section externe (services d'hébergement) */
.share-external {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.share-external summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.5rem;
    user-select: none;
    transition: color var(--transition-base);
}

.share-external summary:hover {
    color: var(--primary);
}

.share-external[open] summary {
    margin-bottom: 1rem;
    color: var(--primary);
}

.share-note {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 1rem 0 0.75rem;
}

.share-external ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.share-external li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-external li::before {
    content: '→';
    color: var(--primary);
    font-weight: bold;
}

.share-external a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-base);
}

.share-external a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* ===== MODALE GÉNÉRIQUE (CONFIRMATION, ETC) ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
    padding: 1rem;
}

.modal.open {
    opacity: 1;
}

.modal.closing {
    opacity: 0;
}

.modal .modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal .modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal .modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    border-radius: var(--radius-sm);
}

.modal .modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal .modal-body p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.modal .modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.modal .modal-footer .btn {
    min-width: 100px;
}

/* Responsive */
@media (max-width: 1200px) {
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .strategies-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }
    
    .header-container {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .brand-name {
        font-size: 1.25rem;
    }
    
    .brand-subtitle {
        display: none;
    }
    
    .main-nav {
        flex-direction: column;
    }
    
    .nav-btn {
        max-width: none;
    }
    
    .upgrade-path {
        gap: 0.4rem;
        justify-content: flex-start;
        padding-bottom: 0.5rem;
    }
    
    .path-step {
        padding: 0.75rem;
        flex: 0 0 110px;
        width: 110px;
    }
    
    .step-icon {
        width: 32px;
        height: 32px;
    }
    
    .step-materials {
        gap: 0.2rem;
    }
    
    .material-item {
        padding: 0.2rem 0.4rem;
    }
    
    .material-icon {
        width: 16px;
        height: 16px;
    }
    
    .legend-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .detail-section,
    .chart-section {
        padding: 1.5rem;
    }
    
    .analysis-title {
        font-size: 1.5rem;
    }
    
    .analysis-levels {
        font-size: 1.25rem;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    
    .toast {
        width: 100%;
    }
    
    .tooltip {
        max-width: 250px;
    }
    
    .level-selectors {
        flex-wrap: wrap;
    }
    
    .level-arrow {
        display: none;
    }
    
    /* Ajustements des cartes de stratégie pour mobile */
    .main-stat-value {
        font-size: 1.75rem;
    }
    
    .strategy-header {
        padding: 1rem 1rem 0.5rem;
    }
    
    .strategy-body {
        padding: 1rem;
    }
    
    /* Intervalles sur mobile */
    .interval-display {
        padding: 0 10px;
    }

    .interval-bar {
        height: 40px;
    }

    .marker-label {
        font-size: 12px;
        padding: 1px 6px;
    }

    .marker-percentile {
        font-size: 10px;
    }

    .marker-dot {
        width: 12px;
        height: 12px;
    }

    .marker-dot.primary {
        width: 16px;
        height: 16px;
    }

    .interval-info {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    /* Modale de partage */
    .share-modal .modal-content {
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
    }
    
    .share-modal .modal-header {
        padding: 1rem;
    }
    
    .share-modal .modal-body {
        padding: 1rem;
    }
    
    .image-preview {
        padding: 0.5rem;
    }
    
    .share-actions {
        flex-direction: column;
    }
    
    .share-actions .btn {
        width: 100%;
    }
    
    /* Modale générique */
    .modal .modal-content {
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        justify-content: center;
    }
    
    .header-controls {
        width: 100%;
        justify-content: center;
    }
    
    .upgrade-path {
        gap: 0.25rem;
    }
    
    .path-step {
        padding: 0.5rem;
        flex: 0 0 100px;
        width: 100px;
    }
    
    .step-name,
    .step-select {
        font-size: 0.7rem;
    }
    
    .step-icon {
        width: 28px;
        height: 28px;
    }
    
    .step-rate,
    .step-trials {
        font-size: 0.75rem;
    }
    
    .step-cost {
        font-size: 0.7rem;
    }
    
    .step-materials {
        margin-top: 0.25rem;
        padding-top: 0.25rem;
    }
    
    .material-item {
        padding: 0.15rem 0.3rem;
    }
    
    .material-icon {
        width: 14px;
        height: 14px;
    }
    
    .material-qty {
        font-size: 0.65rem;
    }
    
    .price-input {
        width: 60px;
        font-size: 0.875rem;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .legend-grid {
        grid-template-columns: 1fr;
    }
    
    .item-icon {
        width: 24px;
        height: 24px;
    }
    
    .item-name {
        font-size: 0.8rem;
    }
    
    .item-qty,
    .item-cost {
        font-size: 0.8rem;
        min-width: 40px;
    }
    
    .selected-item {
        flex-direction: column;
        text-align: center;
    }
    
    .item-image {
        width: 80px;
        height: 80px;
    }
    
    /* Cartes de stratégie sur très petits écrans */
    .strategies-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-stat-value {
        font-size: 1.5rem;
    }
    
    .interval-display {
        display: none; /* Masquer la visualisation complexe sur mobile */
    }
    
    .interval-info {
        margin-top: 0;
    }
}

/* Boutons d'import/export de configuration */
.config-import-export {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-small .btn-icon {
    font-size: 1rem;
}

/* Support des niveaux élevés */
.level-select {
    min-width: 120px; /* Augmenté pour supporter +200 */
}

/* Séparateur pour Pierre magique obligatoire */
.magic-stone-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 1rem;
    position: relative;
    width: 60px;
    min-height: 140px;
    flex-shrink: 0;
}

.magic-stone-separator::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(239, 68, 68, 0.3) 20%,
        rgba(239, 68, 68, 0.5) 50%,
        rgba(239, 68, 68, 0.3) 80%,
        transparent 100%
    );
    transform: translateX(-50%);
    border-radius: 2px;
}

.magic-stone-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    z-index: 10;
    transition: all var(--transition-base);
    box-shadow: 
        0 0 0 4px rgba(239, 68, 68, 0.1),
        0 4px 12px rgba(239, 68, 68, 0.3);
}

.magic-stone-warning::before {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url('red-alert-icon.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.magic-stone-warning::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid #ef4444;
    border-radius: 50%;
    opacity: 0;
    animation: warning-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes warning-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.magic-stone-warning:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 
        0 0 0 6px rgba(239, 68, 68, 0.15),
        0 6px 20px rgba(239, 68, 68, 0.4);
    border-color: #f87171;
}

/* Style pour le palier de départ */
.path-step.start-level {
    border: 3px solid #FFD700;
    box-shadow: 
        0 0 0 1px #FFD700,
        0 0 15px rgba(255, 215, 0, 0.3),
        inset 0 0 10px rgba(255, 215, 0, 0.1);
    position: relative;
}

.path-step.start-level::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 0 0.5rem;
    font-size: 0.65rem;
    color: #FFD700;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.path-step.start-level::after {
    content: '▶';
    position: absolute;
    top: -12px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: #FFD700;
    color: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.4);
}

/* Amélioration du hover pour le palier de départ */
.path-step.start-level:hover {
    border-color: #FFD700;
    box-shadow: 
        0 0 0 2px #FFD700,
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 0 15px rgba(255, 215, 0, 0.15);
}

.magic-stone-warning:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 10px rgba(var(--danger), 0.3);
}

/* Loop indicator pour les niveaux répétitifs */
.upgrade-loop-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.05), rgba(99, 102, 241, 0.05));
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.upgrade-loop-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.1) 0%, transparent 70%);
    animation: pulse-glow 4s ease-in-out infinite alternate;
    pointer-events: none;
}

.loop-preview {
    display: flex;
    gap: 0.6rem; /* Augmenté pour plus d'espace entre les paliers */
    padding: 1rem;
    background: rgba(30, 41, 59, 0.6);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(147, 51, 234, 0.5) transparent;
    position: relative;
    z-index: 1;
    align-items: center;
    min-height: 140px; /* Augmenté pour accommoder les paliers plus grands */
}

.loop-preview::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.1);
    border-radius: 3px;
}

.loop-preview::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #9333ea, #6366f1);
    border-radius: 3px;
}

.loop-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(51, 65, 85, 0.6));
    border-radius: var(--radius-lg);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.loop-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(147, 51, 234, 0.05) 10px,
            rgba(147, 51, 234, 0.05) 20px
        );
    pointer-events: none;
}

/*@keyframes loop-rotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}*/

.loop-arrow {
    font-size: 3rem;
    background: linear-gradient(135deg, #9333ea, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(147, 51, 234, 0.4));
    animation: loop-rotate 4s linear infinite;
    position: relative;
    z-index: 1;
}

.loop-text {
    font-size: 1rem;
    color: var(--text-primary);
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}
/*
.loop-text::first-line {
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e0aaff, #c77dff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}*/

.loop-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.4);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 1;
}

.range-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-card), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.range-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #9333ea, #6366f1);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.range-summary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(147, 51, 234, 0.2);
    border-color: rgba(147, 51, 234, 0.4);
}

.range-summary:hover::before {
    transform: scaleX(1);
}

.range-label {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #9333ea, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-label::before {
    content: '📊';
    font-size: 1.125rem;
    filter: none;
    -webkit-text-fill-color: initial;
}

.range-stats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.range-stats > span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-stats .stat-icon {
    font-size: 0.875rem;
    opacity: 0.7;
}

.high-level-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
    animation: badge-pulse 2s ease-in-out infinite;
}

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

.path-step.mini {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(124, 58, 237, 0.05));
    border: 1.5px solid rgba(147, 51, 234, 0.3);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.5rem;
    text-align: center;
    flex: 0 0 110px; /* Augmenté de 90px à 110px */
    width: 110px;
    min-height: 120px;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.path-step.mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.2);
    border-color: rgba(147, 51, 234, 0.5);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(124, 58, 237, 0.08));
}

.path-step.mini .step-level {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.path-step.mini .step-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin: 0.25rem 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.path-step.mini .step-stats {
    font-size: 0.7rem; /* Augmenté de 0.65rem */
    padding: 0.3rem 0.4rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column; /* Changé en colonne pour éviter le chevauchement */
    gap: 0.2rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.path-step.mini .step-rate {
    color: #10b981;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.path-step.mini .step-rate::before {
    content: '⚡';
    font-size: 0.65rem;
}

.path-step.mini .step-trials {
    color: #e0aaff;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.path-step.mini .step-trials::before {
    content: '🎯';
    font-size: 0.65rem;
}

.upgrade-loop-section::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    /*animation: shine 3s infinite;*/
    pointer-events: none;
}

@keyframes shine {
    0% { transform: translate(0, 0); }
    100% { transform: translate(200%, 200%); }
}

@keyframes loop-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Responsive pour les sélecteurs de niveau */
@media (max-width: 768px) {
    .level-selectors {
        flex-direction: column;
        gap: 1rem;
    }

    .loop-arrow {
        font-size: 2rem;
    }

    .loop-text {
        font-size: 0.875rem;
    }
    
    .upgrade-loop-section {
        padding: 1rem;
        gap: 1rem;
    }

    .loop-summary {
        grid-template-columns: 1fr;
    }

    .range-summary {
        padding: 0.75rem;
    }

    .loop-indicator {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .level-selector {
        width: 100%;
    }
    
    .level-select {
        width: 100%;
    }
    
    .config-import-export {
        flex-direction: column;
    }
    
    .config-import-export .btn {
        width: 100%;
    }
}

/* Amélioration de l'affichage des chemins longs */
.upgrade-path {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-secondary);
}

.upgrade-path::-webkit-scrollbar {
    height: 8px;
}

.upgrade-path::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.upgrade-path::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.upgrade-path::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

.export-mode .upgrade-loop-section {
    background: linear-gradient(135deg, #f3f0ff, #f0f4ff);
    border: 2px solid #9333ea;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.1);
}

.export-mode .loop-indicator {
    background: white;
    border: 1px solid #e0e7ff;
}

.export-mode .range-summary {
    background: white;
    border: 1px solid #e0e7ff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Indicateur de défilement pour les chemins longs */
.upgrade-path.scrollable::after {
    content: '→';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent, var(--bg-card));
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.5rem;
    color: var(--primary);
    pointer-events: none;
}

/* Animation pour les niveaux élevés */
@keyframes sparkle {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
}

.path-step.magic-stone-only::after {
    animation: sparkle 2s ease-in-out infinite;
}

/* Toast pour les imports/exports */
.toast.info {
    border-left: 4px solid var(--info);
}

.toast.info .toast-icon {
    color: var(--info);
}

/* Connexion visuelle entre stratégie et chemin - SUPPRIMÉE */
/* .strategy-connection - Supprimé pour éviter les lignes de connexion */

/* Position relative pour les conteneurs - SUPPRIMÉ */
/* Plus nécessaire après suppression de la connexion visuelle */

/* Indicateur visuel sur la stratégie active - SUPPRIMÉ */
/* .strategy-card.active::after - Supprimé pour éviter l'affichage de la flèche */

/* Animation pulse - SUPPRIMÉE */
/* @keyframes pulse - Supprimée car plus utilisée */

/* Séparateur visuel pour les niveaux > 9 */


.separator-text {
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--warning);
    font-weight: 600;
    white-space: nowrap;
    z-index: 1;
    position: relative;
}

/* Amélioration de la répartition des étapes sur plusieurs lignes */
.upgrade-path {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 0;
    justify-content: center;
    align-items: stretch;
}

.upgrade-path-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    width: 100%;
    margin-bottom: 1rem;
}

.upgrade-path-row:last-child {
    margin-bottom: 0;
}

/* Pour l'export - meilleure gestion des chemins longs */
.export-mode .upgrade-path {
    display: grid;
    grid-template-columns: repeat(auto-track, minmax(100px, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

.export-mode .path-step {
    margin: 0;
    flex: none;
    width: 100%;
}

/* ===== CORRECTIONS CSS POUR LES GROUPES ===== */

/* Amélioration de l'affichage des groupes */
.upgrade-path.grouped {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.path-group {
    flex: 1 1 100%;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    min-width: 300px;
}

.path-group:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.group-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: var(--bg-tertiary);
    transition: all var(--transition-base);
    user-select: none;
    position: relative;
}

.group-header:hover {
    background: var(--bg-hover);
}

.group-header.expanded {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.group-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.group-toggle svg {
    transition: transform var(--transition-base);
}

.group-header.expanded .group-toggle svg {
    transform: rotate(180deg);
}

.group-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.group-range {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.group-summary {
    font-size: 0.875rem;
    opacity: 0.8;
}

.group-header.expanded .group-summary {
    opacity: 0.9;
}

/* Icône d'upgrade pour les groupes */
.group-upgrade-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    padding-left: 1rem;
}

.group-upgrade-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    opacity: 0.9;
}

.group-header.expanded .group-upgrade-icon-img {
    opacity: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.group-materials {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.group-materials .material-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.more-materials {
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.group-header.expanded .more-materials {
    background: rgba(255, 255, 255, 0.2);
}

.group-content {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: var(--bg-card);
    animation: expandIn var(--transition-base) ease-out;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-secondary);
}

.group-content::-webkit-scrollbar {
    width: 8px;
}

.group-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.group-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* Amélioration de l'alignement des path-steps */
.path-step {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    position: relative;
}

.step-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.step-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: center;
}

.step-materials {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    justify-content: center;
    min-height: 0;
}

/* Indicateur visuel pour Pierre magique obligatoire */
.path-step.magic-stone-only::after {
    content: '✨';
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: sparkle 2s ease-in-out infinite;
    z-index: 1;
}

/* Animation pour l'expansion des groupes */
@keyframes expandIn {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 400px;
    }
}

/* Badge de compte pour les groupes avec beaucoup d'éléments */
.group-header[data-item-count]::after {
    content: attr(data-item-count);
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Responsive pour les groupes */
@media (max-width: 768px) {
    .group-header {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .group-range {
        font-size: 1rem;
    }
    
    .group-summary {
        font-size: 0.8rem;
    }
    
    .group-upgrade-icon-img {
        width: 28px;
        height: 28px;
    }
    
    .group-materials .material-icon {
        width: 20px;
        height: 20px;
    }
    
    .group-content {
        padding: 0.75rem;
        gap: 0.5rem;
        max-height: 300px;
    }
}

.separator-text {
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--warning);
    font-weight: 600;
    white-space: nowrap;
    z-index: 1;
    position: relative;
}

/* Optimisation pour très hauts niveaux */
.upgrade-path.very-high-level {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-secondary);
}

.upgrade-path.very-high-level::-webkit-scrollbar {
    width: 8px;
}

.upgrade-path.very-high-level::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.upgrade-path.very-high-level::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* Correction de l'affichage des matériaux manquants */
.material-item.missing-image {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.material-item.missing-image .material-qty {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Animation améliorée pour les groupes */
.path-group {
    position: relative;
    overflow: hidden;
}

.path-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(var(--primary-rgb), 0.05));
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.path-group:hover::before {
    opacity: 1;
}

/* Badge d'avertissement pour les groupes avec beaucoup d'essais */
.group-header[data-high-trials]::before {
    content: '⚠️';
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Amélioration de la lisibilité des statistiques */
.step-stats {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.15);
    width: 100%;
    margin: 0.25rem 0;
}

.step-rate,
.step-trials {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.step-cost {
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 0.25rem;
    text-align: center;
    background: rgba(var(--primary-rgb), 0.08);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    width: 100%;
}

/* Amélioration de la transition entre les groupes */
.path-group + .path-group {
    margin-top: 0.5rem;
}

/* Style pour les groupes vides ou avec peu d'éléments */
.group-content:empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.group-content:empty::after {
    content: 'Aucun niveau dans ce groupe';
}

/* Amélioration des couleurs pour les niveaux en dessous du départ */


/* Correction de l'alignement vertical */
.upgrade-path {
    align-items: stretch;
}

.path-step,
.path-group {
    align-self: flex-start;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print styles pour l'export */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .header,
    .main-nav,
    .export-btn,
    .toast-container,
    .loading-overlay {
        display: none !important;
    }
    
    .main-container {
        max-width: 100%;
        padding: 0;
    }
    
    .strategy-card,
    .detail-section,
    .chart-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Animations supplémentaires */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Focus styles améliorés */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline-offset: 0;
}

/* Amélioration de l'accessibilité */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Support du mode de contraste élevé */
@media (prefers-contrast: high) {
    :root {
        --primary: #818cf8;
        --text-primary: #ffffff;
        --text-secondary: #e2e8f0;
        --bg-primary: #000000;
        --bg-secondary: #1a1a1a;
        --border-color: rgba(255, 255, 255, 0.2);
    }
}

/* Menu d'export du graphique */
.export-menu {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 200px;
    backdrop-filter: blur(10px);
    background-color: rgba(30, 41, 59, 0.98);
}

.export-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin: 2px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #e2e8f0;
    font-size: 14px;
    white-space: nowrap;
}

.export-menu-item:hover {
    background-color: #334155;
    transform: translateX(2px);
}

.export-menu-item:active {
    background-color: #475569;
}

.export-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Style cohérent avec vos boutons existants */
.btn.btn-secondary {
    gap: 8px;
}

/* Animation du menu */
.export-menu {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* S'assurer que le menu est au-dessus de tout */
.chart-controls {
    position: relative;
    z-index: 10;
}

/* Tooltip personnalisé pour l'avertissement Pierre magique */
.magic-stone-warning .warning-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid #ef4444;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    font-size: 13px;
    color: #f1f5f9;
    margin-bottom: 8px;
    
    /* Gérer le retour à la ligne */
    white-space: normal;
    width: 280px;
    text-align: center;
    line-height: 1.4;
}

/* Flèche du tooltip */
.magic-stone-warning .warning-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #ef4444;
}

/* Afficher au survol */
.magic-stone-warning:hover .warning-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ===== SECTION DE BIENVENUE ===== */
.welcome-section {
    margin-bottom: 2rem;
    animation: fadeIn var(--transition-slow) ease-out;
}

.welcome-card {
    background: linear-gradient(135deg, var(--bg-card), rgba(99, 102, 241, 0.05));
    border: 1.5px solid rgba(var(--primary-rgb), 0.2);
    border-radius: var(--radius-xl);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px -2px rgba(var(--primary-rgb), 0.1);
}

/* Effet de brillance en arrière-plan */
.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.05) 0%, transparent 70%);
    animation: pulse-glow 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes pulse-glow {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(1.1); }
}

.welcome-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.welcome-icon {
    font-size: 2rem;
    animation: sparkle 2s ease-in-out infinite;
}

.welcome-subtitle {
    font-size: 1.125rem;
    color: var(--primary-light);
    font-weight: 500;
}

.welcome-content {
    position: relative;
    z-index: 1;
}

.welcome-description {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Conteneur des conseils */
.tips-container {
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(8px);
}

.tips-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tip-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.tip-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.tip-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.tip-card:hover::after {
    transform: scaleX(1);
}

.tip-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: var(--radius-md);
}

.tip-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tip-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .welcome-card {
        padding: 1.5rem;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
    }
    
    .welcome-description {
        font-size: 0.9375rem;
        margin-bottom: 1.5rem;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tip-card {
        padding: 1rem;
    }
    
    .tip-icon {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .welcome-title {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
    
    .welcome-icon {
        font-size: 1.5rem;
    }
    
    .tips-title {
        font-size: 1.125rem;
    }
    
    .tip-content h4 {
        font-size: 0.9375rem;
    }
    
    .tip-content p {
        font-size: 0.8125rem;
    }
}

body:has(.loading-overlay:not([style*="display: none"])) .path-step:hover,
html:not(:hover) .path-step:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
}

/* Solution plus simple : utiliser pointer-events */
@media (hover: hover) {
    .upgrade-path {
        scroll-behavior: smooth;
    }
    
    .upgrade-path:has(.path-step:hover) {
        pointer-events: none;
    }
    
    .upgrade-path .path-step {
        pointer-events: auto;
    }
}

#analysisTab .selected-item {
    margin: 1.5rem 0;
}

/* Badge des niveaux dans l'objet sélectionné */
.item-levels-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    margin-top: 0.5rem;
}

.level-start {
    color: #FFD700;
    font-size: 0.875rem;
    font-weight: bold;
}

.level-arrow {
    color: var(--primary);
    width: 16px;
    height: 16px;
    position: relative;
    top: -11px;
    left: 2px;
}

.level-end {
    color: var(--success);
    font-size: 0.875rem;
    font-weight: bold;
}










/* Prix spécial pour Parchemin du Dieu Dragon */
.price-item-special {
    display: grid;
    grid-template-columns: 32px 1fr 80px 40px 20px 32px 1fr 80px 40px;
    gap: 0.75rem;
    align-items: center;
}

.price-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    justify-self: center;
}

.moonlight-label-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-icon {
    width: 18px;
    height: 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--primary);
    cursor: help;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.help-icon:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.moonlight-price {
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

.moonlight-price:focus {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--primary);
}

/* Style pour le tooltip spécifique */
.tooltip-formula {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.formula-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    color: var(--primary-light);
    font-weight: 500;
}

.formula-row span:nth-child(2) {
    color: var(--text-muted);
}

/* Responsive pour l'affichage spécial */
@media (max-width: 1200px) {
    .price-item-special {
        grid-template-columns: 32px 1fr 80px 40px;
        grid-template-rows: auto auto;
    }
    
    .price-separator {
        display: none;
    }
    
    .price-item-special > img:nth-of-type(2),
    .moonlight-label-container,
    .price-item-special > input:nth-of-type(2),
    .price-item-special > span:nth-of-type(2) {
        margin-top: 0.5rem;
    }
}

@media (max-width: 768px) {
    .moonlight-label-container {
        grid-column: span 2;
    }
}