body {
    font-family: Arial, sans-serif;
    margin: 10px;
}

.date-display {
    position: absolute; /* Абсолютно позициониране спрямо родителя */
    top: 10px;          /* Отстояние от горния ръб на родителя */
    left: 10px;         /* Отстояние от левия ръб на родителя */
    font-size: 14px;
    color: #333;
    background-color: #f9f9f9; /* Фон, за да се вижда по-добре */
    padding: 5px;              /* Подходящо отстояние */
    border-radius: 5px;        /* Закръглени ъгли */
    border: 1px solid #ccc;    /* Рамка за по-добра видимост */
}

.calculator {
    position: relative; /* Важно: родителят трябва да има relative позиция */
    max-width: 800px;
    margin: 0 auto;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9f9;
}

.calculator h2 {
    text-align: center;
    margin-bottom: 8px;
}

.calculator label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

.calculator input,
.calculator select {
    width: 100%;
    padding: 3px;
    margin-bottom: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.result {
    margin-top: 8px;
    font-weight: bold;
    text-align: center;
}

.input-group {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.input-group input,
.input-group select {
    width: calc(25% - 4px);
    margin-right: 4px;
}

.input-group input.narrow-input {
    width: calc(25% - 4px);
}

.input-group select.wide-select {
    width: calc(35% - 4px);
}

.input-group input:last-child,
.input-group select:last-child {
    margin-right: 0;
}

.dividers,
.wings {
    margin-top: 4px;
}

.dividers h3,
.wings h3 {
    margin-bottom: 4px;
}

.divider-group {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.divider-group input {
    width: calc(25% - 4px);
    margin-right: 4px;
}

.divider-group input:last-child {
    margin-right: 0;
}

.wing-group {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.wing-group input {
    width: calc(25% - 4px);
    margin-right: 4px;
}

.wing-group input:last-child {
    margin-right: 0;
}

.type-color-glass-group {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 6px;
}

.type-color-glass-group>div {
    width: 33%;
}

.type-color-glass-group select {
    width: 100%;
    padding: 3px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.custom-glass-fields {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 6px;
}

.custom-glass-fields input {
    width: 33%;
}

.red-text {
    color: red;
}

.installation-demolition-group {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 6px;
}

.installation-demolition-group>div {
    width: 33%; /* Променете ширината на всяко поле за да се поберат трите полета */
}

.installation-demolition-group select {
    width: 100%;
    padding: 3px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.sills-group {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 6px;
}

.sills-group>div {
    width: 33%;
}

.sills-group select {
    width: 100%;
    padding: 3px;
    border: 1px solid #ccc;
    border-radius: 5px;
}




.button-container {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.button-container button {
    flex: 1;
    padding: 8px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.button-container button:hover {
    background-color: #218838;
}

.frame h3 {
    margin-bottom: 2px;
}

.result p {
    margin: 2px 0;
}

.frame {
    margin-bottom: 4px;
}

.dividers {
    margin-bottom: 4px;
}

.help-panel {
    display: none;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.help-panel h3 {
    margin-top: 0;
}

.help-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
}

.help-button:hover {
    background-color: #218838;
}

.invalid {
    border: 1px solid red;
    /* Стил за невалидни полета */
}


@media (max-width: 768px) {
    .calculator {
        max-width: 100%;
        padding: 4px;
    }

    .input-group {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
    }

    .input-group input,
    .input-group select {
        width: calc(47% - 2.5px);
        margin-right: 0;
        margin-bottom: 5px;
    }

    .input-group input.narrow-input {
        width: calc(47% - 2.5px);
    }

    .input-group select.wide-select {
        width: calc(47% - 2.5px);
    }

    .divider-group {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
    }

    .divider-group input {
        width: calc(47% - 2.5px);
        margin-right: 0;
        margin-bottom: 5px;
    }

    .wing-group {
        display: flex;
        flex-direction: row; /* Промяна на flex-direction на row */
        flex-wrap: wrap; /* Разрешаване на пренасяне на нов ред */
        gap: 5px;
    }

    .wing-group input {
        width: calc(47% - 2.5px); /* Задаване на ширина за две полета на ред */
        margin-right: 0;
        margin-bottom: 5px;
    }

    .type-color-glass-group {
        flex-direction: column;
    }

    .type-color-glass-group>div {
        width: 100%;
    }

    .custom-glass-fields {
        flex-direction: column;
    }

    .custom-glass-fields input {
        width: 100%;
        margin-bottom: 5px;
    }

    .installation-demolition-group {
        flex-direction: column;
    }

    .installation-demolition-group>div {
        width: 100%;
    }

    .sills-group {
        flex-direction: column;
    }

    .sills-group>div {
        width: 100%;
    }

    .button-container {
        flex-direction: column;
    }

    .button-container button {
        margin-bottom: 5px;
    }
}