/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'TTNorms Regular', Verdana, sans-serif;
    font-size: 12px;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: white;
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    body {
        padding: 10px;
        display: block;
        background: white;
    }
    
    .container {
        width: 100%;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    /* Улучшение шапки для мобильных */
    .header {
        flex-direction: column;
        text-align: center;
        padding: 15px 20px !important;
    }
    
    .contacts {
        margin-bottom: 15px;
    }
    
    .logo {
        width: 150px;
    }
    
    /* Улучшение полей ввода */
    .project-name-input {
        font-size: 16px !important; /* Увеличение для мобильных */
        padding: 15px 12px !important;
    }
    
    /* Адаптация двухколоночной структуры */
    .two-column-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .upload-column, .instructions-column {
        width: 100%;
    }
    
    /* Улучшение кнопок для касания */
    .upload-btn, .print-btn, .custom-upload-btn, #showMoreBtn, .text-toggle-btn {
        padding: 12px 20px !important;
        min-height: 44px; /* Минимальный размер для касания */
        font-size: 14px !important;
    }
    
    /* Адаптация секций состава кровли */
    .composition-columns {
        flex-direction: column;
    }
    
    .composition-list-container, .composition-image {
        width: 100%;
    }
    
    /* Улучшение отображения радио-кнопок */
    .composition-list-item, .composition-list-item1 {
        padding: 12px 8px;
    }
    
    .composition-list-item label, .composition-list-item1 label {
        display: flex;
        align-items: center;
    }
    
    input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }
    
    /* Адаптация изображений */
    .composition-image-placeholder {
        min-height: 150px;
    }
    
    /* Улучшение секций с описанием */
    .slope-columns {
        flex-direction: column;
    }
    
    .section-title {
        font-size: 18px !important;
        padding: 0 15px;
    }
    
    .section-title:after {
        width: 60px;
    }
    
    /* Улучшение статусной строки */
    .status-bar {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 15px;
    }
    
    .status-item {
        margin: 5px 10px;
    }
    
    /* Адаптация действий */
    .actions {
        justify-content: center;
        padding: 15px;
    }
    
    /* Улучшение модального окна для мобильных */
    .modal-content {
        max-width: 95%;
        max-height: 80%;
    }
    
    .close {
        top: 10px;
        right: 15px;
        font-size: 35px;
    }
    
    /* Улучшение текста рекомендаций */
    .recommendations-text {
        padding: 0 10px;
        font-size: 14px;
    }
    
    /* Улучшение отступов для мобильных */
    .roof-composition-section,
    .slope-layout-section,
    .parapet-section,
    .funnel-section,
    .penetration-section,
    .vent-section,
    .recommendations-section {
        padding: 15px 20px !important;
    }
    
    .project-name-section,
    .roof-plan-section {
        padding: 15px 20px !important;
    }
    
    /* Специфические улучшения для мобильных */
    .step-number {
        margin-bottom: 15px;
        font-size: 14px;
    }
    
    .upload-text {
        font-size: 14px;
    }
    
    .instructions h3 {
        font-size: 16px;
    }
    
    .instructions p {
        font-size: 13px;
    }
    
    .composition-category-title {
        font-size: 15px;
    }
}

/* Стили для очень маленьких экранов */
@media (max-width: 480px) {
    .container {
        border-radius: 0;
    }
    
    .header {
        padding: 10px 15px !important;
    }
    
    .contacts p:first-child {
        font-size: 14px !important;
    }
    
    .contacts p {
        font-size: 11px !important;
    }
    
    .project-name-input {
        font-size: 14px !important;
    }
    
    .upload-text {
        font-size: 13px;
    }
    
    .section-title {
        font-size: 16px !important;
    }
    
    .status-item {
        font-size: 11px;
    }
    
    .composition-list-item, .composition-list-item1 {
        font-size: 13px;
    }
}

/* Остальные стили остаются без изменений */
@page {
margin: 0; /* Убираем поля страницы */
}
/* Стили для печати */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        border-radius: 0;
        margin: 0; /* Убираем margins у контейнера */
        padding: 0; /* Убираем padding у контейнера */
    }
/* Обеспечиваем правильные отступы для всех секций */
.roof-composition-section,
.slope-layout-section,
.parapet-section,
.funnel-section,
.penetration-section,
.vent-section,
.recommendations-section {
    padding: 15px 30px !important;
    page-break-inside: avoid;
    break-inside: avoid;
}

