/* 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;
}

.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;
}

.lesson-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.section {
    margin-bottom: 40px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title {
    color: #4a90e2;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.subsection-title {
    color: #357abd;
    font-size: 1.4em;
    margin-bottom: 15px;
}

.definition-box {
    background: #f0f7ff;
    border-left: 4px solid #4a90e2;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}

.fraction-component {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.component-name {
    font-weight: bold;
    min-width: 120px;
    color: #4a90e2;
}

.component-description {
    color: #666;
    font-style: italic;
}

.fraction-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.fraction-type {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.type-title {
    color: #4a90e2;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.fraction-example {
    font-size: 1.2em;
    color: #666;
    margin: 10px 0;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .fraction-types {
        grid-template-columns: 1fr;
    }

    .fraction-component {
        flex-direction: column;
        align-items: flex-start;
    }

    .component-name {
        margin-bottom: 5px;
    }

    .header {
        padding-top: 40px;
    }
    
    .back-button {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Practice section */
.practice-section {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: #f0f7ff;
    border-radius: 8px;
}

.practice-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.practice-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: #4a90e2;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s;
    font-size: 1.1em;
}

    .practice-link:hover {
        background: #357abd;
    }