/**
 * Frontend Styles for Talentora
 * Premium Design Overhaul
 */

:root {
    --ht-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --ht-color-primary: #4f46e5;
    --ht-color-primary-dark: #4338ca;
    --ht-color-text: #1e293b;
    --ht-color-text-light: #64748b;
    --ht-color-bg: #f8fafc;
    --ht-color-white: #ffffff;
    --ht-border-color: #e2e8f0;
    
    --ht-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --ht-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --ht-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --ht-radius: 0.5rem;
    --ht-radius-lg: 0.75rem;
}

/* Wrapper */
.talentora-jobs-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: var(--ht-font-sans);
    color: var(--ht-color-text);
}

/* Filter Bar Premium Design */
.talentora-filter-bar {
    background: var(--ht-color-white);
    padding: 0.5rem;
    border-radius: 9999px; /* Pill shape */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.05);
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    border: 1px solid var(--ht-border-color);
}

.talentora-filters {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
}

.filter-field {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0; /* Important for flex items to shrink properly */
}

/* Add subtle dividers between fields except button */
.filter-field:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: var(--ht-border-color);
}

.filter-field input,
.filter-field select {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem !important;
    border: none !important;
    border-radius: 0;
    font-size: 1rem;
    color: var(--ht-color-text);
    background-color: transparent !important;
    transition: all 0.2s ease;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-field select {
    padding-right: 2.5rem !important; /* Space for the dropdown arrow */
}

.filter-field input[type="text"] {
    cursor: text;
}

.filter-field input::placeholder {
    color: #94a3b8; /* Clearer, better contrast placeholder */
    font-weight: 400;
}

.filter-field input:focus,
.filter-field select:focus {
    outline: none !important;
    box-shadow: none !important;
}

.filter-field-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8; /* Neutral color for icons */
    font-size: 18px;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 2;
}

.filter-field:focus-within .filter-field-icon {
    color: var(--ht-color-primary); /* Pop on focus */
}

/* Adjust last field (button) to take natural width */
.filter-field:last-child {
    flex: 0 0 auto;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.filter-field:last-child::after {
    display: none;
}

.talentora-filters .talentora-btn {
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    background: var(--ht-color-primary);
    color: var(--ht-color-white);
    font-weight: 600;
    letter-spacing: 0.025em;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
    white-space: nowrap;
}

.talentora-filters .talentora-btn:hover {
    background: var(--ht-color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.3);
}

.talentora-filters .talentora-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--ht-color-white);
}

/* Custom Select Arrow */
.filter-field-select::before {
    content: '\f140';
    font-family: 'dashicons';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #94a3b8;
    font-size: 20px;
    z-index: 1;
}

/* Responsive Form Update */
@media (max-width: 992px) {
    .talentora-filter-bar {
        border-radius: var(--ht-radius-lg);
        padding: 1.25rem;
        background: var(--ht-color-white);
        flex-direction: column;
        border: 1px solid var(--ht-border-color);
    }
    
    .talentora-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .filter-field {
        flex: none;
        width: 100%;
    }
    
    .filter-field:not(:last-child)::after {
        display: none; /* No vertical dividers on mobile */
    }
    
    .filter-field input,
    .filter-field select {
        padding: 0.875rem 2.5rem 0.875rem 3.5rem !important;
        background-color: var(--ht-color-bg) !important;
        border-radius: var(--ht-radius);
        border: 1px solid var(--ht-border-color) !important;
    }
    
    .filter-field:focus-within input,
    .filter-field:focus-within select {
        border-color: var(--ht-color-primary) !important;
        background-color: #fff !important;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
    }

    .talentora-filters .talentora-btn {
        width: 100%;
        border-radius: var(--ht-radius);
        padding: 1rem;
        margin-top: 0.5rem;
    }
    
    .filter-field:last-child {
        padding-left: 0;
        padding-right: 0;
    }
}

.talentora-btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--ht-color-primary);
    color: var(--ht-color-white);
    border: none;
    border-radius: var(--ht-radius);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

.talentora-btn:hover {
    background: var(--ht-color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--ht-shadow-md);
    color: var(--ht-color-white);
}

/* Jobs Grid */
.talentora-jobs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Job Card */
.talentora-job-card {
    background: var(--ht-color-white);
    border: 1px solid var(--ht-border-color);
    border-radius: var(--ht-radius);
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.talentora-job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ht-shadow-lg);
    border-color: var(--ht-color-primary);
}

