/**
 * Psylancer AI Matcher - Minimal CSS (Leverages site's Bootstrap)
 * 
 * This CSS only adds necessary styles for the matcher plugin
 * while using Psylancer.com's existing Bootstrap classes and theme
 */

/* Container - use site's standard card layout */
.psylancer-ai-matcher {
    margin: 40px auto;
}

/* Form container - use Bootstrap card styling */
.psylancer-ai-matcher .matcher-container {
    /* Inherit site's card styles */
}

/* Header - use site's info/teal color */
.psylancer-ai-matcher .matcher-title {
    background-color: #699cbb;
    color: #fff;
    padding: 2rem;
    margin: 0;
    border-radius: 0.25rem 0.25rem 0 0;
}

/* Form section */
.psylancer-ai-matcher .matcher-form {
    padding: 2rem;
}

.psylancer-ai-matcher .form-group {
    margin-bottom: 1.5rem;
}

.psylancer-ai-matcher .form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.psylancer-ai-matcher .form-group label .required {
    color: #dc3545;
}

/* Use Bootstrap form controls */
.psylancer-ai-matcher textarea,
.psylancer-ai-matcher select {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.psylancer-ai-matcher textarea:focus,
.psylancer-ai-matcher select:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25);
}

.psylancer-ai-matcher .form-help {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.psylancer-ai-matcher .form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.psylancer-ai-matcher .form-group-half {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

/* Buttons - use Bootstrap btn classes */
.psylancer-ai-matcher .form-actions {
    text-align: center;
    margin-top: 1.5rem;
}

.psylancer-ai-matcher .button {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}

.psylancer-ai-matcher .button-primary {
    color: #fff;
    background-color: #699cbb;
    border-color: #699cbb;
}

.psylancer-ai-matcher .button-primary:hover {
    color: #fff;
    background-color: #138496;
    border-color: #117a8b;
}

.psylancer-ai-matcher .button-secondary {
    color: #6c757d;
    background-color: transparent;
    border-color: #6c757d;
}

.psylancer-ai-matcher .button-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.psylancer-ai-matcher .button-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Loading spinner */
.psylancer-ai-matcher .matching-loader {
    text-align: center;
    padding: 3rem 2rem;
}

.psylancer-ai-matcher .spinner {
    display: inline-block;
    width: 3rem;
    height: 3rem;
    vertical-align: text-bottom;
    border: 0.25rem solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
    color: #699cbb;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

.psylancer-ai-matcher .loader-text {
    margin-top: 1rem;
    font-weight: 600;
}

.psylancer-ai-matcher .loader-subtext {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Results */
.psylancer-ai-matcher .matching-results {
    padding: 2rem;
}

.psylancer-ai-matcher .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #699cbb;
}

.psylancer-ai-matcher .results-header h3 {
    margin: 0;
    font-size: 1.75rem;
}

/* Therapist cards - use Bootstrap card structure */
.psylancer-ai-matcher .therapist-match-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,0.125);
    border-left: 4px solid #699cbb;
    border-radius: 0.25rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.psylancer-ai-matcher .therapist-match-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.psylancer-ai-matcher .therapist-match-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

.psylancer-ai-matcher .match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.psylancer-ai-matcher .match-header h4 {
    margin: 0;
    font-size: 1.5rem;
}

/* Badge styling */
.psylancer-ai-matcher .match-score {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    color: #fff;
    background-color: #699cbb;
}

.psylancer-ai-matcher .match-score[data-score^="0.9"],
.psylancer-ai-matcher .match-score[data-score^="0.8"] {
    background-color: #6aa371;
}

.psylancer-ai-matcher .match-score[data-score^="0.7"],
.psylancer-ai-matcher .match-score[data-score^="0.6"] {
    background-color: #699cbb;
}

.psylancer-ai-matcher .match-score[data-score^="0.5"],
.psylancer-ai-matcher .match-score[data-score^="0.4"],
.psylancer-ai-matcher .match-score[data-score^="0.3"] {
    background-color: #6c757d;
}

.psylancer-ai-matcher .professional-type {
    color: #699cbb;
    font-weight: 600;
    margin: 0 0 1rem;
}

.psylancer-ai-matcher .match-reason {
    color: #495057;
    line-height: 1.6;
    margin: 1rem 0;
}

/* Details section - use Bootstrap alert styling */
.psylancer-ai-matcher .match-details {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin: 1rem 0;
    border: 1px solid #f7f7f7;
    border-radius: 0.25rem;
    background-color: #f7f7f7;
    color: #0c5460;
}

.psylancer-ai-matcher .match-details p {
    margin: 0.5rem 0;
}

.psylancer-ai-matcher .match-details strong {
    color: #699cbb;
    font-weight: 600;
}

.psylancer-ai-matcher .match-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.125);
}

/* Error state - use Bootstrap alert */
.psylancer-ai-matcher .matching-error {
    padding: 2rem;
    text-align: center;
}

.psylancer-ai-matcher .error-message {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #ffeaa7;
    border-radius: 0.25rem;
    background-color: #fff3cd;
    color: #856404;
}

/* Responsive - Bootstrap breakpoints */
@media (max-width: 767.98px) {
    .psylancer-ai-matcher .matcher-title {
        font-size: 1.5rem;
        padding: 1.5rem;
    }
    
    .psylancer-ai-matcher .matcher-form,
    .psylancer-ai-matcher .matching-results {
        padding: 1.5rem;
    }
    
    .psylancer-ai-matcher .form-row {
        flex-direction: column;
    }
    
    .psylancer-ai-matcher .form-group-half {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .psylancer-ai-matcher .match-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .psylancer-ai-matcher .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .psylancer-ai-matcher .button,
    .psylancer-ai-matcher .button-large {
        width: 100%;
    }
}

/* Hide states */
.psylancer-ai-matcher .matcher-form.hidden,
.psylancer-ai-matcher .matching-loader.hidden,
.psylancer-ai-matcher .matching-results.hidden,
.psylancer-ai-matcher .matching-error.hidden {
    display: none !important;
}