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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px 0;
}

.edbo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.edbo-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.edbo-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.edbo-header:active {
    transform: translateY(0);
}

.edbo-header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 300;
}

.edbo-header p {
    margin: 10px 0 0 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.refresh-info {
    background: #e3f2fd;
    color: #0277bd;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #0277bd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.refresh-info.center-text {
    justify-content: center;
    text-align: center;
}

.refresh-button {
    background: #0277bd;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.refresh-button:hover {
    background: #01579b;
    transform: translateY(-1px);
}

.refresh-button:active {
    transform: translateY(0);
}

/* Стилі для блоку службової інформації */
.spec-info-container {
    background: white;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.spec-info-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
}

.spec-info-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spec-info-header .spec-number {
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: normal;
}

.spec-info-content {
    padding: 0;
}

.spec-info-table {
    width: 100%;
    border-collapse: collapse;
}

.spec-info-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.spec-info-table td {
    padding: 15px 25px;
    border-bottom: 1px solid #e9ecef;
}

.spec-info-table td:first-child {
    font-weight: 600;
    color: #495057;
    width: 35%;
    background-color: rgba(102, 126, 234, 0.05);
}

.spec-info-table td:last-child {
    color: #2c3e50;
    font-weight: 500;
}

.spec-highlight {
    color: #667eea;
    font-weight: 700;
}

.spec-price {
    color: #28a745;
    font-weight: 700;
    font-size: 1.1em;
}

.spec-dates {
    color: #dc3545;
    font-weight: 600;
}

.last-update {
    background: #f1f8e9;
    color: #2e7d32;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #4caf50;
}

.results-info {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.results-info strong {
    color: #667eea;
}

/* Стилі для перемикача заяви/особи */
.toggle-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    color: #2c3e50;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 16px;
    transition: color 0.3s ease;
}

.toggle-label.active {
    color: #667eea;
    font-weight: 700;
}

.toggle-info {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
    margin-top: 10px;
}

/* Стилі для фільтру за пріоритетами */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-group {
    flex: 1;
    min-width: 400px;
}

.filter-group h4 {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #495057;
    font-weight: 600;
}

.checkbox-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.checkbox-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-label .priority-text {
    display: inline-block;
    min-width: 45px;
    padding: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"]:checked + .priority-budget {
    background: #28a745;
    color: white;
    border-color: #28a745;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.checkbox-label input[type="checkbox"]:checked + .priority-contract {
    background: #007bff;
    color: white;
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.checkbox-label:hover .priority-text {
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.filter-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-select-all {
    background-color: #007bff;
    color: white;
}

.btn-select-all:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.btn-clear {
    background-color: #dc3545;
    color: white;
}

.btn-clear:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* Стилі для пошуку */
.search-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.search-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2e7d32;
}

.search-results-info {
    margin-top: 10px;
    font-size: 14px;
    color: #6c757d;
}

.no-search-results {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    font-style: italic;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

/* Стилі для таблиць */
.status-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    text-align: center;
    padding: 20px 20px 15px 20px;
    margin: 30px 0 0 0;
    font-size: 18px;
    font-weight: 600;
    border-radius: 10px 10px 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-header-subtitle {
    display: block;
    font-size: 12px;
    font-weight: normal;
    text-transform: lowercase;
    margin-top: 8px;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

.status-header:first-of-type {
    margin-top: 0;
}

.status-section {
    margin-bottom: 40px;
}

.status-section:last-child {
    margin-bottom: 0;
}

.status-table-container {
    background: white;
    border-radius: 0 0 15px 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.status-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.status-allowed { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); }
.status-registered { background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%); }
.status-cancelled { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }
.status-cancelled-by-student { background: linear-gradient(135deg, #e67e22 0%, #d35400 100%); }
.status-online { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); }
.status-rejected { background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%); }

.edbo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.edbo-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.edbo-table th {
    padding: 20px 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
}

.edbo-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.edbo-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

.edbo-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.edbo-table td {
    padding: 15px;
    color: #333;
}

.fio-cell {
    font-weight: 600;
    color: #2c3e50;
}

.fio-cell small {
    font-weight: normal;
    font-size: 11px;
    margin-left: 5px;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid;
}

/* Квота 1 - синій колір */
.fio-cell small.quota-1 {
    color: #007bff;
    background: #e3f2fd;
    border-color: #90caf9;
}

/* Квота 2 - зелений колір */
.fio-cell small.quota-2 {
    color: #28a745;
    background: #e8f5e8;
    border-color: #c3e6cb;
}

/* Загальний fallback стиль для квот без класу */
.fio-cell small:not(.quota-1):not(.quota-2) {
    color: #28a745;
    background: #e8f5e8;
    border-color: #c3e6cb;
}

.konkurs-cell {
    font-weight: 700;
    font-size: 18px;
    color: #667eea;
    text-align: center;
}

.priority-cell {
    text-align: center;
    font-weight: 600;
}

.priority-1 { color: #28a745; }
.priority-2 { color: #ffc107; }
.priority-3 { color: #fd7e14; }
.priority-default { color: #6c757d; }

/* Стилі для відображення пріоритетів */
.priorities-cell {
    text-align: center;
    font-weight: 600;
}

.priority-group {
    display: inline-block;
    margin: 0 2px;
}

.priority-budget {
    color: #28a745;
    font-weight: 700;
}

.priority-contract {
    color: #ffc107;
    font-weight: 700;
}

.priorities-separator {
    margin: 0 3px;
    color: #6c757d;
}

/* Повідомлення та помилки */
.no-results {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
    font-size: 18px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
}

.param-error {
    background: #fff3cd;
    color: #856404;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
    text-align: center;
}

.param-error h2 {
    margin-bottom: 15px;
    color: #b45309;
}

.param-error .example-url {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 14px;
    margin: 10px 0;
    word-break: break-all;
    border: 1px solid #dee2e6;
}

.no-status-data {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
    font-style: italic;
    background: #f8f9fa;
}

/* Стилі для кнопки поділитися */
.share-cell {
    text-align: center;
    width: 80px;
}

.share-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.share-button:active {
    transform: translateY(0);
}

.share-disabled {
    color: #6c757d;
    font-size: 16px;
    cursor: not-allowed;
}

/* Модальне вікно для поширення */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
}

.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.share-modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
    }
    to {
    opacity: 1;
    transform: translateY(0) scale(1);
    }
}

.share-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.share-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.share-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.share-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.share-modal-body {
    padding: 25px;
}

.share-text-container {
    margin-bottom: 25px;
}

.share-text-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.share-text-container textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s ease;
}

.share-text-container textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.share-text-container small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

.share-platforms-container h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1em;
}

.share-platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.share-platform-button {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
}

.share-platform-button:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-1px);
}

