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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    padding: 10px;
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: calc(104vh - 70px);
    display: flex;
    flex-direction: column;
}

h1 {
    background: #2c5f7c;
    color: white;
    padding: 5px;
    text-align: center;
    font-size: 20px;
    letter-spacing: 2px;
    margin: 0;
}

h2 {
    background: #2c5f7c;
    color: rgb(248, 248, 248);
    padding: 5px;
    text-align: center;
    font-size: 24px;
    letter-spacing: 2px;
    margin: 0;
}

.help-button {
    position: absolute;
    top: 10px;
    right: 20px;
    background: white;
    color: #2c5f7c;
    border: 2px solid #2c5f7c;
    padding: 8px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 100;
    letter-spacing: 0.5px;
}

.help-button:hover {
    background: #2c5f7c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 95, 124, 0.3);
}

.container {
    position: relative;
}

.tabs {
    display: flex;
    background: #e8e8e8;
    overflow-x: auto;
    border-bottom: 3px solid #2c5f7c;
    flex-shrink: 0;
}

.tab-button {
    flex: 1;
    min-width: 150px;
    padding: 12px 15px;
    background: #e8e8e8;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s;
    border-right: 1px solid #ccc;
    text-align: center;
}

.tab-button:hover {
    background: #d0d0d0;
}

.tab-button.active {
    background: white;
    color: #2c5f7c;
    border-bottom: 3px solid #2c5f7c;
    margin-bottom: -3px;
}

.tab-content {
    display: none;
    padding: 15px;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.levels-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.level-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.level-card:hover {
    border-color: #2c5f7c;
    box-shadow: 0 4px 12px rgba(44, 95, 124, 0.15);
    transform: translateY(-2px);
}

.level-card.selected {
    border: 4px solid #2c5f7c;
    box-shadow: 0 6px 20px rgba(44, 95, 124, 0.3);
    transform: scale(1.02);
}

.level-card.selected::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #2c5f7c;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.level-card h3 {
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 18px;
}

.level-novice h3 {
    background: #d32f2f;
}

.level-fonctionnel h3 {
    background: #f57c00;
}

.level-maitrise h3 {
    background: #66bb6a;
}

.level-expertise h3 {
    background: #2e7d32;
}

.level-card p {
    color: #333;
    line-height: 1.2;
    font-size: 16px;
    margin-bottom: 10px;
}

.critere-title {
    font-size: 22px;
    color: #2c5f7c;
    margin-bottom: 10px;
    font-weight: 700;
}

@media (max-width: 1200px) {
    .levels-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .levels-container {
        grid-template-columns: 1fr;
    }

    .tab-button {
        min-width: 150px;
        font-size: 13px;
        padding: 15px 10px;
    }
}

.print-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2c5f7c;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.print-button:hover {
    background: #1d4a5f;
    transform: scale(1.05);
}

footer {
    background: #e0e0e0;
    color: #666;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 0 0 8px 8px;
    letter-spacing: 0.5px;
    
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    color: #2c5f7c;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.modal-form-group {
    margin-bottom: 20px;
}

.modal-form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.modal-form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
}

.modal-form-group input:focus {
    outline: none;
    border-color: #2c5f7c;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.modal-button {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-button.confirm {
    background: #2c5f7c;
    color: white;
}

.modal-button.confirm:hover {
    background: #1d4a5f;
}

.modal-button.cancel {
    background: #ccc;
    color: #333;
}

.modal-button.cancel:hover {
    background: #999;
}

.modal-button.cancel:hover {
    background: #999;
}

/* Styles pour la modale d'aide */
.help-modal-content {
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
}

.help-modal-content h3 {
    color: #2c5f7c;
    margin-bottom: 5px;
    font-size: 22px;
    text-align: center;
}

.help-subtitle {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-bottom: 25px;
    font-size: 16px;
}

.help-section {
    margin-bottom: 25px;
}

.help-section h4 {
    color: #2c5f7c;
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2c5f7c;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.help-section p {
    color: #333;
    line-height: 1.6;
    margin-bottom: 10px;
}

.help-section ul {
    list-style: none;
    padding-left: 0;
}

.help-section li {
    color: #333;
    line-height: 1.8;
    margin-bottom: 8px;
    padding-left: 25px;
    position: relative;
}

.help-section li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #2c5f7c;
    font-weight: bold;
    font-size: 16px;
}

.help-final {
    margin-top: 15px;
    padding: 12px;
    background: #e3f2fd;
    border-left: 4px solid #2c5f7c;
    border-radius: 4px;
}

.niveau-badge-inline {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    color: rgb(196, 64, 64);
    font-weight: 600;
    font-size: 16px;
    margin: 0 2px;
}

.help-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
    width: 35px;
    height: 35px;
    line-height: 35px;
}

.help-close-button:hover {
    color: #2c5f7c;
    transform: rotate(90deg);
}

@media print {

    .tabs,
    .print-button,
    .identity-form,
    .help-button,
    h1,
    .modal {
        display: none !important;
    }

    body {
        padding: 0;
        margin: 0;
        background: white;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
        height: auto;
    }

    .tab-content {
        display: none !important;
    }

    #print-view {
        display: block !important;
        padding: 5mm;
        page-break-after: avoid;
    }

    .print-header {
        text-align: center;
        margin-bottom: 8px;
        padding-bottom: 5px;
        border-bottom: 2px solid #2c5f7c;
    }

    .print-header h1 {
        display: block !important;
        font-size: 18px;
        margin: 0 0 8px 0;
        color: #2c5f7c;
        font-weight: bold;
        background: none;
        padding: 0;
    }

    .print-identity-date {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }

    .print-header h2 {
        font-size: 14px;
        color: #2c5f7c;
        margin: 0;
        font-weight: bold;
        background: none;
        padding: 0;
    }

    .print-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .print-critere {
        border: 1px solid #ccc;
        padding: 4px;
        page-break-inside: avoid;
    }

    .print-critere-title {
        font-weight: bold;
        color: #2c5f7c;
        font-size: 11px;
        margin-bottom: 3px;
        border-bottom: 1px solid #2c5f7c;
        padding-bottom: 2px;
    }

    .print-levels {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
    }

    .print-level {
        border: 1px solid #ccc;
        padding: 3px;
        font-size: 8px;
        text-align: center;
        background: #f9f9f9;
    }

    .print-level.selected {
        border: 2px solid #2c5f7c;
        background: #e3f2fd;
        font-weight: bold;
    }

    .print-level-title {
        font-weight: bold;
        padding: 2px;
        color: white;
        border-radius: 2px;
        margin-bottom: 2px;
        font-size: 9px;
    }

    .print-level.novice .print-level-title {
        background: #d32f2f;
    }

    .print-level.fonctionnel .print-level-title {
        background: #f57c00;
    }

    .print-level.maitrise .print-level-title {
        background: #66bb6a;
    }

    .print-level.expertise .print-level-title {
        background: #2e7d32;
    }

    .print-level-content {
        line-height: 1.2;
    }

    footer {
        display: block !important;
        position: static !important;
        margin-top: 5px;
        padding: 3px;
        font-size: 10px;
        border-radius: 0 !important;
        page-break-after: avoid;
        page-break-before: avoid;
        text-align: center;
    }

    footer::before {
        content: "CERPEG";
    }

    footer * {
        display: none;
    }
}


#print-view {
    display: none;
}