/* Улучшаем отображение текста рекомендаций */
.recommendations-text {
    font-size: 14px !important;
    line-height: 1.5 !important;
}
.recommendations-text p, 
.recommendations-text li {
    margin-bottom: 8px !important;
    font-size: 14px !important;
}
/* Убедимся, что все важные секции видны */
.recommendations-section {
    display: block !important;
    page-break-before: auto;
}

/* Улучшаем читаемость текста */
.recommendations-text p, 
.recommendations-text li {
    margin-bottom: 8px !important;
    font-size: 14px !important;
}
    /* Стили для номеров шагов */
.step-number {
display: block;
background: #FFD700; /* Ярко-желтый фон */
color: #000000; /* Черный текст */
padding: 5px 20px;
border-radius: 12px;
font-size: 14px;
font-weight: 900; 
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
margin-bottom: 10px;
}
/* Улучшаем видимость заголовков */
.print-title {
    font-size: 18px !important;
    font-weight: bold;
    margin: 15px 0 10px 0 !important;
    padding: 0 0 5px 0 !important;
    border-bottom: 2px solid #2c3e50 !important;
}
    
    .no-print {
        display: none !important;
    }
    
    .print-section {
        display: block !important;
    }
    
    .print-title {
        font-size: 18 !important;
        margin-top: 5px !important;
        margin-bottom: 5px !important;
        padding: 5px 0 !important;
        text-align: left !important;
        padding-left: 30px !important;
    }
    
    .print-plan-label {
        display: block !important;
        text-align: left;
        font-size: 18px !important;
        font-weight: bold;
        margin-top: 5px;
        margin-bottom: 5px;
        padding-left: 30px;
    }
    
    .header {
        padding: 10px 30px !important;
        border-bottom: 1px solid #ccc !important;
    }
    
    .contacts {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    .contacts p:first-child {
        font-size: 16px !important;
        margin-bottom: 2px !important;
    }
    
    .logo {
        font-size: 24px !important;
    }
    
    .project-name-section {
        padding: 10px 30px 5px !important;
        border-bottom: 1px solid #ccc !important;
    }
    
    .roof-plan-section {
        padding: 10px 30px 50px !important;
    }
    
    .image-container {
        margin-top: 5px !important;
        margin-bottom: 5px !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    .two-column-layout {
        display: block !important;
    }
    
    .composition-text {
        display: none !important;
    }
    
    .print-composition-text {
        display: block !important;
        white-space: pre-wrap;
        margin-bottom: 15px;
    }
    
    .composition-image-placeholder {
        border: 1px solid #ddd !important;
        height: auto !important;
        min-height: 200px;
    }
    
                .print-vent-container {
        display: block !important;
        width: 100%;
        page-break-inside: avoid;
    }
    
    .print-vent-title {
        width: 100%;
        text-align: center;
        font-weight: bold;
        font-size: 16px;
        margin-bottom: 15px;
        padding: 10px 0;
        border-bottom: 1px solid #ccc;
    }
    
    .print-vent-image {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
    
    .print-vent-image img {
        max-width: 100%;
        max-height: 100%;
        display: block;
        margin: 0 auto;
        border: 1px solid #ddd;
        padding: 10px;
    }
.print-penetration-title {
width: 100%;
text-align: center;
font-weight: bold;
font-size: 16px;
margin-bottom: 15px;
padding: 10px 0;
border-bottom: 1px solid #ccc;
}

.print-penetration-image {
width: 100%;
text-align: center;
margin-top: 10px;
}

.print-penetration-image img {
max-width: 100%;
max-height: 100%;
display: block;
margin: 0 auto;
border: 1px solid #ddd;
padding: 10px;
}
.print-penetration-container {
display: block !important;
width: 100%;
page-break-inside: avoid;
}
/* Стили для печати узла парапета */
.print-parapet-title {
    width: 100%;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #ccc;
}

.print-parapet-image {
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

.print-parapet-image img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
    border: 1px solid #ddd;
    padding: 10px;
}

/* Стили для печати узла воронки */
.print-funnel-title {
    width: 100%;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #ccc;
}

.print-funnel-image {
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

.print-funnel-image img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
    border: 1px solid #ddd;
    padding: 10px;
}

/* Скрываем старую структуру для этих секций */
.print-parapet-container,
.print-funnel-container,
.print-penetration-container,
.print-vent-container {
    display: block !important;
    page-break-inside: avoid;
}     
    /* Скрываем старую структуру */
    .print-penetration-container .print-composition-container {
        display: none !important;
    }
    /* Добавляем стили для уменьшения отступов в других секциях */
.slope-layout-section,
.parapet-section,
.funnel-section,
.penetration-section,
.vent-section {
padding-left: 5px !important;
padding-right: 5px !important;
}

    /* Стили для печатной версии состава кровли */
    .composition-columns {
        display: none !important;
    }
    
    .print-composition-container {
        display: flex !important;
        width: 100%;
        margin-top: 15px;
        padding: 0 15px;
    }
    
    .print-composition-name {
        width: 25%;
        padding: 10px;
        font-weight: bold;
        font-size: 14px;
    }
    
    .print-composition-image {
        width: 75%;
        padding: 10px;
    }
    
/* Ограничение высоты изображений при печати */
.print-composition-image img,
.print-parapet-image img,
.print-funnel-image img,
.print-penetration-image img,
.print-vent-image img,
#previewImage {
max-height: 400px !important;
width: auto !important;
max-width: 100% !important;
object-fit: contain;
}

    /* Печать скрытых строк */
    .hidden-row {
        display: block !important;
    }
    .show-more-container {
        display: none !important;
    }
}

/* Шапка документа */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    background: white;
    border-bottom: 1px solid #eaeaea;
}

