body {
    font-family: 'Heebo', sans-serif;
    background-color: #fff5f0;
    width: 100%;
    margin: 0 auto;
    color: #333;
}

.header-section {
    background: linear-gradient(135deg, #ff6b35 0%, #d44326 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(212, 67, 38, 0.3);
    position: relative;
    overflow: hidden;
}


.student-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2x;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.info-field {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    flex: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.info-field:hover {
    transform: translateY(-2px);
}

.info-field label {
    margin-left: 8px;
    font-weight: 600;
    white-space: nowrap;
    color: #d44326;
    font-size: 14px;
}

.info-field input {
    flex: 1;
    border: none;
    border-bottom: 2px dotted #ff9a76;
    padding: 3px;
    font-family: 'Heebo', sans-serif;
    font-size: 14px;
    background: transparent;
    color: #333;
}

.info-field input:focus {
    outline: none;
    border-bottom-color: #d44326;
}

h1 {
    font-family: 'Heebo', sans-serif;
    color: #d44326;
    text-align: center;
    margin: 10px 0;
    font-size: 1.9em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.problem-container {
    background-color: white;
    border: 1px solid #ffccb8;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(212, 67, 38, 0.1);
    margin-bottom: 20px;
    padding: 15px 20px;
    page-break-inside: avoid;
}

.problem-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.problem-number {
    font-size: 20px;
    font-weight: bold;
    color: white;
    background-color: #ff6b35;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}


.problem-content {
    font-size: 16px;
    line-height: 1.8;
    direction: rtl;
    text-align: right;
}

.section-title {
    font-family: 'Heebo', sans-serif;
    background-color: #ffe8df;
    padding: 8px 15px;
    margin: 25px 0 12px 0;
    border-right: 4px solid #d44326;
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
    box-shadow: 0 2px 5px rgba(212, 67, 38, 0.08);
    border-radius: 5px;
    page-break-after: avoid;
}

.latex-style {
    direction: ltr;
    display: inline-block;
    font-size: 1.1em;
    color: #333;
    padding: 0 3px;
    vertical-align: middle;
}

.question-text {
    font-size: 1.6em;
    text-align: right;
    direction: rtl;
    margin-bottom: 8px;
    line-height: 1.6;
}

.math-text {
    text-align: center;
    margin: 15px 0;
    font-size: 1.5em;
}

.work-area {
    width: 94%;
    min-height: 80px;
    border: 1px solid #ffccb8;
    border-radius: 5px;
    margin: 20px 0;
    padding: 10px;
}

.work-area-small {
    min-height: 50px;
}

.work-area-large {
    width: 94%;
    min-height: 250px;
    border: 1px solid #ffccb8;
    border-radius: 5px;
    margin: 20px 0;
    padding: 10px;
}

.answer-box {
    display: inline-block;
    width: 60px;
    height: 35px;
    border: 2px solid #ff9a76;
    border-radius: 5px;
    margin: 0 5px;
    vertical-align: middle;
    background-color: #fff8f5;
}

.geometry-content {
    align-items: center;
    text-align: center;
    margin: 20px 0
    
}

.answer-line {
    display: inline-block;
    width: 50px;
    border-bottom: 1px solid #000000;
    margin: 0 5px;
}

.answer-section {
    border-radius: 5px;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #ffe0d3;
}

.answer-label {
    font-size: 1.6em;
    font-weight: 600;
    margin-left: 5px;
    margin: 5px 0;
    color: #d44326;
}

.site-footer {
    font-family: 'Secular One', sans-serif;
    margin-top: 30px;
    padding: 15px;
    background: linear-gradient(135deg, #ff6b35 0%, #d44326 100%);
    color: white;
    border-radius: 10px;
    font-size: 20px;
    text-align: center;
    font-weight: 600;
}

.info-box {
    font-size: 20px;
    background-color: #fff0e6;
    border: 2px solid #ff6b35;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}

.table-style {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
    direction: ltr;
}

.table-style th,
.table-style td {
    border: 1px solid #9c7e72;
    padding: 8px;
    text-align: center;
}

.table-style th {
    background-color: #ffe8df;
    font-weight: bold;
    color: #d44326;
}

.items-list {
    padding-right: 20px;
    line-height: 1.8;
    font-size: 1.4em;
}

/* === Compact Problem Styles === */
.problem-grid {
    width: 91.5%;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 5px rgba(212, 67, 38, 0.1);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.compact-problem {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ffe0d3;
    position: relative;

}

.problem-expression {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    direction: rtl;
    text-align: right;
    font-size: 1.2em;
    padding-top: 1.4em;
    /* Optional: ensures text inside is also left-aligned */
}

.compact-number {
    background-color: #ff6b35;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
    position: absolute;
    top: 10px;
    right: 10px;
}

.compact-work-area {
    width: 100%;
    min-height: 80px;
    border: 1px solid #ffccb8;
    border-radius: 4px;
    background-size: 15px 15px;
    background-position: 0 0;
}

.problem-grid .answer-box {
    width: 45px;
    height: 28px;
    margin: 0 3px;
}

.x-axis::after,
.y-axis::before {
    display: none;
}


.section-item {
    position: relative;
    padding-right: 30px;
    /* רווח מימין */
    margin: 10px 0;
    direction: rtl;
}

.section-item::before {
    content: counter(section-counter);
    counter-increment: section-counter;
    position: absolute;
    right: 0;
    width: 24px;
    height: 24px;
    background-color: #ff6b35;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

/* אתחול המונה */
.section-list {
    counter-reset: section-counter;
    padding-right: 10px;
}

/* סעיפים עם אותיות במקום מספרים */
.section-item-alpha::before {
    content: counter(section-counter, hebrew);
    /* או lower-alpha לאותיות לועזיות */
}

/* תתי-סעיפים */
.subsection-item {
    padding-right: 50px;
    /* indentation כפול */
    margin: 8px 0;
    position: relative;
}

.subsection-item::before {
    content: counter(subsection-counter, lower-alpha) ")";
    counter-increment: subsection-counter;
    position: absolute;
    right: 30px;
    color: #d44326;
    font-weight: 600;
}

.section-item .subsection-list {
    counter-reset: subsection-counter;
}

/* וריאציה פשוטה יותר ללא מספור אוטומטי */
.section-simple {
    padding-right: 25px;
    margin: 10px 0;
    direction: rtl;
    margin-top: 30px;
}

.section-number {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #ff6b35;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
}

.my-svg {
    width: 40%;
    /* Fills the container's width */
    height: auto;
    /* Maintains the aspect ratio */
}


/* === MOBILE RESPONSIVE STYLES === */
/* This block applies *only* to screens 768px wide or smaller */
@media (max-width: 768px) {

    /* Add padding to body to prevent text touching edges */
    body {
        padding: 0 10px;
    }

    /* Stack student info fields vertically */
    .student-info {
        flex-direction: column;
        gap: 10px;
    }

    .info-field {
        min-width: unset;
        /* Allow fields to be full width */
        width: 100%;
    }

    /* Reduce header padding and title font size */
    .header-section {
        padding: 15px;
    }

    h1 {
        font-size: 1.6em;
        /* Smaller title */
    }

    /* Make problem grid stack into 1 column */
    .problem-grid {
        grid-template-columns: 1fr;
        /* The most important change! */
        width: 100%;
        /* Use full width */
        padding: 15px;
        gap: 20px;
    }

    /* Adjust padding for standard problems */
    .problem-container {
        padding: 15px;
    }

    /* Stack the content *inside* each compact problem */
    .problem-expression {
        flex-direction: column;
        /* Stack text and answer box */
        /* align-items: flex-start; */ /* Changed from flex-start */
        align-items: center;
        /* Added to center stacked items */
        gap: 12px;
        font-size: 1.1em;
        width: 100%;
        /* Ensure it fills the box */
    }

    .problem-expression .answer-box {
        margin: 0;
        /* Remove side margins */
    }

    /* General Font Size Reductions */
    .question-text {
        font-size: 1.3em;
    }

    .math-text {
        font-size: 1.2em;
        text-align: center;
        /* Explicitly center math text on mobile */
    }

    .problem-content {
        font-size: 15px;
        line-height: 1.7;
    }

    .answer-label {
        font-size: 1.3em;
    }


    .items-list {
        font-size: 1.2em;
    }

    .info-box {
        font-size: 16px;
        padding: 12px;
    }

    .site-footer {
        font-size: 18px;
        padding: 12px;
    }

    /* Make SVGs larger and centered */
    .my-svg {
        width: 60%;
        /* Much larger for mobile */
        margin: 15px auto;
        /* Ensures centering */
    }

    /* Adjust table fonts to be smaller */
    .table-style th,
    .table-style td {
        padding: 5px;
        font-size: 12px;
    }

    /* Adjust numbered list padding */
    .section-item {
        padding-right: 35px;
        /* Ensure space for number */
    }

    .subsection-item {
        padding-right: 45px;
    }
}

