:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #7209b7;
    --success-color: #4cc9f0;
    --warning-color: #f72585;/*rose soutenu*/
    --fun-color-1: #2f234c;/**/
    --fun-color-2: #5d062d;/*rose soutenu*/
    --fun-color-3: #5d062d;/*bleu*/
    --fun-color-4: #f01f95;/*7b0b3e*/
    --fun-color-5: #940d59;/*rose plus soutenu*/
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-bottom: 50px;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, var(--fun-color-1) 0%, var(--fun-color-2) 100%);
    color: white;
    padding: 15px 0;
    border-radius: 0 0 30px 30px;
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.3);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--fun-color-4), var(--fun-color-5));
    animation: rainbow 10s infinite linear;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.logo-arago {
    height: 80px;
    width: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 3px solid white;
    background-color: white;
    padding: 5px;
}

.header-icon {
    font-size: 3rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.card {
    border-radius: 20px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 25px;
    overflow: hidden;
    background: white;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--fun-color-1) 0%, var(--fun-color-2) 100%);
    color: white;
    font-weight: 700;
    border-radius: 20px 20px 0 0 !important;
    padding: 20px 25px;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.select-group {
    margin-bottom: 30px;
}

.triplette-stat-eleves {
    width: 100%;
    font-size: 1rem;
    color: #6c757d;
    margin-top: 8px;
    font-weight: 500;
}

.select-label {
    font-weight: 700;
    color: var(--fun-color-2);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    font-size: 1.05rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--fun-color-4) 0%, var(--fun-color-3) 100%);
    color: white;
    border-radius: 50%;
    margin-right: 10px;
    font-size: 0.9rem;
    font-weight: bold;
}

.form-select {
    border-radius: 15px;
    border: 3px solid #e0e0e0;
    padding: 14px 20px;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: 500;
    background-color: #f8f9fa;
}

.form-select:focus {
    border-color: var(--fun-color-4);
    box-shadow: 0 0 0 0.3rem rgba(76, 201, 240, 0.25);
    transform: scale(1.02);
}

.form-select:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-validate {
    background: linear-gradient(135deg, var(--fun-color-1) 0%, var(--fun-color-2) 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 15px;
    transition: all 0.2s;
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
    display: block;
    width: 100%;
    margin-top: 10px;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-validate::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.btn-validate:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--fun-color-2) 0%, var(--fun-color-3) 100%);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 25px rgba(67, 97, 238, 0.5);
    color:white;
}

.btn-validate:hover:not(:disabled)::after {
    left: 100%;
}

