/* ========================================
   JOBS PAGE STYLES
   ======================================== */

/* Hero Section Wrapper */
.jobs-hero-wrapper {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Hero Section */
.jobs-hero {
    position: relative;
    height: 350px;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
}

/* Responsive Padding */
@media (min-width: 576px) {
    .jobs-hero-wrapper {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
}

@media (min-width: 768px) {
    .jobs-hero-wrapper {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

@media (min-width: 992px) {
    .jobs-hero-wrapper {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

@media (min-width: 1200px) {
    .jobs-hero-wrapper {
        max-width: 1320px;
        padding-left: 5rem;
        padding-right: 5rem;
    }
}

@media (min-width: 1400px) {
    .jobs-hero-wrapper {
        max-width: 1400px;
        padding-left: 6rem;
        padding-right: 6rem;
    }
}

@media (min-width: 1600px) {
    .jobs-hero-wrapper {
        max-width: 1500px;
        padding-left: 7rem;
        padding-right: 7rem;
    }
}

/* Hero Icon Box */
.hero-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
}

/* Vacancy Cards */
.vacancy-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(13, 110, 253, 0.1) !important;
}

.vacancy-card:hover {
    box-shadow: 0 12px 24px rgba(13, 110, 253, 0.15) !important;
    transform: translateY(-2px);
}

/* Badge Styles */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
}

/* Info Icon Box */
.info-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 8px;
    color: #0d6efd;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Form Control Styles */
.form-control,
.form-select {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
    transform: translateY(-1px);
}

/* Icon Styles */
.bi {
    vertical-align: -0.125em;
}

/* Card Header Styles */
.card-title {
    color: #212529;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card-text {
    color: #6c757d;
    line-height: 1.6;
}

/* Search Results Section */
.search-results-info {
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* Main Content */
main {
    padding: 2rem 0;
}

/* Info Section */
.info-section {
    margin-top: 3rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .jobs-hero {
        height: 300px;
        border-radius: 6px;
    }

    .display-4 {
        font-size: 2rem !important;
    }

    .lead {
        font-size: 1rem !important;
    }

    .vacancy-card .d-flex:last-child {
        flex-direction: column;
        gap: 1rem;
    }

    .vacancy-card .d-flex:last-child > div:last-child {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .vacancy-card .d-flex:last-child > div:last-child .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .jobs-hero {
        height: 280px;
        border-radius: 6px;
    }

    .hero-icon-box {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .display-4 {
        font-size: 1.5rem !important;
    }

    .lead {
        font-size: 0.95rem !important;
    }

    .card-body {
        padding: 1.5rem !important;
    }

    .row.g-3 {
        gap: 1rem !important;
    }

    .vacancy-card .row.g-3 {
        flex-direction: column;
    }

    .vacancy-card .row.g-3 > div {
        flex: 1;
    }

    .btn-sm {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.85rem !important;
    }

    .search-filters {
        gap: 1rem !important;
    }
}

@media (max-width: 576px) {
    .jobs-hero {
        height: 250px;
        border-radius: 4px;
    }

    .hero-icon-box {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    .display-4 {
        font-size: 1.25rem !important;
    }

    .lead {
        font-size: 0.9rem !important;
    }

    .card-body {
        padding: 1rem !important;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .card-text {
        font-size: 0.85rem;
    }

    .vacancy-card .d-flex {
        flex-direction: column;
    }

    .vacancy-card .d-flex > div:last-child {
        width: 100% !important;
    }

    .btn {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.8rem !important;
    }

    .btn-lg {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }

    .row.g-4 {
        gap: 1rem !important;
    }

    .col-12 {
        width: 100%;
    }

    .info-icon-box {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .small {
        font-size: 0.8rem !important;
    }
}

/* Print Styles */
@media print {
    .jobs-hero,
    .card,
    nav,
    footer {
        display: none;
    }

    .vacancy-card {
        page-break-inside: avoid;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for keyboard navigation */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Skeleton/Loading State */
.vacancy-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: #6c757d;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vacancy-card {
    animation: slideInUp 0.4s ease-out;
}

/* Utility Classes */
.text-primary {
    color: #0d6efd !important;
}

.bg-light {
    background-color: #f8f9fa !important;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.border-0 {
    border: none !important;
}

/* Company Logo Styles */
.company-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: #f8f9fa;
}

.company-logo-placeholder {
    width: 64px;
    height: 64px;
    background: #f8f9fa;
}

@media (max-width: 576px) {
    .company-logo,
    .company-logo-placeholder {
        width: 48px;
        height: 48px;
    }
    
    .company-logo-placeholder i {
        font-size: 1.25rem !important;
    }
}

/* Vacancy Map Modal */
#vacancyMapModal .modal-body {
    padding: 0;
}

#vacancyMapContainer {
    border-radius: 0;
}

.vacancy-map-marker {
    cursor: pointer;
}

.vacancy-map-marker i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* MapLibre Popup Styles */
.maplibregl-popup-content {
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: inherit;
}

.maplibregl-popup-content strong {
    color: #212529;
}

.maplibregl-popup-close-button {
    font-size: 18px;
    padding: 4px 8px;
}


/* ========================================
   VIEW TOGGLE (Card/Table Switch)
   ======================================== */

/* Toggle Button Group */
.view-toggle-group {
    display: inline-flex;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #fff;
    border: none;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.view-toggle-btn.active {
    background: #0d6efd;
    color: #fff;
}

.view-toggle-btn:first-child {
    border-right: 1px solid #dee2e6;
}

.view-toggle-btn.active:first-child {
    border-right-color: #0d6efd;
}

/* Vacancies Container */
.vacancies-cards-view,
.vacancies-table-view {
    display: none;
}

.vacancies-cards-view.active,
.vacancies-table-view.active {
    display: block;
}

/* ========================================
   TABLE VIEW STYLES
   ======================================== */

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

.vacancies-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    table-layout: fixed;
}

.vacancies-table thead {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #fff;
}

.vacancies-table th {
    padding: 1rem 0.75rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    font-size: 0.9rem;
}

/* Fixed column widths */
.vacancies-table th:nth-child(1),
.vacancies-table td:nth-child(1) { width: 28%; } /* Название */

.vacancies-table th:nth-child(2),
.vacancies-table td:nth-child(2) { width: 20%; } /* Компания */

.vacancies-table th:nth-child(3),
.vacancies-table td:nth-child(3) { width: 15%; } /* Зарплата */

.vacancies-table th:nth-child(4),
.vacancies-table td:nth-child(4) { width: 12%; } /* Город */

.vacancies-table th:nth-child(5),
.vacancies-table td:nth-child(5) { width: 10%; } /* Дата */

.vacancies-table th:nth-child(6),
.vacancies-table td:nth-child(6) { width: 15%; } /* Действия */

.vacancies-table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
}

.vacancies-table tbody tr {
    transition: background-color 0.2s ease;
}

.vacancies-table tbody tr:hover {
    background-color: #f8f9fa;
}

.vacancies-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Cell Styles */
.table-cell-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-cell-title a {
    color: #212529;
    text-decoration: none;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.table-cell-title a:hover {
    color: #0d6efd;
}

.table-cell-company {
    overflow: hidden;
}

.table-cell-company > div {
    overflow: hidden;
}

.table-cell-company span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
}

.table-company-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.table-company-logo-placeholder {
    width: 32px;
    height: 32px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-cell-salary {
    white-space: nowrap;
    font-weight: 600;
    color: #0d6efd;
}

.table-cell-location {
    white-space: nowrap;
    color: #6c757d;
}

.table-cell-date {
    white-space: nowrap;
    color: #6c757d;
    font-size: 0.85rem;
}

.table-cell-actions {
    white-space: nowrap;
}

.table-cell-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Responsive Table */
@media (max-width: 992px) {
    .vacancies-table th,
    .vacancies-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .vacancies-table th:nth-child(1),
    .vacancies-table td:nth-child(1) { width: 30%; }
    
    .vacancies-table th:nth-child(2),
    .vacancies-table td:nth-child(2) { width: 22%; }
    
    .vacancies-table th:nth-child(3),
    .vacancies-table td:nth-child(3) { width: 15%; }
    
    .vacancies-table th:nth-child(6),
    .vacancies-table td:nth-child(6) { width: 13%; }
}

@media (max-width: 768px) {
    .view-toggle-group {
        margin-top: 0.5rem;
    }
    
    .vacancies-table th:nth-child(4),
    .vacancies-table td:nth-child(4) {
        display: none; /* Hide location on mobile */
    }
    
    .vacancies-table th:nth-child(1),
    .vacancies-table td:nth-child(1) { width: 35%; }
    
    .vacancies-table th:nth-child(2),
    .vacancies-table td:nth-child(2) { width: 25%; }
    
    .vacancies-table th:nth-child(3),
    .vacancies-table td:nth-child(3) { width: 15%; }
    
    .vacancies-table th:nth-child(5),
    .vacancies-table td:nth-child(5) { width: 10%; }
    
    .vacancies-table th:nth-child(6),
    .vacancies-table td:nth-child(6) { width: 15%; }
}

@media (max-width: 576px) {
    .vacancies-table th:nth-child(3),
    .vacancies-table td:nth-child(3),
    .vacancies-table th:nth-child(5),
    .vacancies-table td:nth-child(5) {
        display: none; /* Hide salary and date on small mobile */
    }
    
    .vacancies-table th:nth-child(1),
    .vacancies-table td:nth-child(1) { width: 40%; }
    
    .vacancies-table th:nth-child(2),
    .vacancies-table td:nth-child(2) { width: 35%; }
    
    .vacancies-table th:nth-child(6),
    .vacancies-table td:nth-child(6) { width: 25%; }
}


/* ========================================
   SORTABLE TABLE HEADERS
   ======================================== */

.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.sortable-header:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sortable-header a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sortable-header a:hover {
    color: #fff;
}

.sort-icon {
    opacity: 0.5;
    font-size: 0.75rem;
}

.sortable-header.active .sort-icon {
    opacity: 1;
}

.sortable-header.active {
    background-color: rgba(255, 255, 255, 0.15);
}