.talentora-job-card.job-filled {
    opacity: 0.7;
    background: var(--ht-color-bg);
    pointer-events: none;
}

.job-card-header {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.company-logo-mini img {
    max-width: 48px;
    border-radius: 4px;
}

.job-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}

.job-title a {
    color: var(--ht-color-text);
    text-decoration: none;
    transition: color 0.2s;
}

.job-title a:hover {
    color: var(--ht-color-primary);
}

.job-company-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ht-color-text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Badges */
.job-filled-badge {
    background: #fee2e2;
    color: #ef4444;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    width: fit-content;
}

.job-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.job-status-badge.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    backdrop-filter: blur(4px);
}

.job-status-badge.filled {
    background: #fee2e2;
    color: #ef4444;
}

/* Job Card Body */
.job-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.job-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.job-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--ht-color-bg);
    border-radius: 4px;
    color: var(--ht-color-text-light);
}

.job-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--ht-color-primary);
}

.job-excerpt {
    font-size: 0.95rem;
    color: var(--ht-color-text-light);
    line-height: 1.5;
    margin: 0;
}

/* Card Footer */
.job-card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ht-border-color);
}

.job-card-footer .talentora-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.job-card-footer .talentora-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Pagination */
.talentora-pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.talentora-pagination .page-numbers {
    padding: 0.5rem 1rem;
    border-radius: var(--ht-radius);
    background: var(--ht-color-white);
    border: 1px solid var(--ht-border-color);
    color: var(--ht-color-text);
    text-decoration: none;
    transition: all 0.2s;
}

.talentora-pagination .page-numbers.current,
.talentora-pagination .page-numbers:hover {
    background: var(--ht-color-primary);
    color: var(--ht-color-white);
    border-color: var(--ht-color-primary);
}


/* ==========================================================================
   Single Job Page (New Structure)
   ========================================================================== */

/* Hero Section */
.job-hero-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 4rem 1rem;
    /* margin-bottom: -3rem;  */
    position: relative;
    color: #ffffff;
}

.job-hero-container {
    max-width: 1200px;
    margin: 0 auto;
}

.job-hero-content {
    max-width: 800px;
}

.job-hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin: 1rem 0;
    line-height: 1.2;
    color: #ffffff;
}

.job-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.hero-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 1.1rem;
}

.hero-meta-item .dashicons {
    color: var(--ht-color-primary-light, #818cf8);
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.company-website-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--ht-radius);
    transition: all 0.2s;
}

.company-website-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Main Content Layout */
.talentora-single-job .talentora-job-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 4rem 1rem;
}

.job-content-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2.5rem;
    align-items: start;
}

/* Info Cards Row */
.job-info-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Enforce 2 columns for neatness */
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    margin-top: 1rem;
}

.info-card {
    background: var(--ht-color-white);
    padding: 1.5rem;
    border-radius: var(--ht-radius);
    box-shadow: var(--ht-shadow-md);
    border: 1px solid var(--ht-border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--ht-color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ht-color-primary);
}

.info-card-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.info-card-content {
    flex: 1;
}

.info-card-label {
    font-size: 0.85rem;
    color: var(--ht-color-text-light);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.info-card-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ht-color-text);
}

/* Content Body */
.job-description-section {
    background: var(--ht-color-white);
    padding: 2.5rem;
    border-radius: var(--ht-radius);
    box-shadow: var(--ht-shadow-md);
    border: 1px solid var(--ht-border-color);
    margin-bottom: 2.5rem;
}

.content-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ht-border-color);
}

.content-section-title .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--ht-color-primary);
}

.description-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #334155;
}

.description-content h2,
.description-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--ht-color-text);
}

.description-content ul,
.description-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Sidebar */
.job-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.sidebar-card {
    background: var(--ht-color-white);
    padding: 1.5rem;
    border-radius: var(--ht-radius);
    box-shadow: var(--ht-shadow-md);
    border: 1px solid var(--ht-border-color);
}

.sidebar-card-title {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ht-color-text);
}

.sidebar-card-title .dashicons {
    color: var(--ht-color-primary);
}

/* Company Card */
.company-card {
    text-align: center;
}