.contacts {
    font-size: 12px;
    line-height: 1.4;
}

.contacts p:first-child {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
    color: #222;
}

.logo {
    width: 188px;
    height: auto;
}

/* Секция названия проекта */
.project-name-section {
    padding: 10px 30px;
    border-bottom: 1px solid #eaeaea;
}

.project-name-input {
    width: 100%;
    padding: 12px 10px;
    font-size: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
    transition: all 0.3s ease;
    outline: none;
}

.project-name-input:focus {
    border-color: #2c3e50;
    background: white;
    box-shadow: 0 0 0 1px rgba(44, 62, 80, 0.2);
}

.print-title {
    display: none;
    font-weight: bold;
    padding: 5px 0;
    text-align: left;
    font-size: 16px;
    padding-left: 30px;
}

/* Секция плана кровли */
.roof-plan-section {
    padding: 10px 30px;
}

.two-column-layout {
    display: flex;
    gap: 30px;
}

.upload-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.instructions-column {
    flex: 1;
}

.upload-container {
    border: 3px dashed #e0e0e0;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-container:hover {
    border-color: #2c3e50;
    background: #f0f8ff;
}

.upload-container.active {
    border-color: #2c3e50;
    background: white;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 16px;
    margin-bottom: 10px;
    color: #555;
}

.upload-btn {
    display: inline-block;
    background: #2c3e50;
    color: white;
    padding: 10px 30px;
    font-size: 12px;
    border-radius: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    margin-top: 10px;
}

.upload-btn:hover {
    background: #1a252f;
    transform: translateY(-2px);
}

#imageInput {
    display: none;
}

.image-container {
    display: none;
    margin-top: 20px;
    border: 1px solid #eaeaea;
    border-radius: 1px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
}

.image-container img {
    width: 100%;
    display: block;
}

.print-plan-label {
    display: none;
    text-align: left;
    padding-left: 30px;
    font-size: 16px;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    padding: 20px 30px;
    background: #f9f9f9;
    border-top: 2px solid #eaeaea;
}

.print-btn {
    background: #2c3e50;
    color: white;
    padding: 12px 35px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.print-btn:hover {
    background: #1a252f;
    transform: translateY(-2px);
}

.instructions {
    background: white;
    padding: 10px;
    border-radius: 1px;
    height: 100%;
}

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
    text-align: center;
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 10px;
}

.instructions p {
    font-size: 12px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 10px;
}

.print-section {
    display: none;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    background: #f0f8ff;
    border-top: 2px solid #eaeaea;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #c8f133;
}

.section-title {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
    font-weight: bold;
}

.section-title:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #2c3e50;
    border-radius: 2px;
}

/* Обновлённые стили для секции состава кровли */
.roof-composition-section {
    padding: 20px 10px;
    border-top: 1px solid #eaeaea;
}

