* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    background-color: #fff;
    color: #fff;
}

.footer > p
{
    color: #2f2f2f;
    padding-left: 15%;
    padding-right: 15%;
    text-align: center;
    padding-top: 20px;
 
}

#main-container {
    flex: 1;
    display: flex;
    gap: 20px;
    padding: 20px;
    height: 800px;
    max-height: calc(100vh - 160px);
    box-sizing: border-box;
}

.resizable {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    resize: horizontal;
    overflow: auto;
    height: 800px;
}

#chat {
    width: 400px;
    min-width: 400px;
    max-width: 600px;
    height: 800px;
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

#messages {
    flex-grow: 1;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #fafafa;
    color:#2f2f2f;
}

#messages div {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #e6f7ff;
    border-radius: 8px;
}

#input-container {
    display: flex;
    flex-direction: column;
}

#input-wrapper {
    flex-grow: 1;
}

#input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
    resize: none;
}

#input:focus {
    border-color: #b42325;
}

#send-button {
    margin-top: 10px;
    padding: 12px;
    background-color: #b42325;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    font-family: Montserrat;
    font-weight: 700;
}

#send-button:hover {
    background-color: #2f2f2f;
}

#diagram {
    position: relative;
    flex: 1;
    min-width: 400px;
    height: 800px;
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#download-button {
    display: none;
    padding: 12px;
    background-color: #b42325;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    font-family: Montserrat;
    font-weight: 700;
    position: absolute;
    right: 20px;
    bottom: 20px;
}

#download-button:hover {
    background-color: #2f2f2f;
}

h2 {
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
    color: #2f2f2f;
}

svg {
    max-width: 100%;
    height: auto;
    font-family: Montserrat !important;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 8px solid rgba(0, 0, 0, 0.1);
    border-top: 8px solid #b42325;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    color: #2f2f2f;
    text-align: center;
    margin-top: 20px;
}

#loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 300px;
}

#loading-text {
    margin-top: 20px;
    font-family: var(--font-family);
    color: #2f2f2f;
    font-size: 16px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #b42325;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

#logo {
    width: 200px;
    height: auto;
}

/* Mobilos nézet */
@media (max-width: 768px) {
    body {
        padding: 10px;
        overflow: auto;
    }
    .footer > p
{
    color: white;
    padding-left: 1%;
    padding-right: 1%;
    text-align: center;
    padding-top: 20px;
 
}

    #main-container {
        height: auto;
        max-height: none;
        flex-direction: column;
    }

    #chat {
        max-width: 100%;
        width: 100%;
        height: auto;
    }

    #messages {
        min-height:0px;
        max-height: 300px;
        overflow-y: auto;
    }

    #input {
        min-height: 150px;
    }

    #diagram {
        width: 100%;
        min-height: 300px;
        height: auto;
    }

    #download-button {
        position: static;
        width: 100%;
        margin-top: 10px;
    }

    #input::placeholder {
        font-family: 'Montserrat', sans-serif;
        font-size: 20px;
    }

    .zoom-controls {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 10px;
        justify-content: center;
    }

    #zoom-slider {
        width: 150px;
    }
}

/* Tablet nézet */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding: 15px;
    }

    #main-container {
        gap: 15px;
    }
}

/* Fekvő mód mobilon */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 5px;
    }

    #main-container {
        flex-direction: row;
    }

    #chat {
        max-width: 40%;
    }

    #diagram {
        flex: 3;
    }

    #input {
        min-height: 60px;
    }
}

#svg-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.diagram-image {
    max-width: 100%;
    height: auto;
   
    object-fit: contain;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    #main-container {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    #chat {
        max-width: 100%;
    }

    #diagram {
        padding: 10px;
        width: 100%;
    }

    #svg-container {
        margin: 10px 0;
        min-height: 150px;
    }

    #download-button {
        position: static;
        width: 100%;
        margin-top: 10px;
    }

    #svg-container {
        margin-bottom: 80px;
    }

    .diagram-image {
        width: 100%;
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    color: #b42325; /* Bordó */
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 20px;
}

.input-group {
    margin: 15px 0;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    border-color: #b42325; /* Bordó */
    outline: none;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.primary-btn, .secondary-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
}

.primary-btn {
    background-color: #b42325; /* Bordó */
    color: white;
}

