/* Careers Workable Block Styles - Enhanced for Public API */
.careers-workable-block {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    background: #ffffff;
}

/* Header Section */
.careers-header {
    text-align: center;
    margin-bottom: 50px;
}

.careers-header h2 {
    font-size: 2.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
    line-height: 1.2;
}

.careers-header p {
    font-size: 1.125rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 12px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Search and Filters Section */
.careers-search-filters {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.search-container {
    margin-bottom: 24px;
}

.search-container input[type="text"] {
    width: 96%;
    padding: 16px 20px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 1rem;
    background: #ffffff;
    transition: all 0.2s ease;
    box-shadow: none;
}

.search-container input[type="text"]:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: none;
}

.search-container input[type="text"]::placeholder {
    color: #9ca3af;
}

.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.filters-container select {
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 0.95rem;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
    color: #374151;
}

.filters-container select:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: none;
}

/* Country Optgroup Styling */
.filters-container select optgroup {
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
    background: #f8fafc;
    padding: 8px 0 4px 0;
    margin-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.filters-container select optgroup:first-of-type {
    margin-top: 0;
    border-top: none;
}

.filters-container select optgroup option {
    font-weight: 400;
    padding-left: 12px;
    color: #4b5563;
    background: #ffffff;
}

.filters-container select optgroup option:hover {
    background: #f3f4f6;
}

/* Jobs Summary - NEW for Public API */
.jobs-summary {
    margin-bottom: 24px;
    padding: 16px 24px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #dc2626;
}

.jobs-count {
    margin: 0;
    font-size: 1rem;
    color: #374151;
    font-weight: 500;
}

.jobs-count span {
    font-weight: 700;
    color: #1f2937;
}

/* API Error Message */
.api-error-message {
    text-align: center;
    padding: 48px 24px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 16px;
    margin-bottom: 32px;
}

.api-error-message h3 {
    margin: 0 0 16px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #dc2626;
}

.api-error-message p {
    margin: 0 0 16px 0;
    font-size: 1.125rem;
    color: #7f1d1d;
    line-height: 1.6;
}

.api-error-message small {
    display: block;
    font-size: 0.875rem;
    color: #991b1b;
    font-family: monospace;
    background: #fee2e2;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 16px;
}

/* Simple Single Column Layout - REFACTORED TO TWO COLUMNS */
.careers-content {
    margin-top: 40px;
}

.careers-jobs-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    height: 700px; /* Fixed height for both columns */
    max-height: 700px; /* Ensure it doesn't exceed this height */
}

/* Left Column: Jobs List */
.jobs-list-column {
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    height: 100%; /* Take full height of container */
    max-height: 700px; /* Match container height */
}

.careers-jobs-list {
    flex: 1;
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 0;
    min-height: 0; /* Allow flex shrinking */
    height: 700px; /* Take full height since no header */
}

/* Right Column: Job Details */
.job-details-column {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    height: 100%; /* Take full height of container */
    max-height: 700px; /* Match container height */
}

.job-details-content {
    flex: 1;
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 32px;
    min-height: 0; /* Allow flex shrinking */
    height: 100%; /* Take available height */
}

.no-job-selected {
    text-align: center;
    padding: 80px 20px;
    color: #6b7280;
}

.no-job-selected h3 {
    margin: 0 0 12px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
}

.no-job-selected p {
    margin: 0;
    font-size: 1rem;
}

/* Job Card Styling - Redesigned for list layout */
.job-card {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
}

.job-card:hover {
    background: #f8fafc;
}

.job-card.selected {
    background: #f8fafc;
    border-right: 3px solid #dc2626;
    position: relative;
}

.job-card.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #dc2626;
}

.job-card:last-child {
    border-bottom: none;
}

.job-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.job-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
}

.job-meta {
    display: flex;
    flex-direction: column;
}

.job-location {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

.job-department {
    font-size: 0.95rem;
    color: #9ca3af;
    font-style: italic;
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.job-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.job-tag.job-employment {
    background: #fecaca;
    color: #dc2626;
}

.job-tag.job-function {
    background: #fee2e2;
    color: #b91c1c;
}

/* Job Details Panel Styling */
.job-details-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
}

.job-details-header {
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
    flex-shrink: 0; /* Don't shrink */
}

.job-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.job-details-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.2;
    flex: 1;
}

.job-details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.job-details-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #6b7280;
}

.job-details-meta-item strong {
    color: #374151;
}

.job-details-body {
    flex: 1;
    min-height: 0; /* Allow flex shrinking */
    margin-bottom: 20px;
}

.job-description {
    line-height: 1.7;
    color: #374151;
}

.job-description h3 {
    color: #111827;
    font-weight: 600;
    margin: 24px 0 12px 0;
    font-size: 1.25rem;
}

.job-description ul, .job-description ol {
    margin: 16px 0;
    padding-left: 24px;
}

.job-description li {
    margin-bottom: 8px;
}

/* Pagination - Compact design */
.pagination-container {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    margin-bottom: 12px;
    flex-wrap: nowrap; /* Keep everything on one line */
    overflow-x: auto; /* Allow horizontal scroll if needed */
}

.pagination-btn {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0; /* Don't shrink buttons */
    border-radius: 6px;
}

