/* print.css - Polished worksheet print styling for US Letter */

@page {
    size: letter;
    margin: 0.5in;
}

/* Worksheet content styles (shared screen + print) */
.worksheet {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.4;
    color: #1a1a1a;
    max-width: 7.5in;
    margin: 0 auto;
}

/* ===== Header ===== */
.worksheet-header {
    text-align: center;
    margin-bottom: 0.15in;
}

.worksheet-header .title {
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
}

.worksheet-header .topic {
    font-size: 20pt;
    font-weight: 800;
    margin: 2px 0;
    letter-spacing: -0.01em;
}

.worksheet-header .student-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 0.1in;
    gap: 0.15in;
}

.student-info .field {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.student-info label {
    font-size: 8pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
    margin-bottom: 1px;
}

.student-info .line {
    flex: 1;
    border-bottom: 1.5pt solid #333;
    height: 8pt;
}

.student-info .line.short {
    width: 45%;
}

/* ===== Definition Box ===== */
.definition-box {
    background: #f7f8fa;
    border: 1pt solid #d0d4da;
    border-left: 4pt solid #2563eb;
    border-radius: 2pt;
    padding: 0.06in;
    margin-bottom: 0.12in;
    font-size: 9.5pt;
    line-height: 1.4;
}

.definition-box .definition-title {
    font-weight: 700;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4pt;
    font-size: 9.5pt;
}

.definition-box .definition-title::before {
    content: "";
    width: 3pt;
    height: 3pt;
    background: #2563eb;
    border-radius: 50%;
    flex-shrink: 0;
}

.definition-box p {
    margin: 0;
}

/* ===== Directions ===== */
.directions {
    font-size: 9pt;
    margin-bottom: 0.15in;
}

.directions strong {
    display: block;
    font-weight: 600;
    color: #333;
}

/* ===== Problems Grid ===== */
.problems-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.1in;
    margin-bottom: 0.3in;
}

@media (max-width: 600px) {
    .problems-grid {
        grid-template-columns: 1fr;
    }
}

.problem-box {
    border: 1.5pt solid #333;
    border-radius: 2pt;
    padding: 0.06in 0.08in;
    min-height: 0.9in;
    position: relative;
    display: flex;
    flex-direction: column;
}

.problem-number {
    position: absolute;
    top: -10px;
    left: 10px;
    background: #fff;
    padding: 0 6px;
    font-size: 9pt;
    font-weight: 700;
}

.problem-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 100%;
}

.problem-text {
    font-size: 9.5pt;
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.2;
}

.answer-area {
    border: 1pt dashed #999;
    border-radius: 1pt;
    min-height: 0.3in;
    padding: 2pt 6pt;
    font-size: 9pt;
    color: #999;
    display: flex;
    align-items: center;
}

.answer-area.center {
    text-align: center;
}

/* ===== Divider ===== */
.divider {
    text-align: center;
    margin: 0.2in 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 38%;
    border-top: 1pt dashed #999;
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.divider-text {
    display: inline-block;
    background: #fff;
    padding: 0 16px;
    font-size: 9pt;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.scissors {
    font-size: 11pt;
    color: #2563eb;
    margin: 3px 0;
}

/* ===== Answer Key ===== */
.answer-key-section {
    margin-top: 0.1in;
}

.answer-key-section h3 {
    font-size: 11pt;
    font-weight: 700;
    border-bottom: 2pt solid #333;
    padding-bottom: 2px;
    margin-bottom: 0.1in;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    font-size: 10pt;
}

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

.answer-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.answer-number {
    font-weight: 700;
    min-width: 22px;
    color: #2563eb;
}

.answer-value {
    flex: 1;
    text-align: right;
}

.worksheet-meta {
    text-align: center;
    margin-top: 0.15in;
    padding-top: 0.1in;
    border-top: 1px solid #eee;
    font-size: 8pt;
    color: #888;
}

/* ===== Print-only overrides ===== */
@media print {
    body {
        background: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .app-container {
        max-width: none;
        padding: 0;
    }

    .app-header,
    .controls,
    .worksheet-actions,
    .app-footer {
        display: none !important;
    }

    .worksheet-area {
        display: block !important;
        background: white !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        min-height: auto !important;
    }

    #worksheet-content {
        display: block !important;
    }
}