/* Muster the Force AI Search - Fixed Styles */

/* Main wrapper */
.mtf-ai-search-wrapper {
    margin: 40px auto;
    max-width: 1200px;
    padding: 0 20px;
}

/* Search container */
.mtf-ai-search-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* Search input group */
.search-input-group {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 50px;
    box-shadow: 0 5px 30px rgba(26, 54, 93, 0.15);
    padding: 8px;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    border-color: #14b8a6;
    box-shadow: 0 5px 40px rgba(20, 184, 166, 0.2);
}

/* Search input */
.mtf-ai-search-input {
    flex: 1;
    border: none !important;
    padding: 18px 25px !important;
    font-size: 16px !important;
    outline: none !important;
    background: transparent !important;
    color: #1a365d !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    min-width: 0;
    box-shadow: none !important;
    height: auto !important;
    line-height: normal !important;
}

.mtf-ai-search-input::placeholder {
    color: #94a3b8 !important;
}

/* Search button */
.mtf-ai-search-button {
    background: linear-gradient(135deg, #86efac 0%, #14b8a6 50%, #0891b2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 15px 35px !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin: 0 !important;
    height: auto !important;
    line-height: normal !important;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3) !important;
}

.mtf-ai-search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(20, 184, 166, 0.4) !important;
    background: linear-gradient(135deg, #6ee7b7 0%, #10b981 50%, #0891b2 100%) !important;
}

.search-icon {
    font-size: 18px;
}

/* AI Powered Badge */
.ai-powered-badge {
    position: absolute;
    top: -12px;
    right: 30px;
    background: #1a365d;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 10px rgba(26, 54, 93, 0.2);
    z-index: 10;
}

/* Filters Section */
.mtf-search-filters {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.mtf-filter {
    padding: 12px 20px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 30px !important;
    background: white !important;
    font-size: 14px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #475569 !important;
    font-weight: 500;
    min-width: fit-content;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%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 15px center !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}

.mtf-filter:hover {
    border-color: #14b8a6 !important;
    color: #14b8a6 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.15);
}

.mtf-filter:focus {
    outline: none !important;
    border-color: #14b8a6 !important;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1) !important;
}

/* Suggestions dropdown */
.mtf-ai-suggestions {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(26, 54, 93, 0.15);
    margin-top: 10px;
    display: none;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.mtf-ai-suggestions.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestions-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.suggestion-item {
    padding: 16px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
    color: #475569;
    font-size: 15px;
    margin: 0 !important;
}

.suggestion-item:hover {
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.05) 0%, rgba(20, 184, 166, 0.1) 100%);
    color: #14b8a6;
    padding-left: 28px;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Results section */
.mtf-search-results {
    margin-top: 50px;
    display: none;
}

.mtf-search-results.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Loading state */
.loading-state {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #14b8a6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    color: #64748b;
    font-size: 16px;
    margin: 0;
}

/* Job results grid */
.job-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

/* Job card */
.job-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.job-card:hover {
    box-shadow: 0 10px 40px rgba(26, 54, 93, 0.1);
    transform: translateY(-4px);
    border-color: #14b8a6;
}

.job-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.company-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.job-main-info {
    flex: 1;
}

.job-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #1a365d !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.3 !important;
}

.job-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #64748b;
}

.company-name {
    font-weight: 500;
    color: #475569;
}

/* AI Match Score */
.ai-match-score {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #86efac 0%, #14b8a6 50%);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 60px;
}

.ai-match-score .score {
    font-size: 18px;
    display: block;
}