.company-logo-wrapper {
    margin-bottom: 1rem;
}

.company-logo-wrapper img {
    max-width: 120px;
    border-radius: 8px;
}

.company-name {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
}

.company-website-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ht-color-primary);
    text-decoration: none;
    font-weight: 600;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    width: 100%;
    padding: 0.875rem;
    border-radius: var(--ht-radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 1rem;
    text-decoration: none;
}

.action-btn.primary {
    background: var(--ht-color-primary);
    color: #ffffff;
}

.action-btn.primary:hover {
    background: var(--ht-color-primary-dark);
}

.action-btn.secondary {
    background: var(--ht-color-bg);
    color: var(--ht-color-text);
    border: 1px solid var(--ht-border-color);
}

.action-btn.secondary:hover {
    background: #e2e8f0;
}

/* Summary List */
.summary-items {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.summary-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ht-border-color);
}

.summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ht-color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ht-color-primary);
    flex-shrink: 0;
}

.summary-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    color: var(--ht-color-text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.summary-value {
    font-weight: 700;
    color: var(--ht-color-text);
    font-size: 1rem;
    line-height: 1.4;
}

/* Application Form Redesign */
.talentora-form-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-grid-row {
    display: flex;
    gap: 1.5rem;
}

.talentora-form-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    margin-bottom: 1.5rem;
}

.talentora-form-field.full-width {
    width: 100%;
}

.talentora-form-field label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ht-color-text);
}

.talentora-form-field label .required {
    color: #e53e3e;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .dashicons {
    position: absolute;
    left: 1rem;
    color: var(--ht-color-text-light);
    pointer-events: none;
    z-index: 10;
}

.talentora-form-field input[type="text"],
.talentora-form-field input[type="email"],
.talentora-form-field input[type="tel"],
.talentora-form-field textarea {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem; /* Left padding for icon */
    border: 1px solid var(--ht-border-color);
    border-radius: var(--ht-radius);
    font-size: 1rem;
    color: var(--ht-color-text);
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

.talentora-form-field textarea {
    padding-left: 1rem; /* No icon for textarea usually */
    resize: vertical;
}

.talentora-form-field input:focus,
.talentora-form-field textarea:focus {
    outline: none;
    border-color: var(--ht-color-primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(var(--ht-color-primary-rgb), 0.1);
}

/* File Input Styling */
.file-input-wrapper {
    position: relative;
    width: 100%;
}

.inputfile {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background-color: #f8fafc;
    border: 1px dashed var(--ht-border-color);
    border-radius: var(--ht-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.file-input-label:hover {
    background-color: #edf2f7;
    border-color: var(--ht-color-primary);
}

.inputfile:focus + .file-input-label {
    box-shadow: 0 0 0 3px rgba(var(--ht-color-primary-rgb), 0.1);
    border-color: var(--ht-color-primary);
}

.file-input-label .dashicons {
    font-size: 1.25rem;
    color: var(--ht-color-primary);
}

.file-label-text {
    font-weight: 500;
    color: var(--ht-color-text);
}

.file-help-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--ht-color-text-light);
}

/* Submit Button */
.talentora-form-submit {
    margin-top: 1rem;
}

.talentora-button.large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--ht-color-primary);
    color: white;
    border: none;
    border-radius: var(--ht-radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.talentora-button.large:hover {
    background: var(--ht-color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

/* Responsive Form */
@media (max-width: 768px) {
    .form-grid-row {
        flex-direction: column;
        gap: 0;
    }
}


.apply-subtitle {
    margin-bottom: 2rem;
    color: var(--ht-color-text-light);
}

/* Responsive */
@media (max-width: 992px) {
    .job-content-grid {
        grid-template-columns: 1fr;
    }
    
    .job-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .job-hero-title {
        font-size: 2rem;
    }
    
    .job-info-cards {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .job-apply-section,
    .elementor-location-header,
    .elementor-location-footer,
    .site-header,
    .site-footer,
    .actions-card,
    #wpadminbar {
        display: none !important;
    }

    .job-content-grid {
        display: block;
    }

    .job-sidebar {
        margin-top: 2rem;
        page-break-inside: avoid;
    }

    .info-card, 
    .sidebar-card,
    .job-description-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Loading Spinner */
@keyframes ht-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: ht-spin 1s linear infinite;
    display: inline-block;
}
