/**
 * Custom Jobs Dashboard Styles
 * Modern Tailwind-inspired design for HaveConnection Vacancies Jobs Dashboard
 */

/* Main wrapper */
.jb-dashboard-wrapper {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

@media (min-width: 640px) {
    .jb-dashboard-wrapper {
        padding: 2rem;
    }
}

/* Dashboard Header */
.jb-dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .jb-dashboard-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.jb-dashboard-header-content h1 {
    font-size: 1.875rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.025em;
}

.jb-dashboard-header-content p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.jb-dashboard-post-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #d62943;
    color: #ffffff !important;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.15s ease;
    box-shadow: 0 4px 6px -1px rgba(214, 41, 67, 0.3);
    white-space: nowrap;
}

.jb-dashboard-post-btn:hover {
    background-color: #b91c36;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.jb-dashboard-post-btn .material-symbols-outlined {
    font-size: 1.25rem;
}

/* Stats Cards */
.jb-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .jb-dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .jb-dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

.jb-stat-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.15s ease;
}

.jb-stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.jb-stat-card-content {
    display: flex;
    flex-direction: column;
}

.jb-stat-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.jb-stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.jb-stat-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
}

.jb-stat-card-icon .material-symbols-outlined {
    font-size: 1.5rem;
}

.jb-stat-card.jb-stat-active .jb-stat-card-icon {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.jb-stat-card.jb-stat-applications .jb-stat-card-icon {
    background-color: rgba(214, 41, 67, 0.1);
    color: #d62943;
}

.jb-stat-card.jb-stat-expiring .jb-stat-card-icon {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.jb-stat-card.jb-stat-pending .jb-stat-card-icon {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.jb-stat-card.jb-stat-interview-scheduled .jb-stat-card-icon {
    background-color: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.jb-stat-card.jb-stat-interview-completed .jb-stat-card-icon {
    background-color: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

/* Filters Section */
.jb-dashboard-filters {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .jb-dashboard-filters {
        flex-direction: row;
        align-items: center;
    }
}

.jb-dashboard-search {
    flex: 1;
    position: relative;
}

.jb-dashboard-search .material-symbols-outlined {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.25rem;
    pointer-events: none;
}

.jb-dashboard-search input {
    width: 100%;
    height: 2.75rem;
    padding: 0 1rem 0 3rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #1f2937;
    background-color: #f9fafb;
    transition: all 0.15s ease;
}

.jb-dashboard-search input:focus {
    outline: none;
    border-color: #d62943;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(214, 41, 67, 0.1);
}

.jb-dashboard-search input::placeholder {
    color: #9ca3af;
}

.jb-dashboard-dropdowns {
    display: flex;
    gap: 0.75rem;
}

.jb-dashboard-select {
    position: relative;
}

.jb-dashboard-select select {
    appearance: none;
    height: 2.75rem;
    padding: 0 2.5rem 0 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    background-color: #ffffff;
    cursor: pointer;
    min-width: 8rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    transition: all 0.15s ease;
}

.jb-dashboard-select select:focus {
    outline: none;
    border-color: #d62943;
    box-shadow: 0 0 0 3px rgba(214, 41, 67, 0.1);
}

/* Jobs Table */
.jb-dashboard-table-wrapper {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: visible;
}

/* Add border radius to first and last rows to maintain rounded corners */
.jb-dashboard-table thead tr th:first-child {
    border-top-left-radius: 0.75rem;
}

.jb-dashboard-table thead tr th:last-child {
    border-top-right-radius: 0.75rem;
}

.jb-dashboard-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0.75rem;
}

.jb-dashboard-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0.75rem;
}

.jb-dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.jb-dashboard-table thead {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.jb-dashboard-table th {
    padding: 0.875rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.jb-dashboard-table th:last-child {
    text-align: right;
}

.jb-dashboard-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

.jb-dashboard-table tbody tr:last-child {
    border-bottom: none;
}

.jb-dashboard-table tbody tr:hover {
    background-color: #f9fafb;
}

.jb-dashboard-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: #374151;
    vertical-align: middle;
    position: relative;
}

.jb-dashboard-table td:last-child {
    text-align: right;
    overflow: visible;
}

/* Job Title Cell */
.jb-job-title-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.jb-job-title-link {
    font-weight: 600;
    color: #1f2937 !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.jb-job-title-link:hover {
    color: #d62943 !important;
}

.jb-job-title-text {
    font-weight: 600;
    color: #1f2937;
}

.jb-job-id {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Status Badge */
.jb-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.jb-status-badge::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
}

.jb-status-badge.jb-status-publish,
.jb-status-badge.jb-status-not-filled {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.jb-status-badge.jb-status-publish::before,
.jb-status-badge.jb-status-not-filled::before {
    background-color: #10b981;
}

.jb-status-badge.jb-status-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.jb-status-badge.jb-status-pending::before {
    background-color: #f59e0b;
}

.jb-status-badge.jb-status-draft {
    background-color: rgba(107, 114, 128, 0.1);
    color: #4b5563;
}

.jb-status-badge.jb-status-draft::before {
    background-color: #6b7280;
}

.jb-status-badge.jb-status-jb-expired,
.jb-status-badge.jb-status-expired {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.jb-status-badge.jb-status-jb-expired::before,
.jb-status-badge.jb-status-expired::before {
    background-color: #ef4444;
}

.jb-status-badge.jb-status-filled {
    background-color: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

.jb-status-badge.jb-status-filled::before {
    background-color: #6366f1;
}

/* Applicants Cell */
.jb-applicants-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.jb-applicants-count {
    font-weight: 600;
    color: #1f2937;
}

.jb-applicants-view {
    color: #d62943 !important;
    font-weight: 500;
    text-decoration: none !important;
    font-size: 0.875rem;
}

.jb-applicants-view:hover {
    text-decoration: underline !important;
}

/* Date Cells */
.jb-date-cell {
    color: #6b7280;
    white-space: nowrap;
}

.jb-date-cell.jb-expiring-soon {
    color: #f59e0b;
    font-weight: 500;
}

/* Actions Dropdown */
.jb-actions-dropdown {
    position: relative;
    display: inline-block;
}

.jb-actions-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s ease;
}

.jb-actions-trigger:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.jb-actions-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    min-width: 10rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: all 0.15s ease;
}

.jb-actions-dropdown.jb-open .jb-actions-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.jb-actions-menu ul {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
}

.jb-actions-menu li {
    margin: 0;
}

.jb-actions-menu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151 !important;
    text-decoration: none !important;
    transition: background-color 0.15s ease;
}

.jb-actions-menu a:hover {
    background-color: #f3f4f6;
}

.jb-actions-menu a.jb-action-delete {
    color: #dc2626 !important;
}

/* Pagination */
.jb-dashboard-pagination {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

@media (min-width: 640px) {
    .jb-dashboard-pagination {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.jb-pagination-info {
    font-size: 0.875rem;
    color: #6b7280;
}

.jb-pagination-pages {
    display: flex;
    gap: 0.25rem;
}

.jb-pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #374151;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none !important;
}

.jb-pagination-btn:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.jb-pagination-btn.jb-active {
    background-color: #d62943;
    border-color: #d62943;
    color: #ffffff;
}

.jb-pagination-btn.jb-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty State */
.jb-dashboard-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.jb-dashboard-empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    border-radius: 9999px;
    color: #9ca3af;
}

.jb-dashboard-empty-icon .material-symbols-outlined {
    font-size: 2rem;
}

.jb-dashboard-empty h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.jb-dashboard-empty p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1.5rem 0;
}

/* Mobile Responsive Table */
@media (max-width: 767px) {
    .jb-dashboard-table thead {
        display: none;
    }

    .jb-dashboard-table tbody tr {
        display: block;
        padding: 1rem;
    }

    .jb-dashboard-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f3f4f6;
    }

    .jb-dashboard-table td:last-child {
        border-bottom: none;
        justify-content: flex-end;
    }

    .jb-dashboard-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: #6b7280;
        text-transform: uppercase;
    }

    .jb-dashboard-table td:first-child::before,
    .jb-dashboard-table td:last-child::before {
        content: none;
    }

    .jb-dashboard-table td:first-child {
        justify-content: flex-start;
    }
}

/* Loading State */
.jb-dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.jb-dashboard-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #e5e7eb;
    border-top-color: #d62943;
    border-radius: 9999px;
    animation: jb-spin 0.8s linear infinite;
}

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

/* Hide original HaveConnection Vacancies styles */
.jb-job-dashboard .jb-job-dashboard-heading,
.jb-job-dashboard .jb-job-dashboard-row {
    display: none !important;
}

/* Override default jb wrapper padding */
.jb.jb-job-dashboard {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* ============================================
   APPLICANTS MODAL STYLES
   ============================================ */

/* Modal Overlay */
.jb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.jb-modal-overlay.jb-modal-open {
    opacity: 1;
    visibility: visible;
}

body.jb-modal-body-open {
    overflow: hidden;
}

/* Modal Container */
.jb-modal {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 40rem;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(1rem);
    transition: transform 0.2s ease;
}

.jb-modal-open .jb-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.jb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.jb-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.jb-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s ease;
}

.jb-modal-close:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* Modal Body */
.jb-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.jb-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.jb-modal-error,
.jb-modal-empty {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

/* Applicants List */
.jb-applicants-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Applicant Card */
.jb-applicant-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.15s ease;
}

.jb-applicant-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.jb-applicant-avatar {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e5e7eb;
    border-radius: 9999px;
    flex-shrink: 0;
    color: #6b7280;
}

.jb-applicant-avatar .material-symbols-outlined {
    font-size: 1.5rem;
}

.jb-applicant-info {
    flex: 1;
    min-width: 0;
}

.jb-applicant-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.jb-applicant-email {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 0.25rem 0;
    word-break: break-all;
}

.jb-applicant-date {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
}

.jb-applicant-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

/* Applicant Status Badge */
.jb-applicant-status {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.jb-applicant-status-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.jb-applicant-status-reviewed {
    background-color: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.jb-applicant-status-hired {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.jb-applicant-status-rejected {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* View Profile Button */
.jb-applicant-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151 !important;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.jb-applicant-profile-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.jb-applicant-profile-btn .material-symbols-outlined {
    font-size: 1rem;
}

/* Responsive Applicant Card */
@media (max-width: 480px) {
    .jb-applicant-card {
        flex-direction: column;
        align-items: stretch;
    }

    .jb-applicant-actions {
        flex-direction: row;
        justify-content: space-between;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #e5e7eb;
    }
}