/**
 * PWD Manager Advisor - Styles Frontend
 */

/* Container principal */
.pma-advisor-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Titre et intro */
.pma-title {
    font-size: 2em;
    color: #1a1a2e;
    margin-bottom: 10px;
    text-align: center;
}

.pma-intro {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* Formulaire */
.pma-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.pma-form-section {
    padding: 25px 30px;
    border-bottom: 1px solid #eee;
}

.pma-form-section:last-of-type {
    border-bottom: none;
}

.pma-form-section h3 {
    font-size: 1.2em;
    color: #1a1a2e;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #4361ee;
    display: inline-block;
}

.pma-field {
    margin-bottom: 20px;
}

.pma-field:last-child {
    margin-bottom: 0;
}

.pma-field label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.pma-field label .required {
    color: #e63946;
}

.pma-field input[type="number"],
.pma-field input[type="text"],
.pma-field select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
    box-sizing: border-box;
}

.pma-field input:focus,
.pma-field select:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.pma-field-hint {
    display: block;
    font-size: 0.85em;
    color: #888;
    margin-top: 5px;
}

/* Bouton submit */
.pma-submit-wrapper {
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    text-align: center;
}

.pma-submit-btn {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: #fff;
    border: none;
    padding: 16px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.pma-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.pma-submit-btn:active {
    transform: translateY(0);
}

.pma-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.pma-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.pma-btn-loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: pma-spin 0.8s linear infinite;
}

@keyframes pma-spin {
    to { transform: rotate(360deg); }
}

/* Résultats */
.pma-results-container {
    animation: pma-fadeIn 0.5s ease;
}

@keyframes pma-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pma-results-title {
    font-size: 1.8em;
    color: #1a1a2e;
    text-align: center;
    margin-bottom: 30px;
}

.pma-results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Carte de résultat */
.pma-result-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.pma-result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.pma-result-card.pma-top-result {
    border: 2px solid #4361ee;
    position: relative;
}

.pma-result-card.pma-top-result::before {
    content: '★ Meilleure correspondance';
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: #fff;
    padding: 5px 15px;
    font-size: 0.8em;
    font-weight: 600;
    border-bottom-left-radius: 8px;
}

.pma-result-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid #eee;
}

.pma-result-logo {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pma-result-logo-placeholder {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8em;
    font-weight: 700;
}

.pma-result-info {
    flex: 1;
}

.pma-result-name {
    font-size: 1.4em;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 5px 0;
}

.pma-result-description {
    color: #666;
    font-size: 0.95em;
    margin: 0;
    line-height: 1.5;
}

.pma-result-score {
    text-align: center;
}

.pma-score-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: conic-gradient(#4361ee calc(var(--score) * 1%), #e0e0e0 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pma-score-circle::before {
    content: '';
    position: absolute;
    width: 54px;
    height: 54px;
    background: #fff;
    border-radius: 50%;
}

.pma-score-value {
    position: relative;
    font-size: 1.2em;
    font-weight: 700;
    color: #4361ee;
}

.pma-score-label {
    font-size: 0.75em;
    color: #888;
    margin-top: 5px;
}

.pma-result-body {
    padding: 25px;
}

.pma-result-price {
    background: #f0f4ff;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95em;
    color: #333;
}

.pma-result-price strong {
    color: #4361ee;
}

.pma-result-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.pma-strengths h4,
.pma-weaknesses h4 {
    font-size: 0.9em;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pma-strengths h4 {
    color: #2a9d8f;
}

.pma-weaknesses h4 {
    color: #e76f51;
}

.pma-strengths ul,
.pma-weaknesses ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pma-strengths li,
.pma-weaknesses li {
    padding: 6px 0;
    font-size: 0.9em;
    color: #555;
    padding-left: 20px;
    position: relative;
}

.pma-strengths li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2a9d8f;
    font-weight: bold;
}

.pma-weaknesses li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: #e76f51;
    font-weight: bold;
}

.pma-result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pma-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.pma-btn-primary {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: #fff;
}

.pma-btn-primary:hover {
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

.pma-btn-secondary {
    background: #fff;
    color: #4361ee;
    border: 2px solid #4361ee;
}

.pma-btn-secondary:hover {
    background: #f0f4ff;
    color: #4361ee;
}

/* Contact CTA */
.pma-contact-cta {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    margin-top: 30px;
}

.pma-contact-cta h3 {
    font-size: 1.5em;
    margin: 0 0 15px 0;
}

.pma-contact-cta p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 25px 0;
}

.pma-contact-cta .pma-btn-primary {
    background: #fff;
    color: #1a1a2e;
}

.pma-contact-cta .pma-btn-primary:hover {
    background: #f0f4ff;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

/* Bouton retour */
.pma-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 12px 24px;
    background: transparent;
    border: 2px solid #ccc;
    border-radius: 8px;
    color: #666;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s;
}

.pma-back-btn:hover {
    border-color: #4361ee;
    color: #4361ee;
}

/* Aucun résultat */
.pma-no-results {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.pma-no-results p {
    color: #666;
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .pma-advisor-wrapper {
        padding: 15px;
    }

    .pma-title {
        font-size: 1.5em;
    }

    .pma-form-section {
        padding: 20px;
    }

    .pma-result-header {
        flex-direction: column;
        text-align: center;
    }

    .pma-result-card.pma-top-result::before {
        position: static;
        display: block;
        border-radius: 0;
        margin: -25px -25px 20px;
        padding: 10px;
    }

    .pma-result-lists {
        grid-template-columns: 1fr;
    }

    .pma-result-actions {
        flex-direction: column;
    }

    .pma-btn {
        justify-content: center;
    }

    .pma-contact-cta {
        padding: 30px 20px;
    }
}

/* Animation de chargement */
.pma-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pma-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #4361ee;
    border-radius: 50%;
    animation: pma-spin 0.8s linear infinite;
}

/* Match details tooltip */
.pma-match-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.pma-match-details summary {
    cursor: pointer;
    color: #4361ee;
    font-size: 0.9em;
    font-weight: 600;
}

.pma-match-details ul {
    list-style: none;
    padding: 10px 0 0 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pma-match-details li {
    background: #f0f4ff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #4361ee;
}