.share-platform-button.facebook { border-color: #1877f2; color: #1877f2; }
.share-platform-button.facebook:hover { background: #e7f3ff; }

.share-platform-button.telegram { border-color: #0088cc; color: #0088cc; }
.share-platform-button.telegram:hover { background: #e6f7ff; }

.share-platform-button.viber { border-color: #665cac; color: #665cac; }
.share-platform-button.viber:hover { background: #f4f3ff; }

.share-platform-button.whatsapp { border-color: #25d366; color: #25d366; }
.share-platform-button.whatsapp:hover { background: #eefdf4; }

.share-platform-button.twitter { border-color: #1da1f2; color: #1da1f2; }
.share-platform-button.twitter:hover { background: #e8f5fe; }

.share-platform-button.instagram { border-color: #e1306c; color: #e1306c; }
.share-platform-button.instagram:hover { background: #fdf2f8; }

.share-platform-button.linkedin { border-color: #0077b5; color: #0077b5; }
.share-platform-button.linkedin:hover { background: #f0f8ff; }

.share-platform-button.copy { border-color: #6c757d; color: #6c757d; }
.share-platform-button.copy:hover { background: #f8f9fa; }

.share-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.btn-cancel {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.btn-cancel:hover {
    background: #5a6268;
}
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: block; /* Зміна: показуємо на всіх пристроях */
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    display: block; /* Зміна: перезаписуємо display для видимості */
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.scroll-to-top:active {
    transform: translateY(-1px);
}

.scroll-to-top::before {
    content: '↑';
    color: white;
    font-size: 24px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Адаптивний дизайн */
@media (max-width: 768px) {
    .edbo-container {
    padding: 10px;
    }
    
    .edbo-header {
    padding: 20px;
    }
    
    .edbo-header h1 {
    font-size: 2em;
    }

    .spec-info-header h2 {
    font-size: 1.4em;
    flex-direction: column;
    gap: 5px;
    }

    .spec-info-table td {
    padding: 12px 15px;
    font-size: 14px;
    }

    .spec-info-table td:first-child {
    width: 40%;
    }
    
    .status-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 15px 15px;
    min-height: 1px;
    }
    
    .edbo-table {
    min-width: 650px;
    font-size: 14px;
    width: 650px;
    }
    
    .edbo-table th,
    .edbo-table td {
    padding: 10px 8px;
    white-space: nowrap;
    }
    
    .fio-cell {
    min-width: 180px;
    max-width: 180px;
    word-wrap: break-word;
    white-space: normal;
    }
    
    .konkurs-cell {
    min-width: 100px;
    font-size: 16px;
    }
    
    .priority-cell {
    min-width: 80px;
    }

    .scroll-to-top {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    }

    .scroll-to-top::before {
    font-size: 20px;
    }

    .search-input {
    font-size: 16px;
    padding: 10px 12px;
    }

    .search-container {
    padding: 15px;
    }

    /* Мобільні стилі для фільтру */
    .filter-container {
    flex-direction: column;
    gap: 20px;
    padding: 15px;
    }

    .filter-group {
    min-width: 100%;
    }

    .checkbox-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    }

    .checkbox-label .priority-text {
    min-width: 40px;
    padding: 5px 6px;
    font-size: 13px;
    }

    .filter-actions {
    justify-content: center;
    }

    .filter-actions button {
    padding: 6px 12px;
    font-size: 13px;
    }
    
    /* Мобільні стилі для модального вікна поширення */
    .share-modal-content {
    width: 95%;
    max-height: 90vh;
    margin: 10px;
    }
    
    .share-modal-header {
    padding: 15px 20px;
    }
    
    .share-modal-header h3 {
    font-size: 1.1em;
    }
    
    .share-modal-body {
    padding: 20px;
    }
    
    .share-text-container textarea {
    font-size: 14px;
    min-height: 100px;
    }
    
    .share-platforms-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    }
    
    .share-platform-button {
    padding: 10px 8px;
    font-size: 12px;
    min-height: 40px;
    }
    
    .share-button {
    width: 32px;
    height: 32px;
    font-size: 14px;
    }
}