/**
 * JDQ Elementor Widget Styles
 * Modern job search interface with teal/blue accents
 */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* Container */
.jdq-widget-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Row 1: Search and Country (50/50) */
.jdq-search-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Search Input */
.jdq-search-input-wrapper {
    position: relative;
}

.jdq-search-input {
    width: 100% !important;
    padding: 0.875rem 3rem 0.875rem 1.25rem !important;
    font-size: 1rem !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    height: auto !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
}

.jdq-search-input:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

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

.jdq-search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #6b7280;
    pointer-events: none;
}

/* Country Select */
.jdq-country-select-wrapper {
    position: relative;
}

.jdq-country-select {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1.25rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 18px;
    background-color: #ffffff !important;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 20px !important;
    transition: all 0.2s ease;
    outline: none;
    height: auto;
    line-height: 1.5;
    box-sizing: border-box;
}

/* Remove IE default arrow */
.jdq-country-select::-ms-expand {
    display: none;
}

.jdq-country-select:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Row 2: Filters Row (Pills + Clear All + Toggle) */
.jdq-filters-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    min-height: 50px;
    flex-wrap: wrap;
}

/* Filter Pills Container */
.jdq-filter-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.jdq-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.jdq-filter-pill:hover {
    background: #e5e7eb;
}

.jdq-pill-remove {
    cursor: pointer;
    width: 16px;
    height: 16px;
    color: #9ca3af;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
}

.jdq-pill-remove:hover {
    color: #ef4444;
}

/* Clear All Button */
.jdq-clear-all {
    padding: 0.5rem 1.25rem;
    background: #003d5b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.jdq-clear-all:hover {
    background: #002d43;
    transform: translateY(-1px);
}

.jdq-clear-all:active {
    transform: translateY(0);
}

/* Toggle Switch */
.jdq-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

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

.jdq-toggle-slider {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background-color: #d1d5db;
    border-radius: 24px;
    transition: background-color 0.3s ease;
}

.jdq-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.jdq-toggle-label input:checked + .jdq-toggle-slider {
    background-color: #14b8a6;
}

.jdq-toggle-label input:checked + .jdq-toggle-slider::before {
    transform: translateX(24px);
}

.jdq-toggle-text {
    font-size: 0.95rem;
    color: #374151;
    white-space: nowrap;
}

/* Results Header */
.jdq-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.jdq-results-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #003d5b;
    margin: 0;
}

.jdq-results-count {
    font-weight: 400;
    color: #6b7280;
}

.jdq-filter-icon {
    width: 24px;
    height: 24px;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s ease;
}

.jdq-filter-icon:hover {
    color: #14b8a6;
}

/* Jobs Container */
.jdq-jobs-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Loading State */
.jdq-loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-size: 1.1rem;
}

/* Job Card */
.jdq-job-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #f3f4f6;
}

.jdq-job-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 6px 12px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

/* Job Card Tag */
.jdq-tag {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background-color: rgba(20, 184, 166, 0.2);
    color: #0f766e;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Job Title */
.jdq-job-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #003d5b;
    margin: 0 0 1rem 0;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.2s ease;
}

.jdq-job-title:hover {
    color: #14b8a6;
}

/* Job Description */
.jdq-job-description {
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
}

/* Job Meta */
.jdq-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.jdq-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
}

.jdq-meta-icon {
    width: 18px;
    height: 18px;
    color: #6b7280;
    flex-shrink: 0;
}

/* Empty State */
.jdq-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.jdq-empty-state h3 {
    font-size: 1.5rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.jdq-empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .jdq-widget-container {
        padding: 1rem 0.75rem;
    }

    .jdq-search-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .jdq-filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .jdq-filter-pills-container {
        width: 100%;
    }

    .jdq-clear-all {
        width: 100%;
    }

    .jdq-toggle-label {
        width: 100%;
        justify-content: space-between;
    }

    .jdq-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .jdq-results-title {
        font-size: 1.375rem;
    }

    .jdq-job-card {
        padding: 1.5rem;
    }

    .jdq-job-title {
        font-size: 1.125rem;
    }

    .jdq-job-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

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

.jdq-job-card {
    animation: fadeInUp 0.4s ease-out;
}

/* Accessibility */
.jdq-search-input:focus-visible,
.jdq-country-select:focus-visible,
.jdq-toggle-label input:focus-visible + .jdq-toggle-slider {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .jdq-search-row,
    .jdq-filters-row,
    .jdq-filter-icon {
        display: none;
    }

    .jdq-job-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        page-break-inside: avoid;
    }
}

/* ========================================
   Filter Panel Styles
   ======================================== */

/* Overlay */
.jdq-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
}

.jdq-filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sliding Panel */
.jdq-filter-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 25%;
    min-width: 320px;
    max-width: 400px;
    height: 100%;
    background: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.jdq-filter-panel.active {
    transform: translateX(0);
}

