:root {
    --card-width: 100mm;  /* Pour 2 colonnes sur A4 avec marges de 5mm */
    --card-height: 143mm; /* Pour 2 lignes sur A4 avec marges de 5mm */
    --text-size: 12px;    /* Default text size */
}

/* Styles communs */
.print-page {
    background-color: white;
    padding: 5mm;
    max-width: 210mm;
    margin: 0 auto;
}

.print-instructions {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.print-instructions h1 {
    margin: 0 0 1rem;
    color: #333;
    font-size: 1.5rem;
}

.print-instructions h2 {
    margin: 1.5rem 0 1rem;
    color: #666;
    font-size: 1.2rem;
}

.print-instructions ol {
    margin: 0;
    padding-left: 1.5rem;
}

.print-instructions li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.print-instructions .note {
    margin-top: 1rem;
    color: #666;
    font-style: italic;
}

.print-instructions h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.print-instructions h2 {
    font-size: 1.2rem;
    margin: 1rem 0;
}

.print-instructions ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

#cards-container {
    display: grid;
    grid-template-columns: repeat(2, var(--card-width));
    gap: 0;
    padding: 0;
    margin: 0 auto;
}

.card {
    width: var(--card-width);
    height: var(--card-height);
    margin: 0;
    background: white;
    page-break-inside: avoid;
    font-size: var(--text-size);
}

.card-front, .card-back {
    width: var(--card-width);
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: white;
}

.card-frame {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1.2rem solid;
    border-image: linear-gradient(45deg, #0066cc, #3399ff) 1;
    background: white;
    box-sizing: border-box;
}

.card-corner.top-left {
    position: absolute;
    top: -1.2rem;
    left: -1.2rem;
    width: 140px;
    height: 140px;
    background: linear-gradient(45deg, #0066cc, #3399ff);
    clip-path: polygon(0 0, 0 100%, 100% 0);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    z-index: 1;
}

.card-illustration {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 50px;
    height: 50px;
    z-index: 2;
}

.card-illustration img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-title {
    color: #0066cc;
    font-size: 1.7em;
    margin: 0;
    font-weight: bold;
    height: 4rem;
}

.card-header {
    display: flex;
    align-items: center;
    padding: 10px;
    padding-left: 10rem;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0 auto;
    max-width: 100%;
    margin: 1rem;
    border-radius: 4px;
}

.card-description {
    padding: 0 1rem 0 2rem;
    line-height: 1.5;
    margin: 0;
}

.card-graph {
    flex: 1;
    display: flex;
    justify-content: left;
    align-items: center;
    margin: 0;
    padding: 0 0 0 0;
    
}

.card-choices {
    padding: 0 2rem 0 2rem;
    margin-top: auto;
    display: flex;
    flex-direction: column;
}




.card-back {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    border: 1px solid #fdfbfb;
}

.card-answer {
    font-size: 1.3em;
    background-color: #3399ff;
    line-height: 1.5;
    margin: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 1rem;
    color: white;
}

.card-feedback {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-feedback h3 {
    font-size: 1.2em;
    margin: 0;
    color: #0066cc;
}

.card-feedback p {
    line-height: 1.5;
    margin: 0;
}

.card-back-footer {
    font-size: 0.9em;
    font-style: italic;
    color: #666;
}

/* Styles pour les contrôles de taille (masqués à l'impression) */
@media screen {
    .size-controls {
        margin-bottom: 2rem;
    }

    .control-group {
        display: flex;
        gap: 1rem;
        align-items: center;
        flex-wrap: wrap;
    }

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

    .control-group input[type="number"] {
        width: 60px;
        padding: 0.3rem;
        border: 1px solid #ccc;
        border-radius: 4px;
    }

    .control-group button {
        padding: 0.3rem 1rem;
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }

    .control-group button:hover {
        background-color: #0056b3;
    }
}

/* Masquer les instructions à l'impression */
@page {
    size: A4 portrait;
    margin: 5mm;
}

@media print {
    .print-instructions {
        display: none;
    }

    .print-page {
        padding: 0;
        margin: 0;
        width: 210mm;
    }

    /* Forcer l'arrière-plan blanc à l'impression */
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
