/* Widget Principal - Style harmonisé avec Thiasos */
.thiasos-buddy-widget {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.widget-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    padding-top: 50px;
}

.widget-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.widget-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Bouton Actualiser - Style Thiasos */
.refresh-btn {
    position: absolute;
    top: 0;
    left: 20px;
    height: 40px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    padding: 0 16px;
    border-radius: 8px;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
}

.refresh-btn:hover {
    background: #f0f0f0;
    border-color: #d0d0d0;
    color: #333;
}

/* Cards Buddy - Style épuré */
.buddy-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.buddy-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: #e0e0e0;
}

.buddy-avatar img {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    flex-shrink: 0;
}

.buddy-info {
    flex: 1;
    min-width: 150px;
}

.buddy-info h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.compatibility-score {
    margin-bottom: 12px;
}

.compatibility-score .score {
    font-size: 14px;
    font-weight: 500;
    display: block;
    margin-bottom: 6px;
    color: #666;
}

/* Barre de progression - Couleurs Thiasos */
.progress-bar {
    background: #f5f5f5;
    border-radius: 6px;
    height: 6px;
    overflow: hidden;
    width: 100%;
}

.progress {
    background: linear-gradient(90deg, #ff6b4a, #ff8a65);
    height: 100%;
    border-radius: 6px;
    transition: width 1.5s ease;
    position: relative;
}

.progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.common-points {
    margin-bottom: 10px;
}

.common-points .tag {
    background: #f8f8f8;
    color: #666;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    margin-right: 6px;
    display: inline-block;
    margin-bottom: 4px;
    border: 1px solid #e8e8e8;
    font-weight: 500;
}

.buddy-motto {
    font-size: 13px;
    font-style: italic;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

/* Actions */
.buddy-actions {
    flex-basis: 100%;
    text-align: right;
}

/* Bouton Se connecter - Style Thiasos */
.btn-connect {
    background: #ff6b4a;
    border: none;
    height: 40px;
    padding: 0 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-connect:hover {
    background: #ff5722;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 74, 0.3);
}

/* No Suggestions */
.no-suggestions {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.no-suggestions p {
    margin: 8px 0;
}

/* Modal - Style harmonisé */
.buddy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #666;
}

.modal-content h3 {
    margin: 0 0 24px 0;
    color: #333;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
}

.connection-preview {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #f0f0f0;
}

.compatibility-info p {
    margin: 6px 0;
    color: #666;
    font-size: 14px;
}

.message-templates h4 {
    color: #333;
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
}

.template-btn {
    display: block;
    width: 100%;
    background: #f8f8f8;
    border: 2px solid #f0f0f0;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: all 0.3s ease;
    color: #333;
}

.template-btn:hover {
    background: #f0f0f0;
    border-color: #e0e0e0;
}

.template-btn.selected {
    background: rgba(255, 107, 74, 0.1);
    border-color: #ff6b4a;
    color: #ff6b4a;
}

.custom-message-area {
    margin: 16px 0;
}

.custom-message-area label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.custom-message-area textarea {
    width: 100%;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 14px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    color: #333;
}

.custom-message-area textarea:focus {
    border-color: #ff6b4a;
    outline: none;
}

.char-counter {
    display: block;
    text-align: right;
    color: #999;
    font-size: 12px;
    margin-top: 6px;
}

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

.btn-cancel, .btn-send {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

.btn-cancel:hover {
    background: #eeeeee;
    color: #333;
}

.btn-send {
    background: #ff6b4a;
    color: white;
}

.btn-send:hover:not(:disabled) {
    background: #ff5722;
    transform: translateY(-1px);
}

.btn-send:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.modal-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}

.modal-message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c8;
}

.modal-message.error {
    background: #ffeaea;
    color: #d32f2f;
    border: 1px solid #ffcaca;
}

/* Widget Footer */
.widget-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.widget-footer p {
    margin: 0;
    color: #888;
    font-size: 13px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .widget-header {
        padding-top: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    
    .refresh-btn {
        position: static;
        order: 3;
        margin-top: 16px;
    }
    
    .widget-header h3 { order: 1; }
    .widget-header p { order: 2; }
    
    .buddy-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .buddy-info {
        min-width: 100%;
    }

    .buddy-actions {
        width: 100%;
        text-align: center;
    }

    .modal-content {
        width: 95%;
        padding: 24px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 400px) {
    .thiasos-buddy-widget {
        padding: 20px;
    }
    
    .widget-header h3 {
        font-size: 18px;
    }
    
    .buddy-card {
        padding: 16px;
    }
    
    .buddy-info h4 {
        font-size: 15px;
    }
    
    .btn-connect {
        width: 100%;
        padding: 0 16px;
        font-size: 13px;
    }
}

/* Animations loading */
.buddy-suggestions.loading {
    opacity: 0.6;
    pointer-events: none;
}

.buddy-card.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}