.ai-match-score .label {
    font-size: 11px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-match-score.excellent {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ai-match-score.good {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.ai-match-score.fair {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .mtf-ai-search-wrapper {
        margin: 20px auto;
    }
    
    .search-input-group {
        flex-direction: column;
        border-radius: 20px;
        padding: 20px;
        gap: 15px;
    }
    
    .mtf-ai-search-input {
        width: 100% !important;
        text-align: center;
        padding: 16px 20px !important;
    }
    
    .mtf-ai-search-button {
        width: 100% !important;
        justify-content: center;
        padding: 16px 30px !important;
    }
    
    .ai-powered-badge {
        position: static;
        display: inline-flex;
        margin: 10px auto 0;
    }
    
    .mtf-search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mtf-filter {
        width: 100% !important;
        text-align: center;
    }
    
    .job-results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .ai-match-score {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
    }
    
    .ai-match-score .score {
        font-size: 16px;
    }
}

/* WorkScout Theme Compatibility */
.page-template-default .mtf-ai-search-wrapper {
    margin-top: 40px;
}

/* Override any conflicting WorkScout styles */
.mtf-ai-search-wrapper * {
    box-sizing: border-box;
}

.mtf-ai-search-wrapper input[type="text"],
.mtf-ai-search-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Hide any default WorkScout search if present on same page */
.search-form-wrapper {
    display: none;
}

/* Enhanced Search Results Styling */

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 20px;
}

.results-header h3 {
    font-size: 24px;
    color: #1a365d;
    margin: 0;
}

.result-count {
    color: #14b8a6;
    font-weight: 700;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sort-options {
    display: flex;
    gap: 10px;
}

.sort-btn {
    background: white;
    border: 2px solid #e5e7eb;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.sort-btn:hover {
    border-color: #14b8a6;
    color: #14b8a6;
}

.sort-btn.active {
    background: #14b8a6;
    color: white;
    border-color: #14b8a6;
}

.view-toggle {
    width: 40px;
    height: 40px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #475569;
}

.view-toggle:hover {
    border-color: #14b8a6;
    color: #14b8a6;
}

/* AI Insights Panel */
.ai-insights-panel {
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.insights-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #1a365d;
}

.insights-header i {
    color: #14b8a6;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.insight-icon {
    font-size: 32px;
}

.insight-content {
    flex: 1;
}

.insight-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a365d;
    margin-bottom: 4px;
}

.insight-label {
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Job Cards */
.job-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.job-results-grid.list-view {
    grid-template-columns: 1fr;
}

.job-results-grid.list-view .job-card {
    display: flex;
    align-items: center;
    padding: 20px 30px;
}

.job-results-grid.list-view .job-card-header {
    flex: 1;
    margin-bottom: 0;
}

.job-results-grid.list-view .job-description {
    display: none;
}

.job-results-grid.list-view .job-skills {
    flex: 0 0 auto;
    margin: 0 20px;
}

.job-card.enhanced {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 28px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
}

.job-card.enhanced.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.job-card.enhanced:hover {
    box-shadow: 0 10px 40px rgba(26, 54, 93, 0.12);
    transform: translateY(-4px);
    border-color: rgba(20, 184, 166, 0.5);
}

.company-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    background: #f3f4f6;
}

.company-logo-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: #64748b;
}

.job-main-info {
    flex: 1;
    padding-right: 70px;
}

.job-title {
    font-size: 19px !important;
    font-weight: 600 !important;
    color: #1a365d !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.3 !important;
    transition: color 0.3s ease;
}

.job-card:hover .job-title {
    color: #14b8a6 !important;
}

.job-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    flex-wrap: wrap;
}

.separator {
    color: #cbd5e1;
}

/* AI Match Indicator */
.ai-match-indicator {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bar {
    stroke-dasharray: 0 163;
    transition: stroke-dasharray 1.5s ease;
    animation: progressAnimation 1.5s ease forwards;
}

@keyframes progressAnimation {
    from {
        stroke-dasharray: 0 163;
    }
}

.match-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.match-score-text .score {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1a365d;
}

.match-score-text .label {
    display: block;
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
}

/* Job Skills */
.job-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.skill-tag {
    background: #f0fdf4;
    color: #14b8a6;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(20, 184, 166, 0.2);
}

/* Job Card Footer */
.job-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.job-footer-info {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #64748b;
}

.job-footer-info i {
    margin-right: 4px;
}

.job-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-save {
    width: 36px;
    height: 36px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #64748b;
}

.btn-save:hover {
    border-color: #ef4444;
    color: #ef4444;
    transform: scale(1.1);
}

.btn-save.saved {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-quick-apply {
    background: linear-gradient(135deg, #86efac 0%, #14b8a6 50%, #0891b2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-quick-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(20, 184, 166, 0.3);
}

.btn-view-details {
    color: #14b8a6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.btn-view-details:hover {
    color: #0891b2;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: 50px;
}

.load-more-btn {
    background: white;
    border: 2px solid #14b8a6;
    color: #14b8a6;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.load-more-btn:hover {
    background: #14b8a6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(20, 184, 166, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.remaining-count {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.8;
}

/* Quick Apply Modal */
.quick-apply-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    margin: 0 0 20px 0;
    color: #1a365d;
    font-size: 24px;
}

.form-group {
    margin: 20px 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-weight: 500;
}

.personal-note {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.personal-note:focus {
    outline: none;
    border-color: #14b8a6;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-cancel {
    background: white;
    border: 2px solid #e5e7eb;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    border-color: #64748b;
}

.btn-confirm-apply {
    background: linear-gradient(135deg, #86efac 0%, #14b8a6 50%, #0891b2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-confirm-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(20, 184, 166, 0.3);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: -400px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    transition: right 0.3s ease;
    z-index: 10001;
}

.toast-notification.show {
    right: 30px;
}

.toast-notification.success {
    border-left: 4px solid #10b981;
}

.toast-notification.success i {
    color: #10b981;
}

.toast-notification.info {
    border-left: 4px solid #3b82f6;
}

.toast-notification.info i {
    color: #3b82f6;
}

/* Animations */
.animated-fade-in {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.animated-fade-in.fade-in {
    opacity: 1;
}

.animated-slide-down {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.6s ease;
}

.animated-slide-down.slide-down {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .sort-options {
        flex-wrap: wrap;
    }
    
    .sort-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .job-results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .job-card.enhanced {
        padding: 20px;
    }
    
    .ai-match-indicator {
        width: 50px;
        height: 50px;
        top: 16px;
        right: 16px;
    }
    
    .match-score-text .score {
        font-size: 16px;
    }
    
    .insights-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .insight-item {
        padding: 15px;
    }
    
    .insight-icon {
        font-size: 24px;
    }
    
    .insight-value {
        font-size: 16px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .toast-notification {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
    
    .toast-notification.show {
        right: 20px;
    }
}

/* Homepage Specific Styles */
.home .mtf-search-results {
    max-width: 1400px;
    margin: 50px auto;
    padding: 0 20px;
}

.home .ai-search-showcase {
    position: relative;
    z-index: 100;
}