/* Print-specific styles */
@media print {
    @page {
        size: A4;
        margin: 2cm;
    }
    
    .print-hide,
    .buttons,
    .settings,
    .back-button {
        display: none !important;
    }

    .instructions-wrapper {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    .problem {
        break-inside: avoid;
    }

    .screen-only {
        display: none !important;
    }

    .print-only {
        display: inline !important;
    }

    .score-blank {
        display: inline-block;
        min-width: 3em;
        border-bottom: 1px solid black;
        margin: 0 0.5em;
    }

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

@media screen {
    .print-only {
        display: none !important;
    }

    .screen-only {
        display: inline !important;
    }
}

/* General styles */
body {
    font-family: Arial, sans-serif;
    max-width: 210mm;
    margin: 0 auto;
    padding: 20px;
    background: white;
}

.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.back-button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.back-link {
    color: #4a90e2;
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.back-link:hover {
    background-color: #f0f7ff;
}

.header h1 {
    color: #4a90e2;
    margin: 0;
    font-size: 28px;
}

.student-info {
    margin: 20px 0 30px;
    font-size: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.line {
    display: inline-block;
    border-bottom: 1px solid #999;
    margin: 0 10px;
}

.line-long {
    width: 300px;
}

.line-short {
    width: 150px;
}

.settings {
    background: #e8f4ff;
    border: 1px solid #4a90e2;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

#shapes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.shape-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.shape-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.shape-svg {
    width: 120px;
    height: 120px;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option input[type="radio"] {
    width: 18px;
    height: 18px;
}

.option label {
    font-size: 1.1rem;
    color: #333;
}

.result-icon {
    width: 20px;
    height: 20px;
    display: none;
}

.result-icon.correct {
    color: #4CAF50;
}

.result-icon.incorrect {
    color: #ff9800;
}

/* Button styles */
.buttons {
    text-align: center;
    margin: 20px 0;
}

button {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin: 0 5px;
}

button:hover {
    background: #357abd;
}

button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.score-section {
    text-align: center;
    font-size: 18px;
    margin: 20px 0;
    color: #4a90e2;
}

.footer {
    text-align: center;
    color: #666;
    margin-top: 20px;
    padding: 20px 0;
}

@media (max-width: 600px) {
    .header {
        padding-top: 40px;
    }
    
    .back-button {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .settings-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-row {
        flex-direction: column;
        gap: 10px;
    }

    .line-long,
    .line-short {
        width: 200px;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
    }

    button {
        width: 100%;
        margin: 5px 0;
    }

    .settings button {
        width: auto;
    }

    #shapes-container {
        grid-template-columns: 1fr;
    }
}