/* Panel Header */
.jdq-filter-panel-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.jdq-filter-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #6b7280;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jdq-filter-panel-close:hover {
    color: #374151;
}

/* Panel Sections */
.jdq-filter-panel-section {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.jdq-filter-panel-section:last-of-type {
    border-bottom: none;
    flex: 1;
    overflow-y: auto;
}

.jdq-filter-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: #003d5b;
    margin: 0 0 1rem 0;
}

/* Filter Panel Pills */
.jdq-filter-panel-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.jdq-filter-panel-pills:empty {
    display: none;
}

.jdq-filter-panel-pills + .jdq-filter-panel-clear-all {
    margin-top: 0;
}

.jdq-filter-panel-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 500;
}

.jdq-filter-panel-pill-remove {
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
    font-weight: 700;
    line-height: 1;
}

.jdq-filter-panel-pill-remove:hover {
    color: #ef4444;
}

/* Panel Clear All Button */
.jdq-filter-panel-clear-all {
    padding: 0.5rem 1rem;
    background: #14b8a6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.jdq-filter-panel-clear-all:hover {
    background: #0d9488;
}

/* Filter Groups */
.jdq-filter-group {
    margin-bottom: 1.25rem;
}

.jdq-filter-group:last-child {
    margin-bottom: 0;
}

.jdq-filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Filter Dropdowns */
.jdq-language-select,
.jdq-city-select,
.jdq-category-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
}

.jdq-language-select:focus,
.jdq-city-select:focus,
.jdq-category-select:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Panel Footer */
.jdq-filter-panel-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #f9fafb;
}

.jdq-filter-apply-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #14b8a6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.jdq-filter-apply-btn:hover {
    background: #0d9488;
    transform: translateY(-1px);
}

.jdq-filter-apply-btn:active {
    transform: translateY(0);
}

/* Body scroll lock when panel is open */
body.jdq-filter-panel-open {
    overflow: hidden;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .jdq-filter-panel {
        width: 100%;
        max-width: none;
        min-width: auto;
    }
}

/* Responsive - Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .jdq-filter-panel {
        width: 40%;
    }
}

/* ========================================
   Search Redirect Widget Styles
   ======================================== */

.jdq-search-redirect-form {
    width: 100%;
}

.jdq-search-redirect-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.jdq-search-redirect-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 80px;
    padding: 0 50px;
    border-radius: 100px;
    background: #ffffff;
    cursor: pointer;
}

.jdq-search-redirect-input {
    width: 100%;
    height: 100%;
    padding: 0;
    font-size: 1.125rem;
    border: none;
    border-color: transparent !important;
    background: transparent;
    color: #014751;
    outline: none;
}

.jdq-search-redirect-input::placeholder {
    color: #014751;
}

.jdq-search-redirect-input:focus {
    outline: none;
}

.jdq-search-redirect-submit {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent !important;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.jdq-search-redirect-submit:hover {
    opacity: 0.7;
}

.jdq-search-redirect-submit svg {
    color: #003D5B;
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.jdq-search-redirect-country-wrapper {
    width: 100%;
}

.jdq-search-redirect-country {
    width: 100%;
    height: 80px;
    padding: 0 50px;
    font-size: 1.125rem;
    border: none;
    border-radius: 100px;
    background-color: #ffffff;
    color: #014751;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23014751' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 30px center;
    background-size: 24px;
}

.jdq-search-redirect-country:focus {
    outline: none;
}

/* Search Redirect Widget - Responsive */
@media (max-width: 768px) {
    .jdq-search-redirect-input-wrapper,
    .jdq-search-redirect-country {
        height: 60px;
        padding: 0 30px;
    }

    .jdq-search-redirect-submit {
        right: 20px;
    }

    .jdq-search-redirect-country {
        background-position: right 20px center;
    }

    .jdq-search-redirect-input,
    .jdq-search-redirect-country {
        font-size: 1rem;
    }
}

/* ========================================
   Pagination Styles
   ======================================== */

.jdq-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.jdq-pagination-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.jdq-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jdq-page-btn:hover:not(:disabled) {
    border-color: #14b8a6;
    color: #14b8a6;
}

.jdq-page-btn.active {
    background: #14b8a6;
    border-color: #14b8a6;
    color: #ffffff;
}

.jdq-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.jdq-page-btn svg {
    width: 16px;
    height: 16px;
}

.jdq-page-prev,
.jdq-page-next {
    min-width: auto;
    padding: 0 1rem;
}

.jdq-page-ellipsis {
    color: #6b7280;
    padding: 0 0.5rem;
}

.jdq-results-status {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Pagination - Responsive */
@media (max-width: 768px) {
    .jdq-pagination-inner {
        gap: 0.25rem;
    }

    .jdq-page-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.8125rem;
        padding: 0 0.5rem;
    }

    .jdq-page-prev,
    .jdq-page-next {
        padding: 0 0.75rem;
    }

    .jdq-page-ellipsis {
        padding: 0 0.25rem;
    }
}