.primary-btn:hover {
    background-color: #8e1c1e; /* Sötétebb bordó */
}

.secondary-btn {
    background-color: #f0f0f0;
    color: #333;
}

.secondary-btn:hover {
    background-color: #e0e0e0;
}

#modal-loading {
    text-align: center;
    padding: 20px;
    font-family: 'Montserrat', sans-serif;
}

#modal-loading p {
    margin-top: 10px;
    color: #b42325; /* Bordó */
    font-weight: 500;
}

/* Floating button styles */
.diagram-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    padding-bottom: 80px;
}

.diagram-container img,
.diagram-container svg {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.floating-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    z-index: 100;
    transition: all 0.3s ease;
}

.floating-button:hover {
    background-color: #45a049;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.floating-button i {
    font-size: 18px;
}

/* Loading spinner styles */
#modal-loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #b42325;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#send-email-button {
    animation: fadeIn 0.3s ease-out;
}

/* Jobb oldali oszlop pozicionálása */
.right-column {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    height: 100%;
}

/* SVG konténer */
#svg-container {
    flex: 1;
    min-height: 200px;
    margin-bottom: 60px;
}

/* E-mail küldés gomb újrapozicionálása */
#send-email-button {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 12px 24px;
    background-color: #b42325;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    z-index: 100;
}

#send-email-button:hover {
    background-color: #8e1c1e;
}

/* Loading konténer középre igazítása */
#loading-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 300px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #b42325;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

#loading-text {
    margin-top: 20px;
    font-family: var(--font-family);
    color: #2f2f2f;
    font-size: 16px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Checkbox csoport stílusok */
.checkbox-group {
    margin: 20px 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
}

.checkbox-group label {
    color: #333;
    line-height: 1.4;
    cursor: pointer;
}

.privacy-link {
    color: #b42325;
    text-decoration: none;
    font-weight: 500;
}

.privacy-link:hover {
    text-decoration: underline;
}

/* Hibaüzenet a checkbox csoporthoz */
.checkbox-group .error-message {
    margin-bottom: 5px;
}

/* Hibaüzenet stílusok */
.error-message {
    color: #b42325; /* Bordó */
    font-size: 12px;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 5px;
    font-weight: 500;
    min-height: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

/* Input mezők error állapota */
.input-group input.error {
    border-color: #b42325 !important; /* Bordó keret */
    background-color: rgba(180, 35, 37, 0.05); /* Nagyon halvány bordó háttér */
}

/* Checkbox error állapota */
.checkbox-group.error .checkbox-container {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #b42325; /* Bordó keret */
    background-color: rgba(180, 35, 37, 0.05); /* Nagyon halvány bordó háttér */
}

/* Modal loading állapot */
#modal-loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

#modal-loading .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #b42325;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

#modal-loading p {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    margin-top: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal tartalom */
.modal-main-content {
    padding: 20px;
}

.modal-content {
    position: relative;
    min-height: 300px;
}

.info-box {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    padding: 15px 20px;
    background-color: #fff;
    border: 2px solid #b42325;
    border-radius: 8px;
    color: #2f2f2f;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    font-family: 'Montserrat', sans-serif;
    text-align: left;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .info-box {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        margin-bottom: 20px;
    }
}

#input::placeholder {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
}

@media (max-width: 768px) {
    #input::placeholder {
        font-size: 16px;
    }
}

.zoom-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

#zoom-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}

#zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #b42325;
    border-radius: 50%;
    cursor: pointer;
}

#zoom-value {
    font-size: 12px;
    color: #2f2f2f;
    min-width: 45px;
    font-family: 'Montserrat', sans-serif;
}

.diagram-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.diagram-container img,
.diagram-container svg {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.draggable {
    cursor: grab;
    transform-origin: center;
    transition: transform 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.draggable:active {
    cursor: grabbing;
}

#diagram {
    position: relative;
}

/* Gomb konténer a két gomb számára */
.diagram-buttons {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    z-index: 100;
    width: auto;
}

/* Alap gomb stílusok mindkét gombhoz */
.diagram-button {
    position: static;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

/* Email küldés gomb */
#send-email-button {
    background-color: #b42325;
    color: white;
    position: static;
}

/* Export gomb */
#export-button {
    background-color: #e0e0e0;
    color: #666;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Lakat ikon stílusa */
.lock-icon {
    font-size: 14px;
}
