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

:root {
    --swim-color: #00b4d8;
    --swim-light: #90e0ef;
    --swim-dark: #0077b6;
    
    --bike-color: #06d6a0;
    --bike-light: #80ffdb;
    --bike-dark: #059669;
    
    --run-color: #f77f00;
    --run-light: #fcbf49;
    --run-dark: #d62828;
    
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(0, 180, 216, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--swim-color), var(--bike-color), var(--run-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* Status Card */
.status-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    transition: all 0.4s ease;
}

.status-card.valid {
    border-color: var(--success);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
}

.status-card.invalid {
    border-color: var(--error);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.2);
}

.status-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.status-card.valid .status-icon {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.status-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.status-card.valid .status-text {
    color: var(--success);
}

.status-card.invalid .status-text {
    color: var(--error);
}

.status-details {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Sliders Container */
.sliders-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Order Section */
.order-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

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

.order-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: grab;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    flex: 1;
    min-width: 150px;
}

.order-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.order-item:active {
    cursor: grabbing;
}

.order-item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--text-muted);
}

.order-item.drag-over {
    border: 2px solid var(--swim-color);
    background: rgba(0, 180, 216, 0.1);
}

.order-handle {
    color: var(--text-muted);
    font-size: 1rem;
    user-select: none;
}

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

.order-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.order-number {
    background: linear-gradient(135deg, var(--swim-color), var(--run-color));
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Slider Card */
.slider-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.slider-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.slider-card.swim { border-left: 4px solid var(--swim-color); }
.slider-card.bike { border-left: 4px solid var(--bike-color); }
.slider-card.run { border-left: 4px solid var(--run-color); }

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

.discipline-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.discipline-icon {
    font-size: 1.75rem;
}

.discipline-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.distance-display {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.distance-value {
    font-size: 2.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    padding: 0.1rem 0.3rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.distance-value:hover {
    background: rgba(255, 255, 255, 0.1);
}

.distance-input {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--swim-color);
    border-radius: 8px;
    color: inherit;
    width: 120px;
    text-align: center;
    padding: 0.1rem 0.3rem;
    outline: none;
}

.swim .distance-input { border-color: var(--swim-color); }
.bike .distance-input { border-color: var(--bike-color); }
.run .distance-input { border-color: var(--run-color); }

.swim .distance-value { color: var(--swim-color); }
.bike .distance-value { color: var(--bike-color); }
.run .distance-value { color: var(--run-color); }

.distance-unit {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Slider Styling */
.slider-wrapper {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: grab;
    border: 4px solid var(--bg-card);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.15);
}

.swim .slider::-webkit-slider-thumb { background: var(--swim-color); }
.bike .slider::-webkit-slider-thumb { background: var(--bike-color); }
.run .slider::-webkit-slider-thumb { background: var(--run-color); }

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: grab;
    border: 4px solid var(--bg-card);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.swim .slider::-moz-range-thumb { background: var(--swim-color); }
.bike .slider::-moz-range-thumb { background: var(--bike-color); }
.run .slider::-moz-range-thumb { background: var(--run-color); }

/* Slider Info */
.slider-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.percentage-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.swim .percentage-badge { color: var(--swim-color); }
.bike .percentage-badge { color: var(--bike-color); }
.run .percentage-badge { color: var(--run-color); }

/* Constraint Bar */
.constraint-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Bonus Inputs */
.bonus-inputs {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.bonus-field {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bonus-field label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-with-unit {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.2s ease;
}

.input-with-unit:focus-within {
    border-color: var(--swim-color);
}

.bonus-field input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.bonus-field input::placeholder {
    color: var(--text-muted);
}

.bonus-field input::-webkit-outer-spin-button,
.bonus-field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-unit {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.bonus-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    height: 18px;
}

.bonus-indicator.bonus {
    color: var(--success);
}

.bonus-indicator.malus {
    color: var(--error);
}

.bonus-indicator.neutral {
    color: var(--text-muted);
}

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

.constraint-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.constraint-status.valid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.constraint-status.invalid {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* Summary Card */
.summary-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.summary-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    text-align: center;
}

.summary-item.score-item .summary-value {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--swim-color), var(--run-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-status {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.score-status.valid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.score-status.invalid {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.score-breakdown {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
    flex-wrap: wrap;
}

.score-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Equivalence sections */
.equivalence-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
}

.equivalence-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: center;
}

.equivalence-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.equivalence-grid.mono {
    gap: 1.5rem;
}

.equivalence-item {
    text-align: center;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    min-width: 100px;
}

.equivalence-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Contrôles équivalence mono-discipline */
.equiv-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.equiv-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.equiv-control label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.equiv-control input {
    width: 70px;
    padding: 0.4rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

.equiv-control input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
}

.equiv-control input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.equivalence-value {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.equivalence-detail {
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    opacity: 0.7;
    margin-top: 0.1rem;
}

.equivalence-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.25rem;
}

.equivalence-item.swim-eq .equivalence-value { color: var(--swim-color); }
.equivalence-item.bike-eq .equivalence-value { color: var(--bike-color); }
.equivalence-item.bike-eq .equivalence-detail { color: var(--bike-color); }
.equivalence-item.run-eq .equivalence-value { color: var(--run-color); }
.equivalence-item.run-eq .equivalence-detail { color: var(--run-color); }

/* Distribution Bar */
.distribution-bar {
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
}

.distribution-swim {
    background: linear-gradient(90deg, var(--swim-dark), var(--swim-color));
    transition: width 0.3s ease;
}

.distribution-bike {
    background: linear-gradient(90deg, var(--bike-dark), var(--bike-color));
    transition: width 0.3s ease;
}

.distribution-run {
    background: linear-gradient(90deg, var(--run-dark), var(--run-color));
    transition: width 0.3s ease;
}

.distribution-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.9rem;
}

.legend-swim { color: var(--swim-color); }
.legend-bike { color: var(--bike-color); }
.legend-run { color: var(--run-color); }

/* Rules Card */
.rules-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.rules-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
}

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

.rule-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rule-status {
    font-size: 1.1rem;
}

.rule-item.valid {
    background: rgba(16, 185, 129, 0.1);
}

.rule-item.valid .rule-status::after {
    content: "✅";
}

.rule-item.invalid {
    background: rgba(239, 68, 68, 0.1);
}

.rule-item.invalid .rule-status::after {
    content: "❌";
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 900px) {
    .sliders-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .slider-card {
        padding: 1.25rem;
    }
    
    .distance-value {
        font-size: 2rem;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .rules-grid {
        grid-template-columns: 1fr;
    }
    
    .distribution-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .order-container {
        flex-direction: column;
    }
    
    .order-item {
        min-width: unset;
    }
}

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

.slider-card {
    animation: fadeIn 0.5s ease forwards;
}

.slider-card:nth-child(1) { animation-delay: 0.1s; }
.slider-card:nth-child(2) { animation-delay: 0.2s; }
.slider-card:nth-child(3) { animation-delay: 0.3s; }

/* Glow effects */
.slider-card.swim:hover {
    box-shadow: var(--shadow), 0 0 30px rgba(0, 180, 216, 0.15);
}

.slider-card.bike:hover {
    box-shadow: var(--shadow), 0 0 30px rgba(247, 127, 0, 0.15);
}

.slider-card.run:hover {
    box-shadow: var(--shadow), 0 0 30px rgba(6, 214, 160, 0.15);
}
