/* === ЗАГАЛЬНІ СТИЛІ === */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* === ЄДИНА ВЕРХНЯ ПАНЕЛЬ (HEADER) === */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}
.header-left, .header-center, .header-right {
    flex: 1;
}
.header-left {
    display: flex;
    justify-content: flex-start;
}
.site-logo img {
    height: 50px;
    width: auto;
}
.header-center {
    text-align: center;
}
.header-center h1 { 
    font-size: 1.8em; 
    margin: 0; 
}
.main-title-ukraine {
    background: linear-gradient(to bottom, #005BBB 50%, #FFD500 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}
.header-center p { font-size: 1em; color: #7f8c8d; margin: 5px 0 0 0; }
.header-right {
    display: flex;
    justify-content: flex-end;
}
.top-controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lang-switcher { display: flex; }
.lang-switcher .lang-btn {
    padding: 8px 12px; margin: 0 2px; flex-grow: 1; text-align: center;
    border: 1px solid #ccc; background: none; border-radius: 5px; cursor: pointer;
}
.lang-switcher .lang-btn.active { background-color: #3498db; color: white; border-color: #3498db; }
.btn-danger { background-color: #e74c3c; color: white; border: none; width: 100%; box-sizing: border-box; }

/* === КАРТКИ ТА КОНТЕНТ === */
.card {
    background-color: #ffffff; border-radius: 12px; padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); border: 1px solid #e0e0e0;
}
.card h2 { text-align: center; margin-top: 0; margin-bottom: 20px; color: #2c3e50; }
.card-description { text-align: center; color: #7f8c8d; margin-bottom: 20px; }
textarea {
    width: 100%; min-height: 230px; border-radius: 8px; border: 1px solid #ccc;
    box-sizing: border-box; margin-top: 20px; padding: 15px;
    font-family: 'Montserrat', sans-serif; font-size: 1em;
}
.action-buttons-group {
    display: flex; justify-content: space-between; margin-top: 20px;
}
.btn {
    padding: 12px 25px; border-radius: 8px; font-weight: 600; cursor: pointer;
    border: 1px solid #bdc3c7; display: inline-flex; align-items: center;
    justify-content: center; gap: 8px; transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background-color: #3498db; color: white; border-color: #3498db; }
.btn-secondary { background-color: #ecf0f1; color: #34495e; }

/* === СЕЛЕКТОРИ КРАЇН ТА МОВ === */
.content-block { margin-bottom: 30px; }
.option-group-visual { margin-bottom: 20px; }
.visual-selector { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.selector-item {
    cursor: pointer; border: 2px solid #bdc3c7; border-radius: 10px; padding: 8px;
    position: relative; width: 120px; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.flag-container { width: 100%; margin-bottom: 5px; }
.flag-container.rect { height: 60px; }
.flag-container.square { height: 90px; width: 90px; margin: 0 auto 5px; }
.selector-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.selector-item span { font-weight: 600; }
.selector-item .checkmark {
    position: absolute; top: -12px; right: -12px; background-color: white;
    border-radius: 50%; display: flex; opacity: 0; transform: scale(0.5);
    transition: all 0.2s ease-in-out;
}
.material-icons { font-size: 32px; color: #2ecc71; }
.selector-item.selected { border-color: #2ecc71; }
.selector-item.selected .checkmark { opacity: 1; transform: scale(1); }

/* === КНОПКИ ДІЙ === */
.action-buttons-layout { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.main-action-wrapper { width: 100%; text-align: center; }
.btn.main-action { padding: 15px 40px; font-size: 1.2em; }
.secondary-actions-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 15px; width: 100%; max-width: 550px;
}
.btn.secondary-action {
    width: 100%; font-size: 0.9em; padding: 12px 5px; box-sizing: border-box;
}
.btn.completed { background-color: #2ecc71; color: white; border-color: #27ae60; }
.btn.processing { cursor: not-allowed; opacity: 0.7; }

/* === РЕЗУЛЬТАТ === */
.loader-container { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px 0; gap: 15px; }
.loader-container video { max-width: 350px; width: 100%; border-radius: 12px; }
.loader-container .loader-text { font-weight: 500; color: #7f8c8d; }
.comparison-container { display: flex; gap: 20px; }
.comparison-col { flex: 1; min-width: 0; }
.comparison-col h4 { text-align: center; font-weight: 600; color: #34495e; }
.result-text-wrapper {
    background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px;
    padding: 15px; position: relative; height: 70vh; overflow-y: auto; font-size: 0.95em;
}
.result-text-wrapper pre {
    white-space: pre-wrap; word-wrap: break-word; font-family: 'Montserrat', sans-serif;
    margin: 0; line-height: 1.6;
}
.adapted-col-highlight { background-color: #e8f8ef; }
.copy-btn-wrapper { position: sticky; top: -1px; float: right; z-index: 10; padding-left: 10px; }
.result-tools { display: flex; align-items: center; gap: 8px; }
.result-tools .btn { padding: 8px 12px; font-size: 0.82em; white-space: nowrap; }
.open-cv-editor-btn { background-color: #2c3e50; color: #fff; border-color: #2c3e50; }
.open-cv-editor-btn:hover { background-color: #1f2f3f; border-color: #1f2f3f; }
.result-tabs { margin-bottom: 15px; }
.tab-btn { padding: 10px 15px; cursor: pointer; border: 1px solid #ccc; background: #f1f1f1; border-bottom: none; border-radius: 5px 5px 0 0; }
.tab-btn.active { background: #fff; border-bottom: 1px solid #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.find-vacancies-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
}
.search-link-btn {
    min-width: 280px;
    font-size: 1.1em;
    padding: 15px 30px;
    gap: 12px;
}
.search-link-btn svg {
    width: 24px;
    height: 24px;
}

/* === МОДАЛЬНІ ВІКНА === */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6); display: flex; justify-content: center;
    align-items: center; z-index: 1000;
}
.modal-content {
    background-color: white; padding: 30px; border-radius: 12px;
    width: 90%; max-width: 600px;
    text-align: center;
    position: relative;
    padding-bottom: 40px;
}
.close-button {
    position: absolute; top: 10px; right: 20px; font-size: 28px;
    font-weight: bold; cursor: pointer; color: #aaa;
}
.modal-content .action-buttons-group {
    position: relative; bottom: -20px; left: 0; right: 0; justify-content: flex-end;
}

.suggestion-modal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.suggestion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}
.suggestion-btn {
    width: 100%;
    padding: 15px 10px;
    font-size: 1em;
    background-color: #ecf0f1;
    color: #34495e;
    border: 1px solid #bdc3c7;
}
.suggestion-country-select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: 'Montserrat', sans-serif;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
}

/* +++ СТИЛІ ДЛЯ ADZUNA ТА НОВИХ КНОПОК +++ */
.results-divider {
    width: 80%;
    border-top: 1px solid #e0e0e0;
    margin: 40px auto;
}
.results-divider-header {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 20px;
    font-weight: 500;
}
.adzuna-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}
.job-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* *** ЗМІНЕНО *** */
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}
.job-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-5px);
}
.job-card-link { /* *** НОВИЙ СТИЛЬ *** */
    text-decoration: none;
    color: inherit;
    display: block;
    flex-grow: 1; /* Дозволяє посиланню займати вільний простір */
}
.job-card h4 {
    margin: 0 0 10px 0;
    color: #3498db;
    font-size: 1.1em;
}
.job-card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 15px; /* Додано відступ */
}
.job-card-info div {
    display: flex;
    align-items: center;
    gap: 8px;
}
.job-card-info .material-icons {
    font-size: 20px;
    color: #7f8c8d;
}

.btn-adapt-job { /* *** НОВИЙ СТИЛЬ *** */
    width: 100%;
    padding: 10px 15px;
    background-color: #16a085;
    color: white;
    border: none;
    font-size: 0.95em;
    margin-top: auto; /* Притискає кнопку до низу */
}
.btn-adapt-job:hover {
    background-color: #1abc9c;
}

/* Адаптивність для мобільних */
@media (max-width: 768px) {
    .adzuna-results-grid {
        grid-template-columns: 1fr;
    }
    .result-tools {
        float: none;
        justify-content: flex-end;
    }
    .result-tools .btn {
        font-size: 0.78em;
        padding: 7px 10px;
    }
    .site-header {
        flex-direction: column;
        gap: 15px;
    }
}