.composition-columns {
    display: flex;
    gap: 20px;
}

.composition-list-container {
    flex: 1;
    min-width: 50%;
}

.composition-category {
    padding: 10px;
    border-top: 1px solid #eaeaea;
}
.composition-category-title {
    font-weight: bold;
    margin-bottom: 10px;
    padding: 0px;
    font-size: 14px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
}

.composition-list {
    list-style: none;
    padding: 10px;
    margin: 0;
}

.composition-list-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.show-more-container {
    text-align: center;
    margin: 15px 0;
}

#showMoreBtn {
    background: #2c3e50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#showMoreBtn:hover {
    background: #1a252f;
    transform: translateY(-2px);
}

.custom-solution-separator {
    border-top: 1px solid #eaeaea;
    margin: 20px 0;
}

.custom-solution {
    margin-top: 20px;
}

.hidden-row {
    display: none;
}

.composition-image {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50%;
}

.composition-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #777;
}

.composition-image-placeholder img {
    width: 100px;
    opacity: 0.5;
    margin-bottom: 15px;
}

.composition-image img {
    max-width: 100%;
    max-height: 100%;
    display: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.composition-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.composition-image .active {
    display: block;
}

/* Стили для загрузки своего изображения */
.custom-image-upload {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 8px;
    border: 1px dashed #2c3e50;
}

.custom-upload-btn {
    background: #2c3e50;
    color: white;
    padding: 8px 20px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 10px;
}

.custom-upload-btn:hover {
    background: #1a252f;
}

#customImageInput {
    display: none;
}

.custom-image-preview {
    display: none;
    margin-top: 15px;
    max-width: 100%;
    max-height: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.custom-image-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Стили для секции раскладки разуклонки */
.slope-layout-section {
    padding: 20px 30px;
    border-top: 1px solid #eaeaea;
}

.composition-list-item1 {
    padding: 10px;
}

.slope-columns {
    display: flex;
    gap: 20px;
}

.slope-description {
    flex: 1;
    padding: 15px;
}

.slope-description p {
    line-height: 1.6;
    margin-bottom: 10px;
}

.slope-image {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slope-image img {
    width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.slope-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.penetration-section  {
    padding-left: 20px;
}
.vent-section {
    padding-left: 20px;    
}

.recommendations-section {
    display: block !important;
    page-break-before: auto;
}

.recommendations-container {
    position: relative;
    padding: 0px 20px;
}

.recommendations-text {
    max-height: 240px; /* Ограничение примерно 10 строк */
    overflow: hidden;
    transition: max-height 0.3s ease;
    line-height: 1.6;
}

.recommendations-text.expanded {
    max-height: none;
}

.recommendations-text p {
    margin-bottom: 12px;
}

.recommendations-text ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.recommendations-text li {
    margin-bottom: 6px;
}

.text-toggle-container {
    text-align: center;
    margin-top: 15px;
}

.text-toggle-btn {
    background: #2c3e50;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.text-toggle-btn:hover {
    background: #1a252f;
}

/* При печати всегда показываем полный текст */
@media print {
    .step-number {
        display: none !important;
    }    
    .recommendations-text {
        max-height: none !important;
    }
    
    .text-toggle-container {
        display: none !important;
    }
}
/* Стили для модального окна - БЕЛЫЙ ФОН */
/* Обновленные стили для модального окна */
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.98);
overflow: auto; /* Добавляем возможность прокрутки */
}

.modal-content {
margin: 0 auto;
display: block;
max-width: 90%;
max-height: 90%;
object-fit: contain;
position: relative;
top: 50%;
transform: translateY(-50%);
border: 1px solid #ddd;
box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

.close {
position: fixed; /* Изменяем на fixed для лучшего позиционирования */
top: 20px;
right: 35px;
color: #333;
font-size: 40px;
font-weight: bold;
transition: 0.3s;
cursor: pointer;
text-shadow: 0 1px 2px rgba(0,0,0,0.2);
z-index: 1001; /* Убедимся, что крестик поверх всего */
}

.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}

/* Добавим медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
.modal-content {
    max-width: 95%;
    max-height: 95%;
}

.close {
    top: 15px;
    right: 20px;
    font-size: 30px;
}
}

/* Унифицированные отступы для всех секций */
.parapet-section, 
.funnel-section {
    padding: 20px 30px;
    border-top: 1px solid #eaeaea;
}