.btn-validate:disabled {
    background: #cccccc;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-fun {
    background: linear-gradient(135deg, var(--fun-color-4) 0%, var(--fun-color-5) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-fun:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(247, 37, 133, 0.3);
}

.result-section {
    display: none;
    margin-top: 40px;
    animation: fadeIn 0.8s ease;
}

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

.triplette-display {
    background: linear-gradient(135deg, #f8f9ff 0%, #e3e7ff 100%);
    border-left: 8px solid var(--fun-color-4);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 30px;
    font-size: 1.3rem;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.15);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.triplette-display span {
    font-weight: 800;
    color: #635754;
    
}

.popularite-badge {
    background: linear-gradient(135deg, var(--fun-color-4) 0%, var(--fun-color-1) 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 400;
    
    /*box-shadow: 0 4px 10px rgba(76, 201, 240, 0.3);*/
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /*font-smooth: always;*/
}

.popularite-badge.rare {
    background: linear-gradient(135deg, #ffc107 0%, #ff6b6b 100%);
    color: white;
    /* Pour un texte encore plus net sur fond jaune/rouge : */
    text-shadow: none;
    font-weight: 800; /* Plus épais pour mieux ressortir */
}

.tableau-doublettes {
    margin-top: 30px;
}

.tableau-doublettes h5 {
    color: var(--fun-color-2);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--fun-color-4);
    font-weight: 700;
    font-size: 1.4rem;
}

.table-doublettes {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: none;
}

.choix-interdit {
    color: var(--warning-color);
    font-weight: bold;
    position: relative;
}

.choix-interdit::before {
    content: "✗";
    color: var(--warning-color);
    font-size: 1.8em;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateY(-50%) rotate(0); }
    25% { transform: translateY(-50%) rotate(-10deg); }
    75% { transform: translateY(-50%) rotate(10deg); }
}

.choix-interdit-cell {
    padding-left: 45px !important;
}

.alert-parcoursup {
    border: 3px solid var(--warning-color);
    background: linear-gradient(135deg, #fff9e6 0%, #ffe6e6 100%);
    padding: 25px;
    border-radius: 20px;
    margin: 30px 0;
    color: #8b0000;
    box-shadow: 0 10px 25px rgba(247, 37, 133, 0.2);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { 
        opacity: 1;
        border-color: var(--warning-color);
    }
    50% { 
        opacity: 0.7;
        border-color: #ff9999;
    }
}

.alert-parcoursup h5 {
    color: #8b0000;
    margin-top: 0;
    font-weight: 800;
}

.reset-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 15px;
    font-size: 1rem;
    transition: all 0.3s;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(108, 117, 125, 0.3);
}

.reset-btn:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(108, 117, 125, 0.4);
}

.info-box {
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f0ff 100%);
    border-radius: 20px;
    padding: 25px;
    margin-top: 35px;
    border-left: 8px solid var(--fun-color-1);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.15);
}

.fun-box {
    background: linear-gradient(135deg, #f8f0ff 0%, #e6f0ff 100%);
    border-left: 8px solid var(--fun-color-3);
}

.progress {
    height: 25px;
    margin-bottom: 15px;
    border-radius: 15px;
    overflow: hidden;
    background-color: #f0f0f0;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.progress-bar {
    background: linear-gradient(90deg, var(--fun-color-4), var(--fun-color-1));
    transition: width 1s ease-in-out;
}

.triplette-item {
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
    border-left: 6px solid var(--fun-color-1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.triplette-item:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-8px) translateX(10px);
    box-shadow: 0 15px 30px rgba(67, 97, 238, 0.2);
}

.triplette-stat {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 8px;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: linear-gradient(135deg, #f8f9ff 0%, #e6ebff 100%);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    border: 2px solid var(--fun-color-4);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--fun-color-2);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
}

.doublette-interdite {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%);
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-left: 4px solid var(--warning-color);
    font-weight: 600;
    color: #8b0000;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background-color: #f8f9fa;
    transition: all 0.3s;
}

.color-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.color-box {
    width: 25px;
    height: 25px;
    border-radius: 6px;
    background-color: var(--color);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.footer {
    text-align: center;
    margin-top: 50px;
    color: #6c757d;
    font-size: 0.95rem;
    padding-top: 30px;
    border-top: 2px solid var(--fun-color-4);
}

.logo-arago-footer {
    height: 60px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--fun-color-4);
    background-color: white;
    padding: 3px;
}

.emoji {
    font-size: 1.2rem;
    margin-right: 5px;
}

.emoji.large {
    font-size: 2.5rem;
}

.info-alert {
    background: linear-gradient(135deg, #e6f7ff 0%, #d1f0ff 100%);
    border-radius: 15px;
    padding: 15px 20px;
    border-left: 5px solid var(--fun-color-4);
    font-weight: 600;
    color: var(--fun-color-2);
    margin-bottom: 20px;
}

.fun-card {
    background: linear-gradient(135deg, #fff8e6 0%, #fff0cc 100%);
    border: 2px dashed var(--fun-color-3);
}

@media (max-width: 768px) {
    .header {
        padding: 15px 0;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .logo-arago {
        height: 60px;
    }
    
    .form-select {
        font-size: 15px;
        padding: 12px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .color-palette {
        grid-template-columns: 1fr;
    }
}

