* { box-sizing: border-box; }
/* Макет для Personal Info */
.personal-info-split {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.personal-info-split .left-col {
    flex: 1 1 300px; /* Займає мінімум 300px, тягнеться */
}

.personal-info-split .right-col {
    flex: 1 1 250px; /* Трохи вужча за ліву */
    background-color: #f8f9fa; /* Світло-сірий фон для контрасту */
    padding: 15px;
    border: 1px dashed #ccc;
    border-radius: 4px;
}

/* Рядок мови */
.language-row {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    align-items: center; /* Центрує input, select та кнопку по вертикалі */
}

/* Стиль для випадаючого списку */
.prof-select {
    padding: 6px;
    font-family: monospace;
    border: 1px solid #ccc;
    background-color: white;
}

/* Уніфікована червона кнопка видалення для дрібних рядків */
.del-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 8px;
    cursor: pointer;
    font-weight: bold;
    height: 100%; /* Щоб була однієї висоти з інпутами */
}

body {
    font-family: monospace;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 800px; /* Default width for feedback/keywords pages */
    transition: max-width 0.3s ease;
}

.app-container.wide {
    max-width: 1300px; /* Wider container for form + inline PDF preview */
}

h1 { text-align: center; margin-bottom: 16px; font-size: 2.2rem; }

.section {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    width: 100%;
    text-align: left;
    position: relative;
}

.job-block, .edu-block {
    border-left: 3px solid #007bff;
    padding-left: 15px;
    margin-bottom: 20px;
    position: relative;
}

label {
    display: inline-block;
    width: 120px;
    margin-bottom: 8px;
    font-weight: bold;
}

/* Form Inputs */
.form-input {
    margin-bottom: 8px;
    width: 300px;
    font-family: monospace;
    padding: 6px 8px;
    border: 1px solid #ccc;
    outline: none;
}

.form-input:focus {
    border-color: #007bff;
}

.form-input-wide { 
    width: 100%; 
    max-width: 550px; 
}

button { 
    cursor: pointer; 
    margin: 5px 0; 
    font-family: monospace;
}

.btn { 
    padding: 10px 20px; 
    font-weight: bold; 
    background-color: #007bff; 
    color: white; 
    margin-right: 5px; 
}

.roles-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.role-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 600px;
}

.roles-wrapper textarea {
    flex: 1;
    font-family: monospace;
    padding: 8px;
    border: 1px solid #ccc;
    resize: vertical;
    line-height: 1.4;
    outline: none;
}

.roles-wrapper textarea:focus {
    border-color: #007bff;
}

/* Split layout container */
.split-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
}

.form-pane {
    flex: 1.2;
    min-width: 0;
}

.preview-pane {
    flex: 0.8;
    position: sticky;
    top: 20px;
    background: white;
    border: 1px solid #ccc;
    padding: 15px;
    min-width: 320px;
}

.preview-pane iframe {
    width: 100%;
    height: 700px;
    border: 1px solid #ddd;
    background-color: #fff;
}

/* dialog modal */
dialog {
    background: white;
    border: 3px double #000;
    padding: 20px;
    font-family: monospace;
    width: min(400px, 92vw);
    box-shadow: 5px 5px 0 #888;
}

.modal-field { margin-bottom: 12px; }

.modal-field label {
    display: block;
    width: auto;
    margin-bottom: 4px;
}

.modal-field input {
    width: 100%;
    font-family: monospace;
    padding: 6px 8px;
    border: 1px solid #ccc;
}

#modal-error {
    color: red;
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: none;
}

/* Spinner style for loading state */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result container styling */
.result-card {
    background: #eef7ff;
    border-left: 4px solid #17a2b8;
    padding: 15px;
    margin-bottom: 15px;
    width: 100%;
}

/* Responsive */
@media (max-width: 1000px) {
    .split-layout {
        flex-direction: column;
    }

    .preview-pane {
        width: 100%;
        position: static;
    }

    .preview-pane iframe {
        height: 500px;
    }
}

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

    label {
        display: block;
        width: 100%;
        margin-bottom: 4px;
    }

    .form-input {
        width: 100% !important;
        display: block;
        margin-bottom: 12px;
    }

    .btn {
        display: flex;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
        text-align: center;
        padding: 12px 20px;
    }
}