.pagination-btn:hover:not(.active) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn.active {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.pagination-btn.pagination-prev,
.pagination-btn.pagination-next {
    padding: 4px 8px;
    font-weight: 600;
    font-size: 0.75rem; /* Match the regular buttons */
}

.pagination-ellipsis {
    padding: 6px 4px;
    color: #6b7280;
    font-weight: 400;
    font-size: 0.8rem;
    font-family: inherit;
    flex-shrink: 0;
}

.pagination-info {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
    font-family: inherit;
}

/* Hidden states */
.job-card.hidden {
    display: none !important;
}

.job-card.initially-hidden {
    display: none;
}

.no-jobs-message {
    text-align: center;
    padding: 80px 40px;
    color: #6b7280;
    grid-column: 1 / -1; /* Span full width in grid */
}

.no-jobs-message p {
    font-size: 1.25rem;
    margin: 0;
}

/* Custom scrollbar styling */
.careers-jobs-list::-webkit-scrollbar,
.job-details-content::-webkit-scrollbar {
    width: 6px;
}

.careers-jobs-list::-webkit-scrollbar-track,
.job-details-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.careers-jobs-list::-webkit-scrollbar-thumb,
.job-details-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.careers-jobs-list::-webkit-scrollbar-thumb:hover,
.job-details-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Design for Two-Column Layout */
@media (max-width: 1024px) {
    .careers-jobs-container {
        grid-template-columns: 350px 1fr;
    }
}

@media (max-width: 768px) {
    .careers-jobs-container {
        grid-template-columns: 1fr;
        grid-template-rows: 50% 50%;
        height: 800px;
    }
    
    .jobs-list-column {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .job-details-content {
        padding: 20px;
    }
    
    .job-title-row {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .apply-button-top {
        align-self: flex-start;
        padding: 10px 20px;
        font-size: 0.9rem;
        border-radius: 999px;
    }
    
    /* Custom dropdown adjustments for mobile */
    .custom-dropdown-list {
        max-height: 250px;
    }
    
    .dropdown-options {
        max-height: 200px;
    }
    
    .dropdown-search-container input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .careers-jobs-container {
        height: 700px;
    }
    
    .job-card {
        padding: 16px 20px;
    }
    
    .job-title {
        font-size: 1rem;
    }
    
    .job-details-content {
        padding: 16px;
    }
    
    .job-details-title {
        font-size: 1.5rem;
    }
    
    .job-title-row {
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .apply-button-top {
        padding: 8px 16px;
        font-size: 0.85rem;
        border-radius: 999px;
    }
    
    .pagination-container {
        padding: 12px 16px;
    }
    
    .pagination {
        gap: 3px;
        margin-bottom: 8px;
    }
    
    .pagination-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
        min-width: 28px;
    }
    
    .pagination-btn.pagination-prev,
    .pagination-btn.pagination-next {
        padding: 4px 6px;
        font-size: 0.9rem;
    }
    
    .pagination-ellipsis {
        padding: 4px 3px;
        font-size: 0.75rem;
    }
    
    .pagination-info {
        font-size: 0.75rem;
    }
}

/* Loading state (if needed) */
.careers-workable-block.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.careers-workable-block.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Debug info styling */
.careers-workable-block + div[style*="background: #f0f0f0"] {
    font-family: monospace;
    line-height: 1.4;
    max-width: 1200px;
    margin: 20px auto 0;
    border: 1px solid #ddd;
}

/* Performance indicator for public API */
.public-api-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #dcfce7;
    color: #166534;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 12px;
}

.public-api-indicator::before {
    content: '⚡';
    font-size: 1em;
}

/* Job details info (if using detailed view) */
.job-details-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.job-details-info h3 {
    margin: 0 0 12px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}

.job-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.job-info-item {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #e5e7eb;
}

.job-info-item strong {
    display: block;
    color: #374151;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.875rem;
}

/* New styles for the apply button positioned next to the title */
.apply-button-top {
    background: #dc2626;
    color: white;
    padding: 12px 24px;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    box-shadow: none;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 999px;
}

.apply-button-top:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.25);
    color: white;
    text-decoration: none;
}

/* Job details footer with bottom apply button */
.job-details-footer {
    padding-top: 32px;
    padding-bottom: 32px;
    margin-top: 32px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    flex-shrink: 0; /* Don't shrink */
}

.apply-button-bottom {
    background: #dc2626;
    color: white;
    padding: 16px 32px;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    box-shadow: none;
    min-width: 200px;
    border-radius: 999px;
}

.apply-button-bottom:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.25);
    color: white;
    text-decoration: none;
}

/* Custom Searchable Dropdown Styling */
.custom-dropdown-container {
    position: relative;
    width: 100%;
}

.custom-dropdown-selected {
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 0.95rem;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #374151;
    min-height: 48px;
    box-sizing: border-box;
}

.custom-dropdown-selected:hover {
    border-color: #9ca3af;
}

.custom-dropdown-selected.active {
    border-color: #dc2626;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
    color: #6b7280;
}

.custom-dropdown-selected.active .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #dc2626;
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
    display: none;
}

.custom-dropdown-list.show {
    display: block;
}

.dropdown-search-container {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.dropdown-search-container input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #ffffff;
    outline: none;
    box-sizing: border-box;
}

.dropdown-search-container input:focus {
    border-color: #dc2626;
}

.dropdown-options {
    max-height: 250px;
    overflow-y: auto;
}

.dropdown-optgroup {
    background: #f8fafc;
    padding: 8px 16px 4px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-option {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #4b5563;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

.dropdown-option:hover {
    background: #f3f4f6;
}

.dropdown-option.selected {
    background: #dc2626;
    color: white;
}

.dropdown-option.hidden {
    display: none;
}

.dropdown-option:last-child {
    border-bottom: none;
}

/* Custom scrollbar for dropdown */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dropdown-option.hidden {
    display: none;
}

.dropdown-optgroup.hidden {
    display: none;
}

.dropdown-option.current-location-option {
    background: #fff6f6; /* Light red background when not selected */
    color: #dc2626;      /* Red text to indicate special option */
    font-weight: 600;
}

.dropdown-option.current-location-option.selected {
    background: #dc2626;
    color: white;
}

/* Visual separator between current location and country groups */
.dropdown-